Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1262419

Re: [linux-sunxi] [PATCH v4 2/6] clk: sunxi: Add H3 clocks support

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Maxime Ripard <maxime.ripard@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [linux-sunxi] [PATCH v4 2/6] clk: sunxi: Add H3 clocks support
Date Wed, 04 Nov 2015 17:30:01 +0100
Message-ID <qr96F-2O2-7@gated-at.bofh.it> (permalink)
References <qofLk-7AM-3@gated-at.bofh.it> <qofLl-7AM-29@gated-at.bofh.it> <qolH4-34l-11@gated-at.bofh.it>
X-Original-To Julian Calaby <julian.calaby@gmail.com>
MIME-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s8wpp40TDz0KNMmP"
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 82
Organization linux.* mail to news gateway
X-Original-Cc Jens Kuske <jenskuske@gmail.com>, Chen-Yu Tsai <wens@csie.org>, Michael Turquette <mturquette@baylibre.com>, Linus Walleij <linus.walleij@linaro.org>, Rob Herring <robh+dt@kernel.org>, Philipp Zabel <p.zabel@pengutronix.de>, Emilio López <emilio@elopez.com.ar>, Vishnu Patekar <vishnupatekar0510@gmail.com>, Hans de Goede <hdegoede@redhat.com>, devicetree <devicetree@vger.kernel.org>, "Mailing List, Arm" <linux-arm-kernel@lists.infradead.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, linux-sunxi <linux-sunxi@googlegroups.com>
X-Original-Date Wed, 4 Nov 2015 08:23:04 -0800
X-Original-Message-ID <20151104162304.GZ6114@lukather>
X-Original-References <1445964626-6484-1-git-send-email-jenskuske@gmail.com> <1445964626-6484-3-git-send-email-jenskuske@gmail.com> <CAGRGNgW9nVJvAcaduF0y1ptbpLA-3MkR4LCYvh-n1=mtxTyqfg@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1262419

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi Julian,

On Wed, Oct 28, 2015 at 10:12:09AM +1100, Julian Calaby wrote:
> > +       of_property_for_each_u32(node, "clock-indices", prop, p, index) {
> > +               of_property_read_string_index(node, "clock-output-names",
> > +                                             i, &clk_name);
> > +
> > +               if (index == 17 || (index >= 29 && index <= 31))
> > +                       clk_parent = AHB2;
> > +               else if (index <= 63 || index >= 128)
> > +                       clk_parent = AHB1;
> > +               else if (index >= 64 && index <= 95)
> > +                       clk_parent = APB1;
> > +               else if (index >= 96 && index <= 127)
> > +                       clk_parent = APB2;
> 
> A way to make this reusable in the future might be to encode it in a
> structure like:
> 
> static const struct bus_clock_paths sun8i_h3_bus_clock_paths __initdata = {
>         {.parent = 2, .min = 17, .max = 17}, /* index 17 is from AHB2 */
>         {.parent = 2, .min = 29, .max = 31}, /* AHB2 bank */
>         {.parent = 1, .min = 63, .max = 128}, /* AHB1 bank */
> ...
>         {}
> };
> 
> Then the code here can be reused for other clocks like this in the
> future without too much bloat. (And this would potentially could be
> generic enough for other platforms.)

We don't really need that at the moment. There's not point in writing
more complicated code to support a use case we don't have yet.

(However, something along these lines will definitely be needed if we
ever have another SoC having the same bus gates madness)

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [linux-sunxi] [PATCH v4 2/6] clk: sunxi: Add H3 clocks support Maxime Ripard <maxime.ripard@free-electrons.com> - 2015-11-04 17:30 +0100
  Re: [linux-sunxi] [PATCH v4 2/6] clk: sunxi: Add H3 clocks support Julian Calaby <julian.calaby@gmail.com> - 2015-11-04 23:20 +0100

csiph-web