Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2334441ybg; Fri, 5 Jun 2020 11:13:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsZLNH4IhtSqiF8/+Jwh+GNVRrmTC+D1ZZCyU4QBUogUfPB760surNQ3cNOLELSXuUqXaF X-Received: by 2002:a05:6402:1714:: with SMTP id y20mr10587859edu.81.1591380800046; Fri, 05 Jun 2020 11:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591380800; cv=none; d=google.com; s=arc-20160816; b=nwgXK5bXNkyLpkzVz2tSDgYbAGLuZYYoFjuOq5/OZjpAEogja97RMLq/xDzoVnW/Xo RFi/NK4fTDlrRrYzGSKQe9RVhM72WjDNA1tPesAv+tVQHE/+W7KztbID8AL52IDI6ZtL Dq6eihMu7c1BmZCgpN0emr/T3oWwMsXLSYyaZDNO8M3l+X0kwa9cTjegVn9p+GNs5eNo aANXjGi74v8ffWKIRD31ytIVpQqx7wnvmhsKzjvNkkAIMoUf4FAEWxpeOOOmjpiVv4q9 41XpWa7mqUOCp4mgbgFfkd7+qFG7scgzjOO9aeq5b3Zbu/TujGcia101q7K18X7ILM17 Z9qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=TZwQO5H3/eatchd2sqFCF/uWE09/j3FyiNqqZ6fVls0=; b=xaZQR6jbbe2wT/FtNcyPO3gF7MBHVAfftpbk5tsvkCjpL5kZRFKUOY852Z8YALQRq7 Wl+NBpg+CtSsvlK9CwewlGaaVu6nIWA9EtItBj7O8f7Uu6W6818iSXTX4gHxPqSZkxZf trS+/GjtduNsC3RSUepUA6dYdBvquWw0xCyTerfqu3rrNb4Rbt6De2f/eQdDtH1q9zhD fyWJAnukv5f603MHE3GhvvGlO/0Lvma0TPfV1cKDF2nHqrAM00p+T7jUiz3QRC1Kz7bM t1wBEEz3jrJL08K3R1qTy6RzwrSYe6fuKa+K80QdyTIUjUJkZBAiWVDIPEl3tqnvY0yM JeRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si3979654ejm.613.2020.06.05.11.12.57; Fri, 05 Jun 2020 11:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728124AbgFESLJ (ORCPT + 99 others); Fri, 5 Jun 2020 14:11:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:47988 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbgFESLG (ORCPT ); Fri, 5 Jun 2020 14:11:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D2843AF48; Fri, 5 Jun 2020 18:11:07 +0000 (UTC) Message-ID: <977dd9ba222d8c513b09743da5cb53fd14bfd9a0.camel@suse.de> Subject: Re: [PATCH v3 004/105] clk: bcm: Add BCM2711 DVP driver From: Nicolas Saenz Julienne To: Maxime Ripard Cc: devicetree@vger.kernel.org, Tim Gover , Dave Stevenson , Stephen Boyd , Michael Turquette , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-clk@vger.kernel.org, Eric Anholt , Rob Herring , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , linux-arm-kernel@lists.infradead.org Date: Fri, 05 Jun 2020 20:11:01 +0200 In-Reply-To: <20200605174329.hf5d6oulmcewzw63@gilmour.lan> References: <6615a61b8af240e3d10f8890e4b2462ccdaac9b9.1590594512.git-series.maxime@cerno.tech> <20200605174329.hf5d6oulmcewzw63@gilmour.lan> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-+FKCCfaEGN1+KOjI+Hug" User-Agent: Evolution 3.36.2 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-+FKCCfaEGN1+KOjI+Hug Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2020-06-05 at 19:43 +0200, Maxime Ripard wrote: > Hi Nicolas, >=20 > On Thu, Jun 04, 2020 at 07:26:07PM +0200, Nicolas Saenz Julienne wrote: > > On Wed, 2020-05-27 at 17:47 +0200, Maxime Ripard wrote: > > > The HDMI block has a block that controls clocks and reset signals to = the > > > HDMI0 and HDMI1 controllers. > >=20 > > Why not having two separate drivers? >=20 > They share the same address space, so it wouldn't really make sense to > split it into two drivers and an MFD, especially when the clock/reset > association is fairly common. Fair enough. >=20 > > > Let's expose that through a clock driver implementing a clock and res= et > > > provider. > > >=20 > > > Cc: Michael Turquette > > > Cc: Stephen Boyd > > > Cc: Rob Herring > > > Cc: linux-clk@vger.kernel.org > > > Cc: devicetree@vger.kernel.org > > > Reviewed-by: Stephen Boyd > > > Signed-off-by: Maxime Ripard > > > --- > > > drivers/clk/bcm/Kconfig | 11 +++- > > > drivers/clk/bcm/Makefile | 1 +- > > > drivers/clk/bcm/clk-bcm2711-dvp.c | 127 ++++++++++++++++++++++++++++= +++- > > > 3 files changed, 139 insertions(+) > > > create mode 100644 drivers/clk/bcm/clk-bcm2711-dvp.c > > >=20 > > > diff --git a/drivers/clk/bcm/Kconfig b/drivers/clk/bcm/Kconfig > > > index 8c83977a7dc4..784f12c72365 100644 > > > --- a/drivers/clk/bcm/Kconfig > > > +++ b/drivers/clk/bcm/Kconfig > > > @@ -1,4 +1,15 @@ > > > # SPDX-License-Identifier: GPL-2.0-only > > > + > > > +config CLK_BCM2711_DVP > > > + tristate "Broadcom BCM2711 DVP support" > > > + depends on ARCH_BCM2835 ||COMPILE_TEST > > > + depends on COMMON_CLK > > > + default ARCH_BCM2835 > > > + select RESET_SIMPLE > > > + help > > > + Enable common clock framework support for the Broadcom BCM2711 > > > + DVP Controller. > > > + > > > config CLK_BCM2835 > > > bool "Broadcom BCM2835 clock support" > > > depends on ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST > > > diff --git a/drivers/clk/bcm/Makefile b/drivers/clk/bcm/Makefile > > > index 0070ddf6cdd2..2c1349062147 100644 > > > --- a/drivers/clk/bcm/Makefile > > > +++ b/drivers/clk/bcm/Makefile > > > @@ -6,6 +6,7 @@ obj-$(CONFIG_CLK_BCM_KONA) +=3D clk-kona-setup.o > > > obj-$(CONFIG_CLK_BCM_KONA) +=3D clk-bcm281xx.o > > > obj-$(CONFIG_CLK_BCM_KONA) +=3D clk-bcm21664.o > > > obj-$(CONFIG_COMMON_CLK_IPROC) +=3D clk-iproc-armpll.o clk-iproc-pll= .o > > > clk-iproc-asiu.o > > > +obj-$(CONFIG_CLK_BCM2835) +=3D clk-bcm2711-dvp.o > > > obj-$(CONFIG_CLK_BCM2835) +=3D clk-bcm2835.o > > > obj-$(CONFIG_CLK_BCM2835) +=3D clk-bcm2835-aux.o > > > obj-$(CONFIG_CLK_RASPBERRYPI) +=3D clk-raspberrypi.o > > > diff --git a/drivers/clk/bcm/clk-bcm2711-dvp.c b/drivers/clk/bcm/clk- > > > bcm2711- > > > dvp.c > > > new file mode 100644 > > > index 000000000000..c1c4b5857d32 > > > --- /dev/null > > > +++ b/drivers/clk/bcm/clk-bcm2711-dvp.c > > > @@ -0,0 +1,127 @@ > > > +// SPDX-License-Identifier: GPL-2.0-or-later > > > +// Copyright 2020 Cerno > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +#define DVP_HT_RPI_SW_INIT 0x04 > > > +#define DVP_HT_RPI_MISC_CONFIG 0x08 > > > + > > > +#define NR_CLOCKS 2 > > > +#define NR_RESETS 6 > > > + > > > +struct clk_dvp { > > > + struct clk_hw_onecell_data *data; > > > + struct reset_simple_data reset; > > > +}; > > > + > > > +static const struct clk_parent_data clk_dvp_parent =3D { > > > + .index =3D 0, > > > +}; > > > + > > > +static int clk_dvp_probe(struct platform_device *pdev) > > > +{ > > > + struct clk_hw_onecell_data *data; > > > + struct resource *res; > > > + struct clk_dvp *dvp; > > > + void __iomem *base; > > > + int ret; > > > + > > > + dvp =3D devm_kzalloc(&pdev->dev, sizeof(*dvp), GFP_KERNEL); > > > + if (!dvp) > > > + return -ENOMEM; > > > + platform_set_drvdata(pdev, dvp); > > > + > > > + dvp->data =3D devm_kzalloc(&pdev->dev, > > > + struct_size(dvp->data, hws, NR_CLOCKS), > > > + GFP_KERNEL); > > > + if (!dvp->data) > > > + return -ENOMEM; > > > + data =3D dvp->data; > > > + > > > + res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); > > > + base =3D devm_ioremap_resource(&pdev->dev, res); > >=20 > > I think the cool function to use these days is > > devm_platform_get_and_ioremap_resource(). >=20 > i'll change it, thanks! Reviewed-by: Nicolas Saenz Julienne Regards, Nicolas --=-+FKCCfaEGN1+KOjI+Hug Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl7airUACgkQlfZmHno8 x/6RAwgAoMvooAyRe7S9Zeth+KfsqdhHw7fSaIfcyW+1B1hAhY9U35yLYXdM9MqY aYWnkeHuMN+ic3frCKcxnR4ySNuiDgvYl9jFOhaEZZePo7dnVoLVrOTaMBs421SQ 0+roDhCtWXx2tUMKkNLK7w7YRMyDrHP0xFO0+3gFV0k4dD4bBQYwTpT7Yz9k6Big wDDlyAeh+Tj5UlMZ7ADJx4Du6nPMDk0P/urKo0AyrnegExOBwlDLKDInRHZg5+G8 VzgHMoQylpyo3hTBHpSYv2ZXtk3MwvJHi22o42gDzKSfsy6xCrI+/FxdJ+JFmd5i Eb0zIV6tEQZNERBn5IILIGn3CWeKzA== =i89s -----END PGP SIGNATURE----- --=-+FKCCfaEGN1+KOjI+Hug--