Re: [PATCH v2] clk: add userspace clock consumer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Mon, Feb 22, 2016 at 08:48:39PM +0900, Akinobu Mita wrote:
> This adds userspace consumer for common clock.
> 
> This driver is inspired from Userspace regulator consumer
> (REGULATOR_USERSPACE_CONSUMER) and it is useful for test purposes and
> some classes of devices that are controlled entirely from user space.

Whether the kernel handles a clock or userspace does should have nothing 
to do with DT. Plus DT does not expose many of the clocks, so any 
debug feature needs to expose all clocks and be independent of DT.

Beyond debug, I don't think we should be exposing clock control to 
userspace.

> 
> Example binding and usages:
> 
> clksqw_userspace_consumer {
> 	compatible = "linux,clock-userspace-consumer";
> 	clocks = <&clksqw>;
> };
> 
> 	# cd /sys/devices/platform/clksqw_userspace_consumer
> 	# echo 8192 > rate
> 	# echo 1 > enable
> 
> This also create new COMMON_CLK_DEBUG option and this userspace clock
> consumer depends on it.
> 
> Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
> Cc: Michael Turquette <mturquette@xxxxxxxxxxxx>
> Cc: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>
> ---
> * v2
> - change compatible property to "linux,clock-userspace-consumer"
> - rename sysfs file from 'state' to 'enable'

While it is good this is under a debug option, it also needs to be under 
debugfs, not sysfs.

> - create new COMMON_CLK_DEBUG option
> 
>  .../bindings/clock/clk-userspace-consumer.txt      |  17 +++
>  drivers/clk/Kconfig                                |   9 ++
>  drivers/clk/Kconfig.debug                          |   9 ++
>  drivers/clk/Makefile                               |   1 +
>  drivers/clk/clk-userspace-consumer.c               | 169 +++++++++++++++++++++
>  5 files changed, 205 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/clock/clk-userspace-consumer.txt
>  create mode 100644 drivers/clk/Kconfig.debug
>  create mode 100644 drivers/clk/clk-userspace-consumer.c

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux