[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427822547-163289-2-git-send-email-andriy.shevchenko@linux.intel.com>
Date: Tue, 31 Mar 2015 20:22:21 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: linux-kernel@...r.kernel.org, Sascha Hauer <kernel@...gutronix.de>,
Peter De Schrijver <pdeschrijver@...dia.com>,
Tero Kristo <t-kristo@...com>,
Stephen Boyd <sboyd@...eaurora.org>,
Russell King <linux@....linux.org.uk>,
Dinh Nguyen <dinguyen@...nsource.altera.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v3 1/7] clk: introduce clk_div_mask() helper
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@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists