aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8753.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8753.c')
-rw-r--r--sound/soc/codecs/wm8753.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 8f679a13f2b..26096b47a49 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -670,10 +670,11 @@ static const struct snd_soc_dapm_route audio_map[] = {
670 670
671static int wm8753_add_widgets(struct snd_soc_codec *codec) 671static int wm8753_add_widgets(struct snd_soc_codec *codec)
672{ 672{
673 snd_soc_dapm_new_controls(codec, wm8753_dapm_widgets, 673 struct snd_soc_dapm_context *dapm = &codec->dapm;
674 ARRAY_SIZE(wm8753_dapm_widgets));
675 674
676 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 675 snd_soc_dapm_new_controls(dapm, wm8753_dapm_widgets,
676 ARRAY_SIZE(wm8753_dapm_widgets));
677 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
677 678
678 return 0; 679 return 0;
679} 680}
@@ -1292,7 +1293,7 @@ static int wm8753_set_bias_level(struct snd_soc_codec *codec,
1292 wm8753_write(codec, WM8753_PWR1, 0x0001); 1293 wm8753_write(codec, WM8753_PWR1, 0x0001);
1293 break; 1294 break;
1294 } 1295 }
1295 codec->bias_level = level; 1296 codec->dapm.bias_level = level;
1296 return 0; 1297 return 0;
1297} 1298}
1298 1299
@@ -1482,9 +1483,11 @@ static void wm8753_set_dai_mode(struct snd_soc_codec *codec,
1482 1483
1483static void wm8753_work(struct work_struct *work) 1484static void wm8753_work(struct work_struct *work)
1484{ 1485{
1485 struct snd_soc_codec *codec = 1486 struct snd_soc_dapm_context *dapm =
1486 container_of(work, struct snd_soc_codec, delayed_work.work); 1487 container_of(work, struct snd_soc_dapm_context,
1487 wm8753_set_bias_level(codec, codec->bias_level); 1488 delayed_work.work);
1489 struct snd_soc_codec *codec = dapm->codec;
1490 wm8753_set_bias_level(codec, dapm->bias_level);
1488} 1491}
1489 1492
1490static int wm8753_suspend(struct snd_soc_codec *codec, pm_message_t state) 1493static int wm8753_suspend(struct snd_soc_codec *codec, pm_message_t state)
@@ -1516,10 +1519,10 @@ static int wm8753_resume(struct snd_soc_codec *codec)
1516 wm8753_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1519 wm8753_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1517 1520
1518 /* charge wm8753 caps */ 1521 /* charge wm8753 caps */
1519 if (codec->suspend_bias_level == SND_SOC_BIAS_ON) { 1522 if (codec->dapm.suspend_bias_level == SND_SOC_BIAS_ON) {
1520 wm8753_set_bias_level(codec, SND_SOC_BIAS_PREPARE); 1523 wm8753_set_bias_level(codec, SND_SOC_BIAS_PREPARE);
1521 codec->bias_level = SND_SOC_BIAS_ON; 1524 codec->dapm.bias_level = SND_SOC_BIAS_ON;
1522 schedule_delayed_work(&codec->delayed_work, 1525 schedule_delayed_work(&codec->dapm.delayed_work,
1523 msecs_to_jiffies(caps_charge)); 1526 msecs_to_jiffies(caps_charge));
1524 } 1527 }
1525 1528
@@ -1550,7 +1553,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)
1550 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); 1553 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
1551 int ret = 0, reg; 1554 int ret = 0, reg;
1552 1555
1553 INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work); 1556 INIT_DELAYED_WORK(&codec->dapm.delayed_work, wm8753_work);
1554 1557
1555 ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8753->control_type); 1558 ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8753->control_type);
1556 if (ret < 0) { 1559 if (ret < 0) {
@@ -1569,7 +1572,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)
1569 1572
1570 /* charge output caps */ 1573 /* charge output caps */
1571 wm8753_set_bias_level(codec, SND_SOC_BIAS_PREPARE); 1574 wm8753_set_bias_level(codec, SND_SOC_BIAS_PREPARE);
1572 schedule_delayed_work(&codec->delayed_work, 1575 schedule_delayed_work(&codec->dapm.delayed_work,
1573 msecs_to_jiffies(caps_charge)); 1576 msecs_to_jiffies(caps_charge));
1574 1577
1575 /* set the update bits */ 1578 /* set the update bits */
@@ -1604,7 +1607,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)
1604/* power down chip */ 1607/* power down chip */
1605static int wm8753_remove(struct snd_soc_codec *codec) 1608static int wm8753_remove(struct snd_soc_codec *codec)
1606{ 1609{
1607 run_delayed_work(&codec->delayed_work); 1610 run_delayed_work(&codec->dapm.delayed_work);
1608 wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); 1611 wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF);
1609 1612
1610 return 0; 1613 return 0;