aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/wm8400.c9
-rw-r--r--sound/soc/codecs/wm8903.c12
-rw-r--r--sound/soc/codecs/wm8994.c10
-rw-r--r--sound/soc/codecs/wm8997.c11
-rw-r--r--sound/soc/codecs/wm8998.c12
5 files changed, 13 insertions, 41 deletions
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index 6c59fb933bd6..a36adf881bca 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -1285,6 +1285,7 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec)
1285 if (priv == NULL) 1285 if (priv == NULL)
1286 return -ENOMEM; 1286 return -ENOMEM;
1287 1287
1288 snd_soc_codec_init_regmap(codec, wm8400->regmap);
1288 snd_soc_codec_set_drvdata(codec, priv); 1289 snd_soc_codec_set_drvdata(codec, priv);
1289 priv->wm8400 = wm8400; 1290 priv->wm8400 = wm8400;
1290 1291
@@ -1325,17 +1326,9 @@ static int wm8400_codec_remove(struct snd_soc_codec *codec)
1325 return 0; 1326 return 0;
1326} 1327}
1327 1328
1328static struct regmap *wm8400_get_regmap(struct device *dev)
1329{
1330 struct wm8400 *wm8400 = dev_get_platdata(dev);
1331
1332 return wm8400->regmap;
1333}
1334
1335static const struct snd_soc_codec_driver soc_codec_dev_wm8400 = { 1329static const struct snd_soc_codec_driver soc_codec_dev_wm8400 = {
1336 .probe = wm8400_codec_probe, 1330 .probe = wm8400_codec_probe,
1337 .remove = wm8400_codec_remove, 1331 .remove = wm8400_codec_remove,
1338 .get_regmap = wm8400_get_regmap,
1339 .set_bias_level = wm8400_set_bias_level, 1332 .set_bias_level = wm8400_set_bias_level,
1340 .suspend_bias_off = true, 1333 .suspend_bias_off = true,
1341 1334
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 237eeb9a8b97..cba90f21161f 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1995,8 +1995,7 @@ static int wm8903_i2c_probe(struct i2c_client *i2c,
1995 unsigned int val, irq_pol; 1995 unsigned int val, irq_pol;
1996 int ret, i; 1996 int ret, i;
1997 1997
1998 wm8903 = devm_kzalloc(&i2c->dev, sizeof(struct wm8903_priv), 1998 wm8903 = devm_kzalloc(&i2c->dev, sizeof(*wm8903), GFP_KERNEL);
1999 GFP_KERNEL);
2000 if (wm8903 == NULL) 1999 if (wm8903 == NULL)
2001 return -ENOMEM; 2000 return -ENOMEM;
2002 2001
@@ -2017,13 +2016,10 @@ static int wm8903_i2c_probe(struct i2c_client *i2c,
2017 if (pdata) { 2016 if (pdata) {
2018 wm8903->pdata = pdata; 2017 wm8903->pdata = pdata;
2019 } else { 2018 } else {
2020 wm8903->pdata = devm_kzalloc(&i2c->dev, 2019 wm8903->pdata = devm_kzalloc(&i2c->dev, sizeof(*wm8903->pdata),
2021 sizeof(struct wm8903_platform_data), 2020 GFP_KERNEL);
2022 GFP_KERNEL); 2021 if (!wm8903->pdata)
2023 if (wm8903->pdata == NULL) {
2024 dev_err(&i2c->dev, "Failed to allocate pdata\n");
2025 return -ENOMEM; 2022 return -ENOMEM;
2026 }
2027 2023
2028 if (i2c->irq) { 2024 if (i2c->irq) {
2029 ret = wm8903_set_pdata_irq_trigger(i2c, wm8903->pdata); 2025 ret = wm8903_set_pdata_irq_trigger(i2c, wm8903->pdata);
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index f91b49e1ece3..21ffd6403173 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3993,6 +3993,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
3993 unsigned int reg; 3993 unsigned int reg;
3994 int ret, i; 3994 int ret, i;
3995 3995
3996 snd_soc_codec_init_regmap(codec, control->regmap);
3997
3996 wm8994->hubs.codec = codec; 3998 wm8994->hubs.codec = codec;
3997 3999
3998 mutex_init(&wm8994->accdet_lock); 4000 mutex_init(&wm8994->accdet_lock);
@@ -4434,19 +4436,11 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec)
4434 return 0; 4436 return 0;
4435} 4437}
4436 4438
4437static struct regmap *wm8994_get_regmap(struct device *dev)
4438{
4439 struct wm8994 *control = dev_get_drvdata(dev->parent);
4440
4441 return control->regmap;
4442}
4443
4444static const struct snd_soc_codec_driver soc_codec_dev_wm8994 = { 4439static const struct snd_soc_codec_driver soc_codec_dev_wm8994 = {
4445 .probe = wm8994_codec_probe, 4440 .probe = wm8994_codec_probe,
4446 .remove = wm8994_codec_remove, 4441 .remove = wm8994_codec_remove,
4447 .suspend = wm8994_codec_suspend, 4442 .suspend = wm8994_codec_suspend,
4448 .resume = wm8994_codec_resume, 4443 .resume = wm8994_codec_resume,
4449 .get_regmap = wm8994_get_regmap,
4450 .set_bias_level = wm8994_set_bias_level, 4444 .set_bias_level = wm8994_set_bias_level,
4451}; 4445};
4452 4446
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index 77f512767273..cac9b3e7e15d 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1062,8 +1062,11 @@ static int wm8997_codec_probe(struct snd_soc_codec *codec)
1062 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); 1062 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
1063 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 1063 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
1064 struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec); 1064 struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec);
1065 struct arizona *arizona = priv->core.arizona;
1065 int ret; 1066 int ret;
1066 1067
1068 snd_soc_codec_init_regmap(codec, arizona->regmap);
1069
1067 ret = arizona_init_spk(codec); 1070 ret = arizona_init_spk(codec);
1068 if (ret < 0) 1071 if (ret < 0)
1069 return ret; 1072 return ret;
@@ -1095,17 +1098,9 @@ static unsigned int wm8997_digital_vu[] = {
1095 ARIZONA_DAC_DIGITAL_VOLUME_5R, 1098 ARIZONA_DAC_DIGITAL_VOLUME_5R,
1096}; 1099};
1097 1100
1098static struct regmap *wm8997_get_regmap(struct device *dev)
1099{
1100 struct wm8997_priv *priv = dev_get_drvdata(dev);
1101
1102 return priv->core.arizona->regmap;
1103}
1104
1105static const struct snd_soc_codec_driver soc_codec_dev_wm8997 = { 1101static const struct snd_soc_codec_driver soc_codec_dev_wm8997 = {
1106 .probe = wm8997_codec_probe, 1102 .probe = wm8997_codec_probe,
1107 .remove = wm8997_codec_remove, 1103 .remove = wm8997_codec_remove,
1108 .get_regmap = wm8997_get_regmap,
1109 1104
1110 .idle_bias_off = true, 1105 .idle_bias_off = true,
1111 1106
diff --git a/sound/soc/codecs/wm8998.c b/sound/soc/codecs/wm8998.c
index 2d211dbe7422..1288e1f67dcf 100644
--- a/sound/soc/codecs/wm8998.c
+++ b/sound/soc/codecs/wm8998.c
@@ -1275,9 +1275,11 @@ static int wm8998_codec_probe(struct snd_soc_codec *codec)
1275 struct wm8998_priv *priv = snd_soc_codec_get_drvdata(codec); 1275 struct wm8998_priv *priv = snd_soc_codec_get_drvdata(codec);
1276 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); 1276 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
1277 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 1277 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
1278 struct arizona *arizona = priv->core.arizona;
1278 int ret; 1279 int ret;
1279 1280
1280 priv->core.arizona->dapm = dapm; 1281 arizona->dapm = dapm;
1282 snd_soc_codec_init_regmap(codec, arizona->regmap);
1281 1283
1282 ret = arizona_init_spk(codec); 1284 ret = arizona_init_spk(codec);
1283 if (ret < 0) 1285 if (ret < 0)
@@ -1313,17 +1315,9 @@ static unsigned int wm8998_digital_vu[] = {
1313 ARIZONA_DAC_DIGITAL_VOLUME_5R, 1315 ARIZONA_DAC_DIGITAL_VOLUME_5R,
1314}; 1316};
1315 1317
1316static struct regmap *wm8998_get_regmap(struct device *dev)
1317{
1318 struct wm8998_priv *priv = dev_get_drvdata(dev);
1319
1320 return priv->core.arizona->regmap;
1321}
1322
1323static const struct snd_soc_codec_driver soc_codec_dev_wm8998 = { 1318static const struct snd_soc_codec_driver soc_codec_dev_wm8998 = {
1324 .probe = wm8998_codec_probe, 1319 .probe = wm8998_codec_probe,
1325 .remove = wm8998_codec_remove, 1320 .remove = wm8998_codec_remove,
1326 .get_regmap = wm8998_get_regmap,
1327 1321
1328 .idle_bias_off = true, 1322 .idle_bias_off = true,
1329 1323