Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp512346ybv; Wed, 19 Feb 2020 04:07:44 -0800 (PST) X-Google-Smtp-Source: APXvYqxlEeyIm47fL/4WES4iFE7GIq06E9JUeydMfI3RgkkXXukCYP24DuZSHdW/eejtLBpxPQHn X-Received: by 2002:aca:d954:: with SMTP id q81mr4375335oig.157.1582114064696; Wed, 19 Feb 2020 04:07:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582114064; cv=none; d=google.com; s=arc-20160816; b=eutNr2gH7uDjJ03qJ/7++GRhYCbuGipNAReT270NDAVh6fD443UNJiBiqyVmR86h38 hzVsGSE0CnmbHOTyNPHU62bNNXATF/UGZcK9xdrNhN+btucDjpCiU+yRtjktTd+y5jfx eImN0IzfiGyzfjSXmAz0EMU2gX83KwPBj4dCUqGdZv0Yvi4DJoVMThg4zHJgCz+fCWkO 6RWobF5XPeGSjltIlKmFun0sXVg8MRJBajEQW6+qsKsEjsn4sTn3GKjfsBG7dYKeBqh5 KPJiYcU9K1dAtM2zeIa3wDxzdxI0PQMBcBXGaUSK2uVy36P9z2Ok0+0V5rqLmhBUV0Rl ZXVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=0b7LbPDRm66st08CrUavOtRc+x1odA9gkGMkT5ktnmU=; b=Tg8HEv+eJ57J2bnNXnjnpdQG9W4/hvttdrRkybU62LqQ6QF+doTkOL/sk1g2gixgeA gb+zerSH/hJ/m2+wBAp2ymTn20Sero9NY8p6+Xec1N8R9qP5LpIcKmuTXDAtD+VMNY5P +SZGuPu8rE3IqINRaeKenDwxOjWngGTKO3i9n1QjDfC1bhMEhnvEjLX1n17iM/Iric60 qiupWUOSDBfeNRCfsbsGyaeF2OXTXr+Skys1jKWkei1aMbV3dNg4XMD6JkjFuVdtmApT qNnX4rhLNeJFy4YgrT9H7qb6ZkE9EctPtXytSP/nzD58mHcqgrrMEWQhTtW0hkvZiMkE jQ6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=k7kORyPN; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="p0/CFXzG"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14si8679147oic.201.2020.02.19.04.07.25; Wed, 19 Feb 2020 04:07:44 -0800 (PST) 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; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=k7kORyPN; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="p0/CFXzG"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727161AbgBSMGt (ORCPT + 99 others); Wed, 19 Feb 2020 07:06:49 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42143 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726495AbgBSMGt (ORCPT ); Wed, 19 Feb 2020 07:06:49 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id ABBEB216C5; Wed, 19 Feb 2020 07:06:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 19 Feb 2020 07:06:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=0b7LbPDRm66st08CrUavOtRc+x1 odA9gkGMkT5ktnmU=; b=k7kORyPNOJ4/muCan8ztd46ndp40yfqjPuYND55cXgK Q/LxEy7BGBvzldTzVh0xnnHyeFuwJo5PQiGFt7tA0PisvH0nCMHGcPJGPYlSaK6c 3HcyghIqWRFT/BqR0FEkdR8C4EHwv3YNJuMWqdThnNbU2xp20s3nH1CKoY8cd0DP P5GO5zEAuZResXqG2ZzVwQIMJgP9Vm/SIsBQYzZB46n/CJzkdcYtSAaNichj7rPD /tpZoEWklRnS+jWfq0EjUYhzoVYw/zh3tEPnCTTpP0khdr8S3JBselFAGyz808hC euBM+DvJJxaIw7eN3x0Kv4TcPKYkZyyf1js8H/X9Uag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=0b7LbP DRm66st08CrUavOtRc+x1odA9gkGMkT5ktnmU=; b=p0/CFXzGVcl+eymOIW0bNu 7G9DZWCUvkWv1zmpJ4WoSNh10axUg8wh3pmPqmfKhebJcHhmeEyOvOGZUH01Xu2R o2vFAC1mgTL9kSihugk4Pd9nhHs5vUa9zsSUTrZ/C8pS6h1ncaKNS7icWSMN5DWb 5C9CyCAFKC36eK3IoWVZMcx5rLqo7T+78Yb0Bfs3BUl9W0V2h5Nd6SVaTXdS3xhx aHQzlFEwlnWEZCtKhC/qN6d1jPxWvW8bbc3rNBImku3RPE8Gz+JnZDnKgJgz1PBl LTNdipdnsGWgvpRTbXvWPoTS9NinWiWrHejfc3ATl8ecZ0y5GwHeijRQI0SWcDcQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkedtgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucfkphepledtrd ekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 4C19A3280064; Wed, 19 Feb 2020 07:06:46 -0500 (EST) Date: Wed, 19 Feb 2020 13:06:44 +0100 From: Maxime Ripard To: Andrey Lebedev Cc: wens@csie.org, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Andrey Lebedev Subject: Re: [PATCH v2 2/2] ARM: sun7i: dts: Add LVDS panel support on A20 Message-ID: <20200219120644.b74jmusyf4ny7euh@gilmour.lan> References: <20200210195633.GA21832@kedthinkpad> <20200212222355.17141-2-andrey.lebedev@gmail.com> <20200213094304.hf3glhgmquypxpyf@gilmour.lan> <20200213200823.GA28336@kedthinkpad> <20200214075218.huxdhmd4qfoakat2@gilmour.lan> <20200214084358.GA25266@kedthinkpad> <20200214085351.2whnfyulrmyex2va@gilmour.lan> <20200214213231.GA6583@kedthinkpad> <20200217175135.ldtqji4mrwz2wbn5@gilmour.lan> <20200218175033.GA25850@kedthinkpad> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pppyecrcyak66akq" Content-Disposition: inline In-Reply-To: <20200218175033.GA25850@kedthinkpad> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --pppyecrcyak66akq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 18, 2020 at 07:50:33PM +0200, Andrey Lebedev wrote: > On Mon, Feb 17, 2020 at 06:51:35PM +0100, Maxime Ripard wrote: > > > diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h > > > index cfbf4e6c1679..bc87d28ee341 100644 > > > --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h > > > +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h > > > @@ -235,6 +235,8 @@ struct sun4i_tcon_quirks { > > > bool needs_de_be_mux; /* sun6i needs mux to select backend */ > > > bool needs_edp_reset; /* a80 edp reset needed for tcon0 access */ > > > bool supports_lvds; /* Does the TCON support an LVDS output? */ > > > + /* "compatible" string of TCON that exclusively supports LVDS */ > > > + const char *lvds_compatible_tcon; > > > > However this is far more complicated than needed, you can simply add a > > new quirks structure associated to the tcon0 compatible in > > sun4i_tcon_of_table, and that will do > > Aha! Does this look good to you? > > From 4ad2978e404c63d4cca1b7890bc5bdd4d1e8965d Mon Sep 17 00:00:00 2001 > From: Andrey Lebedev > Date: Tue, 18 Feb 2020 19:47:33 +0200 > Subject: [PATCH] Mark tcon0 to be the only tcon capable of LVDS on sun7i-a20 > > This allows to avoid warnings about reset line not provided for tcon1. > > Signed-off-by: Andrey Lebedev > --- > arch/arm/boot/dts/sun7i-a20.dtsi | 6 ++++-- > drivers/gpu/drm/sun4i/sun4i_tcon.c | 14 ++++++++++++-- > 2 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi > index dc4f3f249aee..d50263c1ca9a 100644 > --- a/arch/arm/boot/dts/sun7i-a20.dtsi > +++ b/arch/arm/boot/dts/sun7i-a20.dtsi > @@ -405,7 +405,8 @@ > }; > > tcon0: lcd-controller@1c0c000 { > - compatible = "allwinner,sun7i-a20-tcon"; > + compatible = "allwinner,sun7i-a20-tcon0", > + "allwinner,sun7i-a20-tcon"; > reg = <0x01c0c000 0x1000>; > interrupts = ; > resets = <&ccu RST_TCON0>, <&ccu RST_LVDS>; > @@ -460,7 +461,8 @@ > }; > > tcon1: lcd-controller@1c0d000 { > - compatible = "allwinner,sun7i-a20-tcon"; > + compatible = "allwinner,sun7i-a20-tcon1", > + "allwinner,sun7i-a20-tcon"; > reg = <0x01c0d000 0x1000>; > interrupts = ; > resets = <&ccu RST_TCON1>; This needs to be in a separate patch > diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c > index 800a9bd86112..d9605d331010 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c > +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c > @@ -1479,7 +1479,7 @@ static const struct sun4i_tcon_quirks sun6i_a31s_quirks = { > .dclk_min_div = 1, > }; > > -static const struct sun4i_tcon_quirks sun7i_a20_quirks = { > +static const struct sun4i_tcon_quirks sun7i_a20_tcon0_quirks = { > .supports_lvds = true, > .has_channel_0 = true, > .has_channel_1 = true, > @@ -1489,6 +1489,15 @@ static const struct sun4i_tcon_quirks sun7i_a20_quirks = { > .setup_lvds_phy = sun4i_tcon_setup_lvds_phy, > }; > > +static const struct sun4i_tcon_quirks sun7i_a20_tcon1_quirks = { > + .supports_lvds = false, > + .has_channel_0 = true, > + .has_channel_1 = true, > + .dclk_min_div = 4, > + /* Same display pipeline structure as A10 */ > + .set_mux = sun4i_a10_tcon_set_mux, > +}; > + > static const struct sun4i_tcon_quirks sun8i_a33_quirks = { > .has_channel_0 = true, > .has_lvds_alt = true, > @@ -1534,7 +1543,8 @@ const struct of_device_id sun4i_tcon_of_table[] = { > { .compatible = "allwinner,sun5i-a13-tcon", .data = &sun5i_a13_quirks }, > { .compatible = "allwinner,sun6i-a31-tcon", .data = &sun6i_a31_quirks }, > { .compatible = "allwinner,sun6i-a31s-tcon", .data = &sun6i_a31s_quirks }, > - { .compatible = "allwinner,sun7i-a20-tcon", .data = &sun7i_a20_quirks }, > + { .compatible = "allwinner,sun7i-a20-tcon0", .data = &sun7i_a20_tcon0_quirks }, > + { .compatible = "allwinner,sun7i-a20-tcon1", .data = &sun7i_a20_tcon1_quirks }, > { .compatible = "allwinner,sun8i-a23-tcon", .data = &sun8i_a33_quirks }, > { .compatible = "allwinner,sun8i-a33-tcon", .data = &sun8i_a33_quirks }, > { .compatible = "allwinner,sun8i-a83t-tcon-lcd", .data = &sun8i_a83t_lcd_quirks }, And we need to support older DT as well, so you shouldn't remove the older TCON compatible and its structure. Make sure to document the new compatibles too. Maxime --pppyecrcyak66akq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXk0k1AAKCRDj7w1vZxhR xYhCAQCJoj0KSbx3DIdZ+6CIaEX2rZa7wJltBAhkCohwZJ8QqAEAotjnImKfiz/v GGord1FEAN/NstQoI/n/crBrpv43Iww= =Wm5B -----END PGP SIGNATURE----- --pppyecrcyak66akq--