diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 06:34:34 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 16:35:11 -0500 |
commit | b4505ab141a72f65bf7bb1f7c120411ab129181a (patch) | |
tree | 393eedebf7790072986c449fbe7865c5c4e00b6e /sound/soc/codecs/wm8400.c | |
parent | e6c94e9f6dd77c928419dc05af2b3d17ed9463b9 (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.c | 29 |
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 */ | ||
357 | static 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"), | |||
783 | SND_SOC_DAPM_OUTPUT("Internal DAC Sink"), | 776 | SND_SOC_DAPM_OUTPUT("Internal DAC Sink"), |
784 | }; | 777 | }; |
785 | 778 | ||
786 | static const struct snd_soc_dapm_route audio_map[] = { | 779 | static 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 | ||
912 | static 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 | ||
1428 | err_regulator: | 1408 | err_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 | ||
1456 | static int __devinit wm8400_probe(struct platform_device *pdev) | 1443 | static int __devinit wm8400_probe(struct platform_device *pdev) |