aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Cooper <codekipper@gmail.com>2017-08-12 07:00:50 -0400
committerMark Brown <broonie@kernel.org>2017-08-14 12:24:39 -0400
commitcd1c63df5fa8196d8ed5138f1ecc22bbabf5f6df (patch)
tree4b8ee4c63c870f3e4e225c98520f3ba953577a98
parent0aef27cab880d9612331350c008aec00cbb3d247 (diff)
ASoC: sun4i-i2s: Add regmap config to quirks
The newer SoCs have a larger range than the original SoC that this driver was developed for. By adding the regmap config to the quirks then the driver can initialise the managed register map correctly. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sunxi/sun4i-i2s.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 9a35313c4f9b..f6f3c409f25e 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -94,11 +94,13 @@
94 * struct sun4i_i2s_quirks - Differences between SoC variants. 94 * struct sun4i_i2s_quirks - Differences between SoC variants.
95 * 95 *
96 * @has_reset: SoC needs reset deasserted. 96 * @has_reset: SoC needs reset deasserted.
97 * @sun4i_i2s_regmap: regmap config to use.
97 * @mclk_offset: Value by which mclkdiv needs to be adjusted. 98 * @mclk_offset: Value by which mclkdiv needs to be adjusted.
98 * @bclk_offset: Value by which bclkdiv needs to be adjusted. 99 * @bclk_offset: Value by which bclkdiv needs to be adjusted.
99 */ 100 */
100struct sun4i_i2s_quirks { 101struct sun4i_i2s_quirks {
101 bool has_reset; 102 bool has_reset;
103 const struct regmap_config *sun4i_i2s_regmap;
102 unsigned int mclk_offset; 104 unsigned int mclk_offset;
103 unsigned int bclk_offset; 105 unsigned int bclk_offset;
104}; 106};
@@ -674,11 +676,13 @@ static int sun4i_i2s_runtime_suspend(struct device *dev)
674} 676}
675 677
676static const struct sun4i_i2s_quirks sun4i_a10_i2s_quirks = { 678static const struct sun4i_i2s_quirks sun4i_a10_i2s_quirks = {
677 .has_reset = false, 679 .has_reset = false,
680 .sun4i_i2s_regmap = &sun4i_i2s_regmap_config,
678}; 681};
679 682
680static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = { 683static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = {
681 .has_reset = true, 684 .has_reset = true,
685 .sun4i_i2s_regmap = &sun4i_i2s_regmap_config,
682}; 686};
683 687
684static int sun4i_i2s_probe(struct platform_device *pdev) 688static int sun4i_i2s_probe(struct platform_device *pdev)
@@ -717,7 +721,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
717 } 721 }
718 722
719 i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs, 723 i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
720 &sun4i_i2s_regmap_config); 724 i2s->variant->sun4i_i2s_regmap);
721 if (IS_ERR(i2s->regmap)) { 725 if (IS_ERR(i2s->regmap)) {
722 dev_err(&pdev->dev, "Regmap initialisation failed\n"); 726 dev_err(&pdev->dev, "Regmap initialisation failed\n");
723 return PTR_ERR(i2s->regmap); 727 return PTR_ERR(i2s->regmap);