Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1046106imm; Fri, 15 Jun 2018 10:16:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIR25hB0F8C9MUys/OTN8D5pn+4CAvhujEBTJ8HOypEI7nJFytpOYPl2dJRQk4VXMk+FgjL X-Received: by 2002:a63:4d14:: with SMTP id a20-v6mr2443419pgb.46.1529082998623; Fri, 15 Jun 2018 10:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529082998; cv=none; d=google.com; s=arc-20160816; b=JIPpSxF0axigMNMrhQUS+e59IMZ9wi9+5cYElNIQjvopzqbvgUNtDkU5OoXIhI0Re2 0btjFJUNWodknnmIFSyHGv64vA4XO8Hpaa+OZF47ZuIy72vaM+PO+ssmHKUjstq4MrXF OOvoUIk00pcLWKNKkrMECc6syfZv7Xb52N1Dc6HlSbLB5Y+xRjU7rvrZRRVvBeJ1T1s+ 3Xb3xg8R0izs5crJ2gPtZ/yU4CpjjBoLk7VMRc6agWlCQ+Cz9cvYb9gFJTkkxgUvrS9i e0VJlJiv4Uea2P+q7ItLYbilS8OljA4FhUeHwbFjPL9lBqcjrCMKzViaWMU8eZaPQZZm oPug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :arc-authentication-results; bh=OYsgccU3k5RPtGqvSWDh96J3EI9kp6i5wwi/C18lD8c=; b=q58pLl4HFAnHD72vva6D/UmraRYAsR2QGwaTGQ+gw9YGuAY63jY4Zs9+Ml2AyiCvmV Ojxl8eGQoxWWar9qamtWLpy7hHTnai/NWCo2Ha5LxRb5eUwVMrhRyT6POueilFA+UpbL AKcb1Bgv2Ut8sJbss7U4aULEdzYb7VgliaMURcFiUO7vLJE1Je5px5rcwNFDsZaNc44m cNGsOtht9kuvcSD6oXB/Q8gnxYdkKXucPOeuxnC1oLo5BYI4g1VPeXxZZmeCuavZlZvH xa7Z18GbGImXhvtomrun5VMhuVb8sCixNxDvIcu/qYEVV8tf3amlpvjg2vc/LIdUFkYq GRSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t138-v6si6866413pgb.124.2018.06.15.10.16.23; Fri, 15 Jun 2018 10:16:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966007AbeFORNn convert rfc822-to-8bit (ORCPT + 99 others); Fri, 15 Jun 2018 13:13:43 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35388 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756314AbeFORNl (ORCPT ); Fri, 15 Jun 2018 13:13:41 -0400 Received: by mail-wm0-f68.google.com with SMTP id j15-v6so5135853wme.0; Fri, 15 Jun 2018 10:13:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tQVPlrQID9tyIuc78cpsyLCRRJsK74UL48g9PkmLhYI=; b=UtDnbKVOIQ7GMYgaqGEvmi4Iv7XOnOnj86s0OfAGRaUZjUZfCYBcU44VICINyhVpFb LLFPtToT4qU5QGHQKd/hQenBL+ag0adzA++yjca9qMM5CG+8JS8r1fsk7+SxlWFXIpis h6hkLcm5voKCkZqYk4Tn7olYoeBsCXT7v9BaVDwNdA0cwDrP9cs4oEd14uQkcuqezO92 e2nsdawrCMU7mwqnKBi6RF8tugpxfWdXCheoJNxgVKdXdaCs/JI4FCu0rwCrTcY/oIGY v/wPLfHUX/fhqbUNIKvXdWISJXe+UZUKdeeiUauC0tiU1EiCsKyJN9dcTUFcc0t6e0AG MjyQ== X-Gm-Message-State: APt69E2TLqivlinZ/AHQbXgkCYIGWVBXuZ2nhc8rlz2n6xMK5R4HOoIh lgirTmZjMLVEtP6yBLT5WcauY5qC X-Received: by 2002:a50:81a4:: with SMTP id 33-v6mr2544206ede.215.1529082819489; Fri, 15 Jun 2018 10:13:39 -0700 (PDT) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com. [74.125.82.47]) by smtp.gmail.com with ESMTPSA id b58-v6sm4223184edb.59.2018.06.15.10.13.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 10:13:38 -0700 (PDT) Received: by mail-wm0-f47.google.com with SMTP id v16-v6so4618824wmh.5; Fri, 15 Jun 2018 10:13:38 -0700 (PDT) X-Received: by 2002:a1c:454f:: with SMTP id s76-v6mr1855581wma.16.1529082818254; Fri, 15 Jun 2018 10:13:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:a158:0:0:0:0:0 with HTTP; Fri, 15 Jun 2018 10:13:17 -0700 (PDT) In-Reply-To: <2948115.KggauuSURZ@jernej-laptop> References: <20180612200036.21483-1-jernej.skrabec@siol.net> <20180612200036.21483-12-jernej.skrabec@siol.net> <20180615083110.laruycabvyjmesmo@flea> <2948115.KggauuSURZ@jernej-laptop> From: Chen-Yu Tsai Date: Sat, 16 Jun 2018 01:13:17 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linux-sunxi] Re: [PATCH v2 11/27] drm/sun4i: tcon: Add support for tcon-top gate To: Jernej Skrabec Cc: Maxime Ripard , Rob Herring , David Airlie , Gustavo Padovan , Maarten Lankhorst , Sean Paul , Mark Rutland , dri-devel , devicetree , linux-arm-kernel , linux-kernel , linux-clk , linux-sunxi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 16, 2018 at 12:41 AM, Jernej Škrabec wrote: > Hi, > > Dne petek, 15. junij 2018 ob 10:31:10 CEST je Maxime Ripard napisal(a): >> Hi, >> >> On Tue, Jun 12, 2018 at 10:00:20PM +0200, Jernej Skrabec wrote: >> > TV TCONs connected to TCON TOP have to enable additional gate in order >> > to work. >> > >> > Add support for such TCONs. >> > >> > Signed-off-by: Jernej Skrabec >> > --- >> > >> > drivers/gpu/drm/sun4i/sun4i_tcon.c | 11 +++++++++++ >> > drivers/gpu/drm/sun4i/sun4i_tcon.h | 4 ++++ >> > 2 files changed, 15 insertions(+) >> > >> > diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c >> > b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 08747fc3ee71..0afb5a94a414 >> > 100644 >> > --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c >> > +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c >> > @@ -688,6 +688,16 @@ static int sun4i_tcon_init_clocks(struct device *dev, >> > >> > dev_err(dev, "Couldn't get the TCON bus clock\n"); >> > return PTR_ERR(tcon->clk); >> > >> > } >> > >> > + >> > + if (tcon->quirks->has_tcon_top_gate) { >> > + tcon->top_clk = devm_clk_get(dev, "tcon-top"); >> > + if (IS_ERR(tcon->top_clk)) { >> > + dev_err(dev, "Couldn't get the TCON TOP bus clock\n"); >> > + return PTR_ERR(tcon->top_clk); >> > + } >> > + clk_prepare_enable(tcon->top_clk); >> > + } >> > + >> >> Is it required for the TCON itself to operate, or does the TCON >> requires the TCON TOP, which in turn requires that clock to be >> functional? >> >> I find it quite odd to have a clock that isn't meant for a particular >> device to actually be wired to another device. I'm not saying this >> isn't the case, but it would be a first. > > Documentation doesn't say much about that gate. I did few tests and TCON > registers can be read and written even if TCON TOP TV TCON gate is disabled. > However, there is no image, as expected. The R40 manual does include it in the diagram, on page 504. There's also a mux to select whether the clock comes directly from the CCU or the TV encoder (a feedback mode?). I assume this is the gate you are referring to here, in which case it is not a bus clock, but rather the TCON module or channel clock, strangely routed. > More interestingly, I enabled test pattern directly in TCON to eliminate > influence of the mixer. As soon as I disabled that gate, test pattern on HDMI > screen was gone, which suggest that this gate influences something inside > TCON. > > Another test I did was that I moved enable/disable gate code to > sun4i_tcon_channel_set_status() and it worked just as well. > > I'll ask AW engineer what that gate actually does, but from what I saw, I > would say that most appropriate location to enable/disable TCON TOP TV TCON > gate is TCON driver. Alternatively, TCON TOP driver could check if any TV TCON > is in use and enable appropriate gate. However, that doesn't sound right to me > for some reason. If what I said above it true, then yes, the appropriate location to enable it is the TCON driver, but moreover, the representation of the clock tree should be fixed such that the TCON takes the clock from the TCON TOP as its channel/ module clock instead. That way you don't need this patch, but you'd add another for all the clock routing. ChenYu