Skip to content

Commit

Permalink
clk: introduce the common clock framework
Browse files Browse the repository at this point in the history
The common clock framework defines a common struct clk useful across
most platforms as well as an implementation of the clk api that drivers
can use safely for managing clocks.

The net result is consolidation of many different struct clk definitions
and platform-specific clock framework implementations.

This patch introduces the common struct clk, struct clk_ops and an
implementation of the well-known clock api in include/clk/clk.h.
Platforms may define their own hardware-specific clock structure and
their own clock operation callbacks, so long as it wraps an instance of
struct clk_hw.

See Documentation/clk.txt for more details.

This patch is based on the work of Jeremy Kerr, which in turn was based
on the work of Ben Herrenschmidt.

Signed-off-by: Mike Turquette <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Tested-by: Andrew Lunn <[email protected]>
Reviewed-by: Rob Herring <rob.herring <at> calxeda.com>
Cc: Russell King <[email protected]>
Cc: Jeremy Kerr <[email protected]>
Cc: Arnd Bergman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Richard Zhao <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Amit Kucheria <[email protected]>
Cc: Deepak Saxena <[email protected]>
Cc: Grant Likely <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
  • Loading branch information
Mike Turquette authored and arndb committed Mar 16, 2012
1 parent 69fe8a8 commit b247649
Show file tree
Hide file tree
Showing 6 changed files with 1,810 additions and 5 deletions.
40 changes: 40 additions & 0 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,43 @@ config HAVE_CLK_PREPARE

config HAVE_MACH_CLKDEV
bool

menuconfig COMMON_CLK
bool "Common Clock Framework"
select HAVE_CLK_PREPARE
---help---
The common clock framework is a single definition of struct
clk, useful across many platforms, as well as an
implementation of the clock API in include/linux/clk.h.
Architectures utilizing the common struct clk should select
this automatically, but it may be necessary to manually select
this option for loadable modules requiring the common clock
framework.

If in doubt, say "N".

if COMMON_CLK

config COMMON_CLK_DISABLE_UNUSED
bool "Disabled unused clocks at boot"
depends on COMMON_CLK
---help---
Traverses the entire clock tree and disables any clocks that are
enabled in hardware but have not been enabled by any device drivers.
This saves power and keeps the software model of the clock in line
with reality.

If in doubt, say "N".

config COMMON_CLK_DEBUG
bool "DebugFS representation of clock tree"
depends on COMMON_CLK
select DEBUG_FS
---help---
Creates a directory hierchy in debugfs for visualizing the clk
tree structure. Each directory contains read-only members
that export information specific to that clk node: clk_rate,
clk_flags, clk_prepare_count, clk_enable_count &
clk_notifier_count.

endif
1 change: 1 addition & 0 deletions drivers/clk/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

obj-$(CONFIG_CLKDEV_LOOKUP) += clkdev.o
obj-$(CONFIG_COMMON_CLK) += clk.o
Loading

0 comments on commit b247649

Please sign in to comment.