lkml.org 
[lkml]   [2015]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 1/7] clk: introduce clk_div_mask() helper
Date
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..20b0b67 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 unsigned long 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


\
 
 \ /
  Last update: 2015-03-31 20:01    [W:0.083 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site