diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-04-02 14:50:50 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2019-04-25 12:34:03 -0700 |
commit | cb4f4949b1c76f29ca804d6ecd879a2e84c88afc (patch) | |
tree | e825c68b3d6352b24ebd15a07cfe2fcbc039b478 /drivers/clk/at91/dt-compat.c | |
parent | 5c16ffa795b7bcdbd73d5983482c5c0fe5566c06 (diff) | |
download | linux-cb4f4949b1c76f29ca804d6ecd879a2e84c88afc.tar.gz linux-cb4f4949b1c76f29ca804d6ecd879a2e84c88afc.tar.bz2 linux-cb4f4949b1c76f29ca804d6ecd879a2e84c88afc.zip |
clk: at91: allow configuring peripheral PCR layout
The PCR register actually changed layout for each SoC. By chance, this
didn't have impact on sama5d[2-4] support but since sama5d3, PID is seven
bits wide and sama5d4 and sama5d2 don't have DIV.
For the DT backward compatibility, keep the layout as is.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/at91/dt-compat.c')
-rw-r--r-- | drivers/clk/at91/dt-compat.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index b95bb4e2a927..aa09072f36db 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -93,6 +93,14 @@ CLK_OF_DECLARE(of_sama5d2_clk_audio_pll_pmc_setup, of_sama5d2_clk_audio_pll_pmc_setup); #endif /* CONFIG_HAVE_AT91_AUDIO_PLL */ +static const struct clk_pcr_layout dt_pcr_layout = { + .offset = 0x10c, + .cmd = BIT(12), + .pid_mask = GENMASK(5, 0), + .div_mask = GENMASK(17, 16), + .gckcss_mask = GENMASK(10, 8), +}; + #ifdef CONFIG_HAVE_AT91_GENERATED_CLK #define GENERATED_SOURCE_MAX 6 @@ -448,6 +456,7 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, + &dt_pcr_layout, name, parent_name, id, &range); |