Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3321077imm; Mon, 8 Oct 2018 01:51:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV623k/R13YqlBVI1YP83kvEGLHh2X4K0e+trCzQF3gOJtm2Od+zA+jbszbnCmaO4vXdvhYq9 X-Received: by 2002:a17:902:8eca:: with SMTP id x10-v6mr22996577plo.336.1538988712720; Mon, 08 Oct 2018 01:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538988712; cv=none; d=google.com; s=arc-20160816; b=lngcObq4M6/3yMCt7OYOC9qx7S5RsBLuopu7HeAqzKXLS/s4B75pre4a5Mm83vc0/w SpnVj7Ca60TvB2aerj6RXoeq/psWE+S+YxJRl/K9woC3JiV9ArsLcTWANK776bbzP66b K/D3eMirsDEOO2jS8zkpjDYt/fms21Yk8z4woEwwONZeOcEpYEmxE1d+GS40W8rd0gQK yV437zWfDjmqjG5qls6IMGqwl9WmmD5O7Ual3MhHhX/DGRy3eDyF5Nlvru0S47sxpiEW gldZ3m2mKiFIROifow7Mx6bdSpKCURvnm/twu14MPWeBgGd8nR6xmUvsAbSOuK3KYOaZ FW2g== 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; bh=vJRAImh/yAs9rOzW6t3ENeHZnedQ10q9TdOtLjs9xuQ=; b=OEiEe2Sry9hmghfcb9kK92QwG+8AWxcS/HSL84pKnFsddNbDNebaMq2XI8/UVheo7P 5eXhKntjcuM+T9pPn0A7J3M1OL7h4a9Cy91iGwiM55C2FEzJucS8+qmA+x6dcbJLO5qO bH8DLQiHjJVeslCljmrva7x1p4aR2uNQEisd8geOEn5RP8jX/8ONLOoZmCj30chX4fPV 9KFRCs4mbT29CvECoDul+dSoQICDzRq77/rvZ/WRmhl3jaGXbD+7JWK71GPaGb306uyO RwFrDJblKzwLJk/lHXUtMTzZNrcm//YIkamVPHPdcIgUcyNNu73IrgA5SrmoaRwdHDVm O+mg== 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 r15-v6si18237498pfj.68.2018.10.08.01.51.37; Mon, 08 Oct 2018 01:51:52 -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 S1727371AbeJHQCC (ORCPT + 99 others); Mon, 8 Oct 2018 12:02:02 -0400 Received: from mail.bootlin.com ([62.4.15.54]:36628 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726013AbeJHQCC (ORCPT ); Mon, 8 Oct 2018 12:02:02 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id A6BC4207CC; Mon, 8 Oct 2018 10:51:21 +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 (AAubervilliers-681-1-28-153.w90-88.abo.wanadoo.fr [90.88.148.153]) by mail.bootlin.com (Postfix) with ESMTPSA id 746A5206A1; Mon, 8 Oct 2018 10:51:11 +0200 (CEST) Date: Mon, 8 Oct 2018 10:51:12 +0200 From: Maxime Ripard To: Jernej Skrabec Cc: wens@csie.org, robh+dt@kernel.org, sboyd@kernel.org, airlied@linux.ie, architt@codeaurora.org, a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, Icenowy Zheng Subject: Re: [PATCH v2 25/29] drm: sun4i: add quirks for TCON TOP Message-ID: <20181008085112.mejpwvl3dpu7sopy@flea> References: <20181007093905.11253-1-jernej.skrabec@siol.net> <20181007093905.11253-26-jernej.skrabec@siol.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="c3donk7cvlzjru3b" Content-Disposition: inline In-Reply-To: <20181007093905.11253-26-jernej.skrabec@siol.net> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --c3donk7cvlzjru3b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 07, 2018 at 11:39:01AM +0200, Jernej Skrabec wrote: > From: Icenowy Zheng >=20 > Some SoCs, such as H6, doesn't have a full-featured TCON TOP. >=20 > Add quirks support for TCON TOP. >=20 > Currently the presence of TCON_TV1 and DSI is controlled via the quirks > structure. >=20 > Signed-off-by: Icenowy Zheng > --- > drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 43 ++++++++++++++++++++------ > 1 file changed, 34 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun= 4i/sun8i_tcon_top.c > index 37158548b447..ed13233cad88 100644 > --- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c > +++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c > @@ -9,11 +9,17 @@ > #include > #include > #include > +#include > #include > #include > =20 > #include "sun8i_tcon_top.h" > =20 > +struct sun8i_tcon_top_quirks { > + bool has_tcon_tv1; > + bool has_dsi; > +}; > + > static bool sun8i_tcon_top_node_is_tcon_top(struct device_node *node) > { > return !!of_match_node(sun8i_tcon_top_of_table, node); > @@ -121,10 +127,13 @@ static int sun8i_tcon_top_bind(struct device *dev, = struct device *master, > struct platform_device *pdev =3D to_platform_device(dev); > struct clk_hw_onecell_data *clk_data; > struct sun8i_tcon_top *tcon_top; > + const struct sun8i_tcon_top_quirks *quirks; > struct resource *res; > void __iomem *regs; > int ret, i; > =20 > + quirks =3D of_device_get_match_data(&pdev->dev); > + > tcon_top =3D devm_kzalloc(dev, sizeof(*tcon_top), GFP_KERNEL); > if (!tcon_top) > return -ENOMEM; > @@ -187,15 +196,23 @@ static int sun8i_tcon_top_bind(struct device *dev, = struct device *master, > &tcon_top->reg_lock, > TCON_TOP_TCON_TV0_GATE, 0); > =20 > - clk_data->hws[CLK_TCON_TOP_TV1] =3D > - sun8i_tcon_top_register_gate(dev, "tcon-tv1", regs, > - &tcon_top->reg_lock, > - TCON_TOP_TCON_TV1_GATE, 1); > + if (quirks->has_tcon_tv1) { > + clk_data->hws[CLK_TCON_TOP_TV1] =3D > + sun8i_tcon_top_register_gate(dev, "tcon-tv1", regs, > + &tcon_top->reg_lock, > + TCON_TOP_TCON_TV1_GATE, 1); > + } else { > + clk_data->hws[CLK_TCON_TOP_TV1] =3D NULL; > + } > =20 > - clk_data->hws[CLK_TCON_TOP_DSI] =3D > - sun8i_tcon_top_register_gate(dev, "dsi", regs, > - &tcon_top->reg_lock, > - TCON_TOP_TCON_DSI_GATE, 2); > + if (quirks->has_dsi) { > + clk_data->hws[CLK_TCON_TOP_DSI] =3D > + sun8i_tcon_top_register_gate(dev, "dsi", regs, > + &tcon_top->reg_lock, > + TCON_TOP_TCON_DSI_GATE, 2); > + } else { > + clk_data->hws[CLK_TCON_TOP_DSI] =3D NULL; clk_data has been kzalloc'd so its content is already NULL. And you shouldn't have brackets for single line blocks. with that fixed, Acked-by: Maxime Ripard Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --c3donk7cvlzjru3b Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlu7Gn8ACgkQ0rTAlCFN r3RZfxAAlDsjMRdnM/QxxcMgdZs8xc9ZaFsW+F4rF7OTurcMmCkEkDjYJElqygEw QGShhO1a0FPOoaeYdX+799pk8iSi6JHlwgvFlQyG0+DGqOWoXVytfKqFyXOs/kbn /0vgjE12661PD3w+5JMU+ncuPIgpIkjBAY9nV7dzFC31/yfizoT4MipYBwrfpldb QfXT+5fLw+txMt53thGv6ovK0c9gu6Vw6Fybr1E5EV1oFj3z0RFshfMr36yGPA8l 3SIJfe2Sqf8sgOFfjzsSi2YXf+TdA4K+UvUxNNAsI5Grd0ln8MBNNYhXY+ayYpjX X8LFqIuxQ87O6nQvfieRecqBXmuIcN7jlnv9ayO0gjog5guP534B4YVlBlKtZQe0 qCuSs9ORXBgcouCQpyWo8wlbQKn2lmrGxTTUiQWKlr5uCDUvipB2kAzmTYNP89Ys xx8BCLa2Og5wU9Z8ky9C66u+rgbIeiAxSh39ZgjZY1U3Ms2Gf8VdEyT3s0TRiurS qLkfHXQLpRM/zun2/mHIfogthDAQHK0KjuaG3TaIuaLOvQZjwNzTcsStvOyLbpEA TfrPgk9DXTA+T2oPO6ip1Dlx2rQI8xrZEr5sIUc5jwGCPf/TTpaBwCoMrjQfeuYZ GGuZbYUQW02lDW8HxiAkhLVZIKqJW+BQiGgQjTPZLzCfVNoek28= =n5G0 -----END PGP SIGNATURE----- --c3donk7cvlzjru3b--