public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Rob Herring <robh@kernel.org>
Cc: Icenowy Zheng <icenowy@aosc.io>, Chen-Yu Tsai <wens@csie.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jagan Teki <jagan@amarulasolutions.com>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-sunxi@googlegroups.com
Subject: Re: [PATCH 08/14] clk: sunxi-ng: v3s: add Allwinner V3 support
Date: Mon, 1 Apr 2019 10:15:24 +0200	[thread overview]
Message-ID: <20190401081524.bickdv7kr4kcnsgm@flea> (raw)
In-Reply-To: <20190328132721.GA32178@bogus>

[-- Attachment #1: Type: text/plain, Size: 2598 bytes --]

On Thu, Mar 28, 2019 at 08:27:21AM -0500, Rob Herring wrote:
> On Tue, Mar 12, 2019 at 11:22:50PM +0800, Icenowy Zheng wrote:
> > Allwinner V3 has the same main die with V3s, but with more pins wired.
> > There's a I2S bus on V3 that is not available on V3s.
> >
> > Add the V3-only peripheral's clocks and reset to the V3s CCU driver,
> > bound to a new V3 compatible string. The driver name is not changed
> > because it's part of the device tree binding (the header file name).
> >
> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > ---
> >  drivers/clk/sunxi-ng/ccu-sun8i-v3s.c      | 225 +++++++++++++++++++++-
> >  drivers/clk/sunxi-ng/ccu-sun8i-v3s.h      |   2 +-
> >  include/dt-bindings/clock/sun8i-v3s-ccu.h |   4 +
> >  include/dt-bindings/reset/sun8i-v3s-ccu.h |   3 +
> >  4 files changed, 231 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c b/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c
> > index cbba04f5f761..81450ea8faa2 100644
> > --- a/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c
> > +++ b/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c
> > @@ -242,6 +242,8 @@ static SUNXI_CCU_GATE(bus_codec_clk,	"bus-codec",	"apb1",
> >  		      0x068, BIT(0), 0);
> >  static SUNXI_CCU_GATE(bus_pio_clk,	"bus-pio",	"apb1",
> >  		      0x068, BIT(5), 0);
> > +static SUNXI_CCU_GATE(bus_i2s0_clk,	"bus-i2s0",	"apb1",
> > +		      0x068, BIT(12), 0);
> >
> >  static SUNXI_CCU_GATE(bus_i2c0_clk,	"bus-i2c0",	"apb2",
> >  		      0x06c, BIT(0), 0);
> > @@ -313,6 +315,11 @@ static SUNXI_CCU_MP_WITH_MUX_GATE(spi0_clk, "spi0", mod0_default_parents, 0x0a0,
> >  				  BIT(31),	/* gate */
> >  				  0);
> >
> > +static const char * const i2s_parents[] = { "pll-audio-8x", "pll-audio-4x",
> > +					    "pll-audio-2x", "pll-audio" };
> > +static SUNXI_CCU_MUX_WITH_GATE(i2s0_clk, "i2s0", i2s_parents,
> > +			       0x0b0, 16, 2, BIT(31), CLK_SET_RATE_PARENT);
> > +
> >  static SUNXI_CCU_GATE(usb_phy0_clk,	"usb-phy0",	"osc24M",
> >  		      0x0cc, BIT(8), 0);
> >  static SUNXI_CCU_GATE(usb_ohci0_clk,	"usb-ohci0",	"osc24M",
> > @@ -445,6 +452,80 @@ static struct ccu_common *sun8i_v3s_ccu_clks[] = {
> >  	&mipi_csi_clk.common,
> >  };
> >
> > +static struct ccu_common *sun8i_v3_ccu_clks[] = {
>
> Seems like a bunch of duplication for just 2 differences in clocks.
> Can't you keep the definitions the same and just skip registering the
> clocks not present?

I'd rather not, this can lead to access to registers that might not be
there when the CCF will read / write that clock

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2019-04-01  8:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 15:22 [PATCH 00/14] Support for Allwinner V3/S3L and Sochip S3 Icenowy Zheng
2019-03-12 15:22 ` [PATCH 01/14] dt-bindings: pinctrl: add missing compatible string for V3s Icenowy Zheng
2019-03-12 15:31   ` Maxime Ripard
2019-03-28 13:18   ` Rob Herring
2019-03-12 15:22 ` [PATCH 02/14] pinctrl: sunxi: rename V3s driver to V3 driver Icenowy Zheng
2019-03-12 15:22 ` [PATCH 03/14] dt-bindings: pinctrl: add compatible string for Allwinner V3 pinctrl Icenowy Zheng
2019-03-28 13:18   ` Rob Herring
2019-03-12 15:22 ` [PATCH 04/14] pinctrl: sunxi: v3: really introduce support for V3 Icenowy Zheng
2019-03-12 15:36   ` Maxime Ripard
2019-03-12 15:45     ` Icenowy Zheng
2019-03-18 11:05       ` [linux-sunxi] " Paul Kocialkowski
2019-03-18 11:57         ` Maxime Ripard
2019-03-18 11:00   ` [linux-sunxi] " Paul Kocialkowski
2019-03-12 15:22 ` [PATCH 05/14] clk: sunxi-ng: v3s: add the missing PLL_DDR1 Icenowy Zheng
2019-03-12 15:22 ` [PATCH 06/14] dt-bindings: clock: sunxi-ccu: remove bogus + before R40 compatible Icenowy Zheng
2019-03-28 13:19   ` Rob Herring
2019-03-12 15:22 ` [PATCH 07/14] dt-bindings: clk: sunxi-ccu: add compatible string for V3 CCU Icenowy Zheng
2019-03-28 13:19   ` Rob Herring
2019-03-12 15:22 ` [PATCH 08/14] clk: sunxi-ng: v3s: add Allwinner V3 support Icenowy Zheng
2019-03-28 13:27   ` Rob Herring
2019-04-01  8:15     ` Maxime Ripard [this message]
2019-03-12 15:22 ` [PATCH 09/14] dt-bindings: vendor-prefixes: add SoChip Icenowy Zheng
2019-03-28 13:28   ` Rob Herring
2019-03-12 15:22 ` [PATCH 10/14] dt-bindings: arm: sunxi: add compatible string for V3/S3/S3L SoCs Icenowy Zheng
2019-03-28 13:29   ` Rob Herring
2019-03-12 15:22 ` [PATCH 11/14] ARM: sunxi: dts: s3/s3l/v3: add DTSI files for S3/S3L/V3 SoCs Icenowy Zheng
2019-03-18 12:41   ` [linux-sunxi] " Paul Kocialkowski
2019-03-18 15:15     ` Icenowy Zheng
2019-03-18 15:19       ` Paul Kocialkowski
2019-03-12 15:22 ` [PATCH 12/14] ARM: dts: sun8i: V3/V3s/S3/S3L: add pinctrl for UART2 RX/TX Icenowy Zheng
2019-03-12 15:22 ` [PATCH 13/14] ARM: dts: sun8i: V3/V3s/S3/S3L: add Ethernet support Icenowy Zheng
2019-03-12 15:22 ` [PATCH 14/14] ARM: dts: sun8i: s3l: add support for Pine64 Single Cube Computer Icenowy Zheng
2019-04-03  9:34 ` [PATCH 00/14] Support for Allwinner V3/S3L and Sochip S3 Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190401081524.bickdv7kr4kcnsgm@flea \
    --to=maxime.ripard@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=icenowy@aosc.io \
    --cc=jagan@amarulasolutions.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=robh@kernel.org \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox