From: Mark Brown <broonie@kernel.org>
To: Soren Brinkmann <soren.brinkmann@xilinx.com>
Cc: Mike Turquette <mturquette@linaro.org>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH RFC] clk: Introduce userspace clock driver
Date: Fri, 10 May 2013 22:24:22 +0100 [thread overview]
Message-ID: <20130510212422.GY3200@sirena.org.uk> (raw)
In-Reply-To: <1368207091-32538-2-git-send-email-soren.brinkmann@xilinx.com>
[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]
On Fri, May 10, 2013 at 10:31:31AM -0700, Soren Brinkmann wrote:
> +Example:
> + usclk: usclk {
> + compatible = "clk-userspace";
> + clocks = <&foo 15>, <&bar>;
> + clock-count = <2>;
> + };
This is clearly *very* Linux specific so needs to be a linux vendor
thing (everything should have a namespaced name anyway). It's not at
all obvious to me that this should be in device tree, though, since it's
not hardware description but a detail of how the OS is currently
implemented.
For your use case should these things be exposed by the FPGA device
asking for that rather than by having the clocks available separately?
Or is this part of the DT blob that's loaded incrementally along with
the FPGA (which does make things more interesting of course...).
> + * Expose clock controls through sysfs to userspace.
> + * By writing 0/1 to 'enable' the clock can be disabled/enabled. Reading
> + * that file returns the current state - 0 = disabled, 1 = enabled.
> + * Reading 'set_rate' returns the current clock frequency in Hz. Writing
> + * the file requests setting a new frequency in Hz.
This needs to be covered in Documentation/ABI since it's adding new
sysfs stuff.
> + if (enable)
> + ret = clk_prepare_enable(pdata->clk);
> + else
> + clk_disable_unprepare(pdata->clk);
> + if (ret)
> + return -EBUSY;
Why not pass back the actual error?
> + pdata = kzalloc(clock_count * sizeof(*pdata), GFP_KERNEL);
> + if (!pdata)
> + return -ENOMEM;
devm?
> +late_initcall(usclk_setup);
Why not just a regular driver?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-05-11 14:17 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 17:31 [PATCH RFC] User space " Soren Brinkmann
2013-05-10 17:31 ` [PATCH RFC] clk: Introduce userspace " Soren Brinkmann
2013-05-10 17:44 ` Emilio López
2013-05-10 18:15 ` Sören Brinkmann
2013-05-10 18:49 ` Emilio López
2013-05-10 22:18 ` Mike Turquette
2013-05-10 23:01 ` Saravana Kannan
2013-05-10 23:06 ` Sören Brinkmann
2013-05-10 23:25 ` Saravana Kannan
2013-05-10 23:36 ` Sören Brinkmann
2013-05-11 14:21 ` Mark Brown
2013-05-16 4:23 ` Saravana Kannan
2013-05-16 18:21 ` Mark Brown
2013-05-10 23:08 ` Sören Brinkmann
2013-05-13 8:31 ` Peter De Schrijver
[not found] ` <CAHp75Vcr10d=XesGQvrC_v+ijdp3nK+m=w5E7d6GCo1Z9ogWnw@mail.gmail.com>
2013-05-10 18:03 ` Sören Brinkmann
2013-05-10 21:24 ` Mark Brown [this message]
2013-05-11 16:54 ` Sören Brinkmann
2013-05-12 14:33 ` Mark Brown
2013-05-12 19:05 ` Sören Brinkmann
2013-05-13 5:21 ` Mark Brown
2013-05-13 16:09 ` Sören Brinkmann
2013-05-13 16:21 ` Sebastian Hesselbarth
2013-05-13 17:24 ` Sören Brinkmann
2013-05-13 17:37 ` Sebastian Hesselbarth
2013-05-13 17:58 ` Sören Brinkmann
2013-05-13 18:18 ` Sebastian Hesselbarth
2013-05-14 16:46 ` Mike Turquette
2013-05-14 18:09 ` Philip Balister
2013-05-15 4:46 ` Mark Brown
2013-05-16 4:28 ` Saravana Kannan
2013-05-16 14:44 ` Philip Balister
2013-05-16 17:26 ` Mark Brown
2013-05-16 18:55 ` Sören Brinkmann
2013-05-17 11:02 ` Mark Brown
2013-05-13 18:16 ` Mark Brown
2013-05-13 18:20 ` Sebastian Hesselbarth
2013-05-13 18:44 ` Mark Brown
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=20130510212422.GY3200@sirena.org.uk \
--to=broonie@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=soren.brinkmann@xilinx.com \
/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
Powered by JetHome