Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp9690imm; Mon, 21 May 2018 01:08:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZolZXHcBjbCkrxwxkpNkn0CRePoTWBWXnvQmImuHSFfLI74NBAWqQCa0/v6SxRZZITodL8H X-Received: by 2002:a62:48d1:: with SMTP id q78-v6mr19242413pfi.70.1526890126714; Mon, 21 May 2018 01:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526890126; cv=none; d=google.com; s=arc-20160816; b=o6wP+37ay+G5fkUx3JfUfRqjBar3swRq7IVMx2Cho6Pz6cPnZwD+lWbccGUAAq+IwC vihOdm7zywwgLVdLQy84F1EJ54+hp8Yx5WkXX9hXRMsU2wQSDrcF24BPgEoksr4VRZ1M maU2UQnmOuruVHiJr0DzLttQHJBzWqw2ZnTsGl/nPQyeHtqrCdmV+VujwxGGgygsUdjZ U+ROYbjS9AvjGhnvDSM2FVDDhe6bbks8gJwX4Nxfb2WvRygsDbIjHdSBufC5STtirUDu Qkoq4R4ZNNuA7TwupOGkFnrVJJUHdFkiN+EzKGL1Ct9X/h6+5XmfRtBPbXOeSgiijsfC IPyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=YeoDZwa0KJbibZHi6nWfSbnxPRAVh7JwTG2yVC33pF4=; b=dMg0eZoJd5CJ85AvwHKRWyb98wQMyDJBGZy/chX8Cpd0jcCRNc42tQvfgBZaLlfXuY PX0nQpoznIg6yUAsbpiop7gvArRbImmG6JwquOdmCuM0vHSgqEDGemO2H81HFC/i/YuU QO1IWiuw0bRosbLSuH6aWQm7dJe1kzrZpEzZCUGP5xryn+wJWvcvD4oSCDJEJBkAfzD+ zp6ug5IwfCKTIGDvWwTFgk9l18p6nNt4Pxd6f5P05UnKeUmB5/NthaWJSsF6DUhp94AY ybgmZI2AGhdQmXCcKzKLpctOH5aBUwh06+gZzGldI5UNXrjLr7qOCQ4YdShiK3e7FIZ9 N5kQ== 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 p3-v6si13701545pld.408.2018.05.21.01.08.30; Mon, 21 May 2018 01:08:46 -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 S1751133AbeEUIIO (ORCPT + 99 others); Mon, 21 May 2018 04:08:14 -0400 Received: from mail.bootlin.com ([62.4.15.54]:37995 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbeEUIIL (ORCPT ); Mon, 21 May 2018 04:08:11 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 074022078B; Mon, 21 May 2018 10:08:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id C720B20739; Mon, 21 May 2018 10:07:58 +0200 (CEST) Date: Mon, 21 May 2018 10:07:59 +0200 From: Maxime Ripard To: Jernej Skrabec Cc: wens@csie.org, robh+dt@kernel.org, mark.rutland@arm.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH 06/15] drm/sun4i: tcon: Add support for tcon-top Message-ID: <20180521080759.rgviuva65ijcfm2e@flea> References: <20180519183127.2718-1-jernej.skrabec@siol.net> <20180519183127.2718-7-jernej.skrabec@siol.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hpqwgjovcbtgqx7h" Content-Disposition: inline In-Reply-To: <20180519183127.2718-7-jernej.skrabec@siol.net> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --hpqwgjovcbtgqx7h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 19, 2018 at 08:31:18PM +0200, Jernej Skrabec wrote: > If SoC has TCON TOP unit, it has to be configured from TCON, since it > has all information needed. Additionally, if it is TCON TV, it must also > enable bus gate inside TCON TOP unit. Why? > Add support for such TCONs. >=20 > Signed-off-by: Jernej Skrabec > --- > drivers/gpu/drm/sun4i/sun4i_tcon.c | 28 ++++++++++++++++++++++++++++ > drivers/gpu/drm/sun4i/sun4i_tcon.h | 8 ++++++++ > 2 files changed, 36 insertions(+) >=20 > diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/s= un4i_tcon.c > index 08747fc3ee71..e0c562ce1c22 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->needs_tcon_top && tcon->quirks->has_channel_1) { > + tcon->top_clk =3D 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); > + } > + > clk_prepare_enable(tcon->clk); > =20 > if (tcon->quirks->has_channel_0) { > @@ -712,6 +722,7 @@ static int sun4i_tcon_init_clocks(struct device *dev, > static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon) > { > clk_disable_unprepare(tcon->clk); > + clk_disable_unprepare(tcon->top_clk); > } > =20 > static int sun4i_tcon_init_irq(struct device *dev, > @@ -980,6 +991,23 @@ static int sun4i_tcon_bind(struct device *dev, struc= t device *master, > tcon->id =3D engine->id; > tcon->quirks =3D of_device_get_match_data(dev); > =20 > + if (tcon->quirks->needs_tcon_top) { > + struct device_node *np; > + > + np =3D of_parse_phandle(dev->of_node, "allwinner,tcon-top", 0); > + if (np) { > + struct platform_device *pdev; > + > + pdev =3D of_find_device_by_node(np); > + if (pdev) > + tcon->tcon_top =3D platform_get_drvdata(pdev); > + of_node_put(np); > + > + if (!tcon->tcon_top) > + return -EPROBE_DEFER; > + } > + } > + I might have missed it, but I've not seen the bindings additions for that property. This shouldn't really be done that way anyway, instead of using a direct phandle, you should be using the of-graph, with the TCON-top sitting where it belongs in the flow of data. Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --hpqwgjovcbtgqx7h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlsCfl4ACgkQ0rTAlCFN r3S9AQ/+JPfhJ0iDva/Y/hg0a1JulJ5HlTQ5T5gFfD51q6wf0NGh1WCp6QEPOrea RgvO5QSwkZn2849ygj+ISHr2PbUmbaDqe2qEJntJFPRUhdwvho3/3oCRq68n+/E1 P/SJvCvribHnQBILNbrBwP9SovDva0icOICJcCAboac4vrRhNhSr4CwNWOGJEtC3 g7Rthf9Lk5axhgFQX2/u1M9Q1ocfD0uTCfednvlVGIjWx2By0HL4wkV3C81iWUoT NqnTIPVHo3ZwxWViOiFEp0zdvx3eDQ9v79y9aEKnd1A1GNT84izMACjngez0rkVz l4gY+rVfvka9W1Nw4EGrQhix4smH5p/Vb9y/5lc3fOS5AHTPuBUPLRuPfZZRUKjj T17XrusCGCYeSgk+nuXqS7AaSHKdHYLiYFlkOGcBsU4fRTrZXeYTFoYmKtE1zkqA Kj/YpP856mnHSRmNBXZLe1mrbP8SDAvuFXRS4Y+um69ACaZxInq0OEuNKGJZH7BM S8fwMnnbOr1XrFiDvjkklRf+mmAgo+m8xRO8YCX1qoN1lxEeyRBcatqj2S0HNaIY pvqIAcEhBedQAycsbRrGjwaq6Ewnsy/8v8PUkS/E9u3uYswQBh56z6wS6L46CLuk 5HQL9CZmo8xMWtMzM5MkCqsiMTGd7diWx/e0yuUFhn4rA5iQkz8= =WmZF -----END PGP SIGNATURE----- --hpqwgjovcbtgqx7h--