9
0
Fork 0
Commit Graph

26 Commits

Author SHA1 Message Date
Beniamino Galvani 298ecc5860 clk: gate: add CLK_GATE_HIWORD_MASK flag
Clock gates having the CLK_GATE_HIWORD_MASK flag set use the upper 16
bits of the register as a "write enable" mask for the value in the
lower 16 bits.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:15:24 +02:00
Beniamino Galvani 32a2a673c6 clk: gate: add flags argument to clock gate constructor
This adds a clk_gate_flags argument to clock gate creation functions
to allow the introduction of new clock gate modifiers.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:15:24 +02:00
Antony Pavlov a210138078 clk: move of_clk_get_parent_name() to common clk code
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:11:24 +02:00
Sascha Hauer 1184234a5e clk: Add parent round/set rate for mux and gate
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:15 +01:00
Sascha Hauer d4aaca3647 clk: clk-divider: sync with kernel code
This updates the clk-divider to Kernel code, but without power-of-two
divider support which we do not need yet. This also adds table based
divider support to the divider.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:14 +01:00
Sascha Hauer 503cc1518e clk: introduce CLK_SET_RATE_PARENT flag
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:14 +01:00
Sascha Hauer 3e9a71f78d clk: clk-divider: pass flags to initializers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:14 +01:00
Sascha Hauer 82163afcf0 clk: clk-fixed-factor: pass flags to initializers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:14 +01:00
Sascha Hauer f4c7536514 clk: clk-gate: pass flags to initializers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:02 +01:00
Sascha Hauer b33e5ba246 clk: clk-mux: pass clk flags from initializers
struct clk has a flags field, let the clk-mux initializers set this
field.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 10:51:30 +01:00
Sebastian Hesselbarth feb1e38b43 clk: add of_clk_init and CLK_OF_DECLARE macro
This add barebox versions of of_clk_init for parsing and registering
clock providers from DT. Also, a macro CLK_OF_DECLARE is added, that
allows to put init callbacks into its own section that can be linked
in the binary.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 09:26:59 +01:00
Sascha Hauer 19ea38a004 clk: of: introduce of_clk_src_simple_get
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-23 08:40:31 +02:00
Sascha Hauer cdd1de46ff clk: provide static inline wrappers
So that drivers can use clk_* functions without having to ifdef
them away.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 08:28:02 +02:00
Lucas Stach 10a06ed554 clk: allow to instanciate clk mux without registering it
Allows to reuse clk mux code within other clocks.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-02 08:36:09 +02:00
Lucas Stach 98a2fe8f95 clk: allow to instanciate clk gate without registering it
Allows to reuse the clk gate code within other clocks.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-02 08:36:09 +02:00
Lucas Stach b0d851d951 clk: add clock lookup from devicetree
Taken from the Linuxkernel with some small adjustments for barebox.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-02 08:36:09 +02:00
Sascha Hauer 680df77174 clk: add prototype for clk_is_enabled
On MXS we need to poll the busy bit when changing a clock rate, but only
when the parent clocks are enabled. This exposes the already present
function clk_is_enabled which is suitable for this job.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-20 08:49:55 +02:00
Sascha Hauer 707fb7ada5 clk: gate: Add inverted gate support
This adds support for gates which need 0 to enable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-20 08:44:22 +02:00
Sascha Hauer c7e41dac4f clk: divider: Add onebased divider support
In some dividers the register value matches the divider value. This
patch adds support for them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-20 08:44:22 +02:00
Sascha Hauer 87eebfe966 clk: Add is_enabled callback
This allows us to better detect whether a clk is enabled or not.

- If we can ask a clk, ask it. If it's enabled, go on and ask parents
- If we can't ask it, but it can be enabled, depend on the enable_count.
  if it's positive, go on and ask parents
- If we can't ask it and it cannot be enabled, assume it is enabled
  and ask parents.

This makes the CLK_ALWAYS_ENABLED unnecessary, since the fixed clk now
always returns 1 in its is_enabled callback.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-15 09:53:30 +01:00
Sascha Hauer 6bbb1b51bf Merge branch 'pu/clk' into for-next/clk
Conflicts:
	include/linux/clk.h
2012-12-07 11:54:19 +01:00
Sascha Hauer 802d901450 clk: Add clk table based divider support
For easy support of table based dividers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-06 12:55:21 +01:00
Antony Pavlov ac5c168870 clk: add always enabled clocks
Current barebox clk framework allow disable any clock
and there is no means to prevent that.

But there are the clocks that can't be disabled
by software at all.

This patch allow registration of a clock immune to clk_disable().

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-03 10:48:07 +01:00
Sascha Hauer 477b665671 clk: Add clk gate support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-10 09:47:51 +02:00
Sascha Hauer f2e2e596a2 clk: initial common clk support
This adds barebox common clk support loosely based on the Kernel common
clk support. differences are:

- barebox does not need prepare/unprepare
- no parent rate propagation for set_rate
- struct clk is not really encapsulated from the drivers

Along with the clk support we have support for some basic clk building
blocks:

- clk-fixed
- clk-fixed-factor
- clk-mux
- clk-divider

clk-fixed and clk-fixed-factor are completely generic, clk-mux and clk-divider
are currently the way i.MX muxes/dividers are implemented.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 15:19:55 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9080a35160 clock: Introduce clock framework from Linux
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:08:55 +02:00