Commit 934e2536 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Stephen Boyd

clk: fractional-divider: keep mwidth and nwidth internally

The patch adds mwidth and nwidth fields to the struct clk_fractional_divider
for further usage. While here, use GENMASK() instead of open coding this
functionality.
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent f7f087c2
...@@ -128,9 +128,11 @@ struct clk *clk_register_fractional_divider(struct device *dev, ...@@ -128,9 +128,11 @@ struct clk *clk_register_fractional_divider(struct device *dev,
fd->reg = reg; fd->reg = reg;
fd->mshift = mshift; fd->mshift = mshift;
fd->mmask = (BIT(mwidth) - 1) << mshift; fd->mwidth = mwidth;
fd->mmask = GENMASK(mwidth - 1, 0) << mshift;
fd->nshift = nshift; fd->nshift = nshift;
fd->nmask = (BIT(nwidth) - 1) << nshift; fd->nwidth = nwidth;
fd->nmask = GENMASK(nwidth - 1, 0) << nshift;
fd->flags = clk_divider_flags; fd->flags = clk_divider_flags;
fd->lock = lock; fd->lock = lock;
fd->hw.init = &init; fd->hw.init = &init;
......
...@@ -500,13 +500,14 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name, ...@@ -500,13 +500,14 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
* *
* Clock with adjustable fractional divider affecting its output frequency. * Clock with adjustable fractional divider affecting its output frequency.
*/ */
struct clk_fractional_divider { struct clk_fractional_divider {
struct clk_hw hw; struct clk_hw hw;
void __iomem *reg; void __iomem *reg;
u8 mshift; u8 mshift;
u8 mwidth;
u32 mmask; u32 mmask;
u8 nshift; u8 nshift;
u8 nwidth;
u32 nmask; u32 nmask;
u8 flags; u8 flags;
spinlock_t *lock; spinlock_t *lock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment