aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8350.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8350.c')
-rw-r--r--sound/soc/codecs/wm8350.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
index f4f1fba38eb9..4c6c81e11544 100644
--- a/sound/soc/codecs/wm8350.c
+++ b/sound/soc/codecs/wm8350.c
@@ -230,8 +230,9 @@ static inline int wm8350_out2_ramp_step(struct snd_soc_codec *codec)
230 */ 230 */
231static void wm8350_pga_work(struct work_struct *work) 231static void wm8350_pga_work(struct work_struct *work)
232{ 232{
233 struct snd_soc_codec *codec = 233 struct snd_soc_dapm_context *dapm =
234 container_of(work, struct snd_soc_codec, delayed_work.work); 234 container_of(work, struct snd_soc_dapm_context, delayed_work.work);
235 struct snd_soc_codec *codec = dapm->codec;
235 struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec); 236 struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec);
236 struct wm8350_output *out1 = &wm8350_data->out1, 237 struct wm8350_output *out1 = &wm8350_data->out1,
237 *out2 = &wm8350_data->out2; 238 *out2 = &wm8350_data->out2;
@@ -302,8 +303,8 @@ static int pga_event(struct snd_soc_dapm_widget *w,
302 out->ramp = WM8350_RAMP_UP; 303 out->ramp = WM8350_RAMP_UP;
303 out->active = 1; 304 out->active = 1;
304 305
305 if (!delayed_work_pending(&codec->delayed_work)) 306 if (!delayed_work_pending(&codec->dapm.delayed_work))
306 schedule_delayed_work(&codec->delayed_work, 307 schedule_delayed_work(&codec->dapm.delayed_work,
307 msecs_to_jiffies(1)); 308 msecs_to_jiffies(1));
308 break; 309 break;
309 310
@@ -311,8 +312,8 @@ static int pga_event(struct snd_soc_dapm_widget *w,
311 out->ramp = WM8350_RAMP_DOWN; 312 out->ramp = WM8350_RAMP_DOWN;
312 out->active = 0; 313 out->active = 0;
313 314
314 if (!delayed_work_pending(&codec->delayed_work)) 315 if (!delayed_work_pending(&codec->dapm.delayed_work))
315 schedule_delayed_work(&codec->delayed_work, 316 schedule_delayed_work(&codec->dapm.delayed_work,
316 msecs_to_jiffies(1)); 317 msecs_to_jiffies(1));
317 break; 318 break;
318 } 319 }
@@ -786,9 +787,10 @@ static const struct snd_soc_dapm_route audio_map[] = {
786 787
787static int wm8350_add_widgets(struct snd_soc_codec *codec) 788static int wm8350_add_widgets(struct snd_soc_codec *codec)
788{ 789{
790 struct snd_soc_dapm_context *dapm = &codec->dapm;
789 int ret; 791 int ret;
790 792
791 ret = snd_soc_dapm_new_controls(codec, 793 ret = snd_soc_dapm_new_controls(dapm,
792 wm8350_dapm_widgets, 794 wm8350_dapm_widgets,
793 ARRAY_SIZE(wm8350_dapm_widgets)); 795 ARRAY_SIZE(wm8350_dapm_widgets));
794 if (ret != 0) { 796 if (ret != 0) {
@@ -797,7 +799,7 @@ static int wm8350_add_widgets(struct snd_soc_codec *codec)
797 } 799 }
798 800
799 /* set up audio paths */ 801 /* set up audio paths */
800 ret = snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 802 ret = snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
801 if (ret != 0) { 803 if (ret != 0) {
802 dev_err(codec->dev, "DAPM route register failed\n"); 804 dev_err(codec->dev, "DAPM route register failed\n");
803 return ret; 805 return ret;
@@ -1184,7 +1186,7 @@ static int wm8350_set_bias_level(struct snd_soc_codec *codec,
1184 break; 1186 break;
1185 1187
1186 case SND_SOC_BIAS_STANDBY: 1188 case SND_SOC_BIAS_STANDBY:
1187 if (codec->bias_level == SND_SOC_BIAS_OFF) { 1189 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
1188 ret = regulator_bulk_enable(ARRAY_SIZE(priv->supplies), 1190 ret = regulator_bulk_enable(ARRAY_SIZE(priv->supplies),
1189 priv->supplies); 1191 priv->supplies);
1190 if (ret != 0) 1192 if (ret != 0)
@@ -1317,7 +1319,7 @@ static int wm8350_set_bias_level(struct snd_soc_codec *codec,
1317 priv->supplies); 1319 priv->supplies);
1318 break; 1320 break;
1319 } 1321 }
1320 codec->bias_level = level; 1322 codec->dapm.bias_level = level;
1321 return 0; 1323 return 0;
1322} 1324}
1323 1325
@@ -1550,7 +1552,7 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
1550 /* Put the codec into reset if it wasn't already */ 1552 /* Put the codec into reset if it wasn't already */
1551 wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); 1553 wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
1552 1554
1553 INIT_DELAYED_WORK(&codec->delayed_work, wm8350_pga_work); 1555 INIT_DELAYED_WORK(&codec->dapm.delayed_work, wm8350_pga_work);
1554 1556
1555 /* Enable the codec */ 1557 /* Enable the codec */
1556 wm8350_set_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); 1558 wm8350_set_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
@@ -1635,12 +1637,12 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec)
1635 priv->mic.jack = NULL; 1637 priv->mic.jack = NULL;
1636 1638
1637 /* cancel any work waiting to be queued. */ 1639 /* cancel any work waiting to be queued. */
1638 ret = cancel_delayed_work(&codec->delayed_work); 1640 ret = cancel_delayed_work(&codec->dapm.delayed_work);
1639 1641
1640 /* if there was any work waiting then we run it now and 1642 /* if there was any work waiting then we run it now and
1641 * wait for its completion */ 1643 * wait for its completion */
1642 if (ret) { 1644 if (ret) {
1643 schedule_delayed_work(&codec->delayed_work, 0); 1645 schedule_delayed_work(&codec->dapm.delayed_work, 0);
1644 flush_scheduled_work(); 1646 flush_scheduled_work();
1645 } 1647 }
1646 1648