Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2476490 authored by Mike Turquette's avatar Mike Turquette Committed by Arnd Bergmann
Browse files

clk: introduce the common clock framework



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: default avatarMike Turquette <mturquette@linaro.org>
Signed-off-by: default avatarMike Turquette <mturquette@ti.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: Rob Herring <rob.herring <at> calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
Cc: Arnd Bergman <arnd.bergmann@linaro.org>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Shawn Guo <shawn.guo@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Richard Zhao <richard.zhao@linaro.org>
Cc: Saravana Kannan <skannan@codeaurora.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Amit Kucheria <amit.kucheria@linaro.org>
Cc: Deepak Saxena <dsaxena@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 69fe8a8e
Loading
Loading
Loading
Loading
+40 −0
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line

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