summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-03-25 16:31:17 +0100
committerMark Brown <broonie@kernel.org>2022-04-04 09:39:30 +0200
commit5f1b9d1e424b91a8ae04211cbe4d354463c83583 (patch)
treef70052d227d288581e5dc3c8222c6633f273171f /sound/soc
parentASoC: wm8731: Factor component init out of bus code (diff)
downloadlinux-5f1b9d1e424b91a8ae04211cbe4d354463c83583.tar.xz
linux-5f1b9d1e424b91a8ae04211cbe4d354463c83583.zip
ASoC: wm8731: Move regulator request into wm8731_init()
The supplies used by the wm8731 do not depend on the bus and there is no need to do anything with the supplies prior to instantiating the regmap so move the request into wm8731_init(). Signed-off-by: Mark Brown <broonie@kernel.org> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220325153121.1598494-4-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm8731.c48
1 files changed, 16 insertions, 32 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index b2ec03b1afed..334332bb5f22 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -569,8 +569,22 @@ static struct snd_soc_dai_driver wm8731_dai = {
.symmetric_rate = 1,
};
-static int wm8731_request_supplies(struct device *dev,
- struct wm8731_priv *wm8731)
+static const struct snd_soc_component_driver soc_component_dev_wm8731 = {
+ .set_bias_level = wm8731_set_bias_level,
+ .controls = wm8731_snd_controls,
+ .num_controls = ARRAY_SIZE(wm8731_snd_controls),
+ .dapm_widgets = wm8731_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets),
+ .dapm_routes = wm8731_intercon,
+ .num_dapm_routes = ARRAY_SIZE(wm8731_intercon),
+ .suspend_bias_off = 1,
+ .idle_bias_on = 1,
+ .use_pmdown_time = 1,
+ .endianness = 1,
+ .non_legacy_dai_naming = 1,
+};
+
+static int wm8731_init(struct device *dev, struct wm8731_priv *wm8731)
{
int ret = 0, i;
@@ -591,28 +605,6 @@ static int wm8731_request_supplies(struct device *dev,
return ret;
}
- return 0;
-}
-
-static const struct snd_soc_component_driver soc_component_dev_wm8731 = {
- .set_bias_level = wm8731_set_bias_level,
- .controls = wm8731_snd_controls,
- .num_controls = ARRAY_SIZE(wm8731_snd_controls),
- .dapm_widgets = wm8731_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets),
- .dapm_routes = wm8731_intercon,
- .num_dapm_routes = ARRAY_SIZE(wm8731_intercon),
- .suspend_bias_off = 1,
- .idle_bias_on = 1,
- .use_pmdown_time = 1,
- .endianness = 1,
- .non_legacy_dai_naming = 1,
-};
-
-static int wm8731_init(struct device *dev, struct wm8731_priv *wm8731)
-{
- int ret = 0;
-
ret = wm8731_reset(wm8731->regmap);
if (ret < 0) {
dev_err(dev, "Failed to issue reset: %d\n", ret);
@@ -695,10 +687,6 @@ static int wm8731_spi_probe(struct spi_device *spi)
spi_set_drvdata(spi, wm8731);
- ret = wm8731_request_supplies(&spi->dev, wm8731);
- if (ret != 0)
- return ret;
-
wm8731->regmap = devm_regmap_init_spi(spi, &wm8731_regmap);
if (IS_ERR(wm8731->regmap)) {
ret = PTR_ERR(wm8731->regmap);
@@ -748,10 +736,6 @@ static int wm8731_i2c_probe(struct i2c_client *i2c,
i2c_set_clientdata(i2c, wm8731);
- ret = wm8731_request_supplies(&i2c->dev, wm8731);
- if (ret != 0)
- return ret;
-
wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap);
if (IS_ERR(wm8731->regmap)) {
ret = PTR_ERR(wm8731->regmap);