linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mturquette@baylibre.com (Michael Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/8] clk: Add a Raspberry Pi-specific clock driver.
Date: Wed, 12 Aug 2015 12:00:14 -0700	[thread overview]
Message-ID: <20150812190014.31346.89987@quantum> (raw)
In-Reply-To: <87wpx04c4q.fsf@eliezer.anholt.net>

Quoting Eric Anholt (2015-08-12 11:04:05)
> Michael Turquette <mturquette@linaro.org> writes:
> 
> > Hi Eric,
> >
> > Quoting Eric Anholt (2015-07-20 12:33:01)
> >> +void __init rpi_firmware_init_clock_provider(struct device_node *node)
> >> +{
> >> +       /* We delay construction of our struct clks until get time,
> >> +        * because we need to be able to return -EPROBE_DEFER if the
> >> +        * firmware driver isn't up yet.  clk core doesn't support
> >> +        * re-probing on -EPROBE_DEFER, but callers of clk_get can.
> >> +        */
> >> +       of_clk_add_provider(node, rpi_firmware_delayed_get_clk, node);
> >> +}
> >> +
> >> +CLK_OF_DECLARE(rpi_firmware_clocks, "raspberrypi,bcm2835-firmware-clocks",
> >> +              rpi_firmware_init_clock_provider);
> >
> > Do you require CLK_OF_DECLARE here? Could this be a platform driver
> > instead?
> 
> I'm not actually sure.  The common pattern seemed to be using
> CLK_OF_DECLARE (130 files using it versus declaring a struct
> platform_driver), and it seems to avoid a whole lot of boilerplate.
> What would the advantage be?

Correctly using the Linux driver model, having a nice struct device and
things like supsend and resume handlers, etc.

There is a lot of CLK_OF_DECLARE going on in drivers/clk, but I am
hoping we can fix that. The main reason for CLK_OF_DECLARE is when you
need to register clocks very early (e.g. timers). This is often not the
case.

Regards,
Mike

  reply	other threads:[~2015-08-12 19:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 19:32 [PATCH v4 0/8] Raspberry Pi clock support Eric Anholt
2015-07-20 19:33 ` [PATCH v4 1/8] clk: bcm2835: Add binding docs for the Raspberry Pi clock provider Eric Anholt
2015-08-11 21:18   ` Michael Turquette
2015-08-12 17:56     ` Eric Anholt
2015-07-20 19:33 ` [PATCH v4 2/8] clk: Add a Raspberry Pi-specific clock driver Eric Anholt
2015-08-11 21:17   ` Michael Turquette
2015-08-12 18:04     ` Eric Anholt
2015-08-12 19:00       ` Michael Turquette [this message]
2015-07-20 19:33 ` [PATCH v4 3/8] ARM: bcm2835: Add DT for the firmware clocks driver Eric Anholt
2015-07-24 15:23   ` Lee Jones
2015-07-20 19:33 ` [PATCH v4 4/8] ARM: bcm2835: Drop never-used clock-frequency property of uart0 Eric Anholt
2015-07-24 15:22   ` Lee Jones
2015-07-20 19:33 ` [PATCH v4 5/8] clk: bcm2835: Drop the fixed sys_pclk Eric Anholt
2015-08-11 21:19   ` Michael Turquette
2015-07-20 19:33 ` [PATCH v4 6/8] ARM: bcm2835: Use the RPi firmware clocks for uart Eric Anholt
2015-07-24 15:22   ` Lee Jones
2015-07-20 19:33 ` [PATCH v4 7/8] ARM: bcm2835: Tie SPI clock to the core clock rate Eric Anholt
2015-07-24 15:23   ` Lee Jones
2015-07-20 19:33 ` [PATCH v4 8/8] ARM: bcm2835: Use the firmware on rpi to get the EMMC clock Eric Anholt
2015-07-24 15:22   ` Lee Jones

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=20150812190014.31346.89987@quantum \
    --to=mturquette@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).