mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 1/7] clk: introduce clk_div_mask() helper
@ 2015-03-31 17:04 Andy Shevchenko
  2015-03-31 17:04 ` [PATCH v1 2/7] clk: mmp: switch to clk_div_mask() Andy Shevchenko
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Andy Shevchenko @ 2015-03-31 17:04 UTC (permalink / raw)
  To: linux-kernel, Sascha Hauer, Peter De Schrijver, Tero Kristo,
	Stephen Boyd, Russell King, Dinh Nguyen
  Cc: Andy Shevchenko

The patch introduces a helper that gives a divider mask based on register field
width.

The sequential patches will replace custom div_mask() macro in the
corresponding clock provider modules.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/clk-provider.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 5591ea7..0a534a8 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -353,6 +353,11 @@ struct clk_divider {
 	spinlock_t	*lock;
 };
 
+static inline clk_div_mask(u8 width)
+{
+	return (1 << width) - 1;
+}
+
 #define CLK_DIVIDER_ONE_BASED		BIT(0)
 #define CLK_DIVIDER_POWER_OF_TWO	BIT(1)
 #define CLK_DIVIDER_ALLOW_ZERO		BIT(2)
-- 
2.1.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-31 17:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-31 17:04 [PATCH v1 1/7] clk: introduce clk_div_mask() helper Andy Shevchenko
2015-03-31 17:04 ` [PATCH v1 2/7] clk: mmp: switch to clk_div_mask() Andy Shevchenko
2015-03-31 17:04 ` [PATCH v1 3/7] clk: divider: " Andy Shevchenko
2015-03-31 17:04 ` [PATCH v1 4/7] clk: socfpga: " Andy Shevchenko
2015-03-31 17:04 ` [PATCH v1 5/7] clk: ti: divider: " Andy Shevchenko
2015-03-31 17:04 ` [PATCH v1 6/7] clk: tegra: " Andy Shevchenko
2015-03-31 17:04 ` [PATCH v1 7/7] ARM: imx: " Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®