[PATCH v3 1/7] clk: introduce clk_div_mask() helper
From: Andy Shevchenko
Date: Tue Mar 31 2015 - 13:22:54 EST
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@xxxxxxxxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/