Messages in this thread Patch in this message | | | From | Andy Shevchenko <> | Subject | [PATCH v3 1/7] clk: introduce clk_div_mask() helper | Date | Tue, 31 Mar 2015 20:22:21 +0300 |
| |
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
| |