aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8400.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-03 06:34:34 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-03 16:35:11 -0500
commitb4505ab141a72f65bf7bb1f7c120411ab129181a (patch)
tree393eedebf7790072986c449fbe7865c5c4e00b6e /sound/soc/codecs/wm8400.c
parente6c94e9f6dd77c928419dc05af2b3d17ed9463b9 (diff)
ASoC: Convert WM8400 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8400.c')
-rw-r--r--sound/soc/codecs/wm8400.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index aef7e4dcefdd..898979d23010 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -353,13 +353,6 @@ SOC_SINGLE("RIN34 Mute Switch", WM8400_RIGHT_LINE_INPUT_3_4_VOLUME,
353 353
354}; 354};
355 355
356/* add non dapm controls */
357static int wm8400_add_controls(struct snd_soc_codec *codec)
358{
359 return snd_soc_add_controls(codec, wm8400_snd_controls,
360 ARRAY_SIZE(wm8400_snd_controls));
361}
362
363/* 356/*
364 * _DAPM_ Controls 357 * _DAPM_ Controls
365 */ 358 */
@@ -783,7 +776,7 @@ SND_SOC_DAPM_OUTPUT("RON"),
783SND_SOC_DAPM_OUTPUT("Internal DAC Sink"), 776SND_SOC_DAPM_OUTPUT("Internal DAC Sink"),
784}; 777};
785 778
786static const struct snd_soc_dapm_route audio_map[] = { 779static const struct snd_soc_dapm_route wm8400_dapm_routes[] = {
787 /* Make DACs turn on when playing even if not mixed into any outputs */ 780 /* Make DACs turn on when playing even if not mixed into any outputs */
788 {"Internal DAC Sink", NULL, "Left DAC"}, 781 {"Internal DAC Sink", NULL, "Left DAC"},
789 {"Internal DAC Sink", NULL, "Right DAC"}, 782 {"Internal DAC Sink", NULL, "Right DAC"},
@@ -909,17 +902,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
909 {"RON", NULL, "RONMIX"}, 902 {"RON", NULL, "RONMIX"},
910}; 903};
911 904
912static int wm8400_add_widgets(struct snd_soc_codec *codec)
913{
914 struct snd_soc_dapm_context *dapm = &codec->dapm;
915
916 snd_soc_dapm_new_controls(dapm, wm8400_dapm_widgets,
917 ARRAY_SIZE(wm8400_dapm_widgets));
918 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
919
920 return 0;
921}
922
923/* 905/*
924 * Clock after FLL and dividers 906 * Clock after FLL and dividers
925 */ 907 */
@@ -1421,8 +1403,6 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec)
1421 ret = -EINVAL; 1403 ret = -EINVAL;
1422 goto err_regulator; 1404 goto err_regulator;
1423 } 1405 }
1424 wm8400_add_controls(codec);
1425 wm8400_add_widgets(codec);
1426 return 0; 1406 return 0;
1427 1407
1428err_regulator: 1408err_regulator:
@@ -1451,6 +1431,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8400 = {
1451 .read = wm8400_read, 1431 .read = wm8400_read,
1452 .write = wm8400_write, 1432 .write = wm8400_write,
1453 .set_bias_level = wm8400_set_bias_level, 1433 .set_bias_level = wm8400_set_bias_level,
1434
1435 .controls = wm8400_snd_controls,
1436 .num_controls = ARRAY_SIZE(wm8400_snd_controls),
1437 .dapm_widgets = wm8400_dapm_widgets,
1438 .num_dapm_widgets = ARRAY_SIZE(wm8400_dapm_widgets),
1439 .dapm_routes = wm8400_dapm_routes,
1440 .num_dapm_routes = ARRAY_SIZE(wm8400_dapm_routes),
1454}; 1441};
1455 1442
1456static int __devinit wm8400_probe(struct platform_device *pdev) 1443static int __devinit wm8400_probe(struct platform_device *pdev)