Skip to content

Commit dd8ab39

Browse files
committed
clk: meson: axg-audio: setup regmap max_register based on the SoC
The register region of axg-audio tends to grow with the addition of new supported SoC. Mapping slightly more has not been causing problem so far but it is not viable to continue like this long term. Setup the max register based on what is necessary on the related SoC. Reviewed-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jerome Brunet <[email protected]>
1 parent cbf4d39 commit dd8ab39

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/clk/meson/axg-audio.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,11 +1726,10 @@ static const struct reset_control_ops axg_audio_rstc_ops = {
17261726
.status = axg_audio_reset_status,
17271727
};
17281728

1729-
static const struct regmap_config axg_audio_regmap_cfg = {
1729+
static struct regmap_config axg_audio_regmap_cfg = {
17301730
.reg_bits = 32,
17311731
.val_bits = 32,
17321732
.reg_stride = 4,
1733-
.max_register = AUDIO_CLK_SPDIFOUT_B_CTRL,
17341733
};
17351734

17361735
struct audioclk_data {
@@ -1739,6 +1738,7 @@ struct audioclk_data {
17391738
struct meson_clk_hw_data hw_clks;
17401739
unsigned int reset_offset;
17411740
unsigned int reset_num;
1741+
unsigned int max_register;
17421742
};
17431743

17441744
static int axg_audio_clkc_probe(struct platform_device *pdev)
@@ -1760,6 +1760,7 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
17601760
if (IS_ERR(regs))
17611761
return PTR_ERR(regs);
17621762

1763+
axg_audio_regmap_cfg.max_register = data->max_register;
17631764
map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg);
17641765
if (IS_ERR(map)) {
17651766
dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map));
@@ -1828,6 +1829,7 @@ static const struct audioclk_data axg_audioclk_data = {
18281829
.hws = axg_audio_hw_clks,
18291830
.num = ARRAY_SIZE(axg_audio_hw_clks),
18301831
},
1832+
.max_register = AUDIO_CLK_PDMIN_CTRL1,
18311833
};
18321834

18331835
static const struct audioclk_data g12a_audioclk_data = {
@@ -1839,6 +1841,7 @@ static const struct audioclk_data g12a_audioclk_data = {
18391841
},
18401842
.reset_offset = AUDIO_SW_RESET,
18411843
.reset_num = 26,
1844+
.max_register = AUDIO_CLK_SPDIFOUT_B_CTRL,
18421845
};
18431846

18441847
static const struct audioclk_data sm1_audioclk_data = {
@@ -1850,6 +1853,7 @@ static const struct audioclk_data sm1_audioclk_data = {
18501853
},
18511854
.reset_offset = AUDIO_SM1_SW_RESET0,
18521855
.reset_num = 39,
1856+
.max_register = AUDIO_CLK_SPDIFOUT_B_CTRL,
18531857
};
18541858

18551859
static const struct of_device_id clkc_match_table[] = {

0 commit comments

Comments
 (0)