aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8990.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-11-22 08:44:56 -0500
committerMark Brown <broonie@linaro.org>2013-11-25 10:49:46 -0500
commitf6b415b6065041c0970426cc8ac81a980b2998f2 (patch)
treefef5edb76478a835a79290c1571b0265224cb233 /sound/soc/codecs/wm8990.c
parent93818c9a12dd38f2b32f960f979815ac2e15a176 (diff)
ASoC: wm8990: Convert to table based control and DAPM init
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8990.c')
-rw-r--r--sound/soc/codecs/wm8990.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index 33bec5672418..6ee1cf1d353d 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -787,7 +787,7 @@ SND_SOC_DAPM_OUTPUT("RON"),
787SND_SOC_DAPM_OUTPUT("Internal DAC Sink"), 787SND_SOC_DAPM_OUTPUT("Internal DAC Sink"),
788}; 788};
789 789
790static const struct snd_soc_dapm_route audio_map[] = { 790static const struct snd_soc_dapm_route wm8990_dapm_routes[] = {
791 /* Make DACs turn on when playing even if not mixed into any outputs */ 791 /* Make DACs turn on when playing even if not mixed into any outputs */
792 {"Internal DAC Sink", NULL, "Left DAC"}, 792 {"Internal DAC Sink", NULL, "Left DAC"},
793 {"Internal DAC Sink", NULL, "Right DAC"}, 793 {"Internal DAC Sink", NULL, "Right DAC"},
@@ -912,18 +912,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
912 {"RON", NULL, "RONMIX"}, 912 {"RON", NULL, "RONMIX"},
913}; 913};
914 914
915static int wm8990_add_widgets(struct snd_soc_codec *codec)
916{
917 struct snd_soc_dapm_context *dapm = &codec->dapm;
918
919 snd_soc_dapm_new_controls(dapm, wm8990_dapm_widgets,
920 ARRAY_SIZE(wm8990_dapm_widgets));
921 /* set up the WM8990 audio map */
922 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
923
924 return 0;
925}
926
927/* PLL divisors */ 915/* PLL divisors */
928struct _pll_div { 916struct _pll_div {
929 u32 div2; 917 u32 div2;
@@ -1352,10 +1340,6 @@ static int wm8990_probe(struct snd_soc_codec *codec)
1352 snd_soc_write(codec, WM8990_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8)); 1340 snd_soc_write(codec, WM8990_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8));
1353 snd_soc_write(codec, WM8990_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8)); 1341 snd_soc_write(codec, WM8990_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8));
1354 1342
1355 snd_soc_add_codec_controls(codec, wm8990_snd_controls,
1356 ARRAY_SIZE(wm8990_snd_controls));
1357 wm8990_add_widgets(codec);
1358
1359 return 0; 1343 return 0;
1360} 1344}
1361 1345
@@ -1376,6 +1360,12 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8990 = {
1376 .reg_word_size = sizeof(u16), 1360 .reg_word_size = sizeof(u16),
1377 .reg_cache_default = wm8990_reg, 1361 .reg_cache_default = wm8990_reg,
1378 .volatile_register = wm8990_volatile_register, 1362 .volatile_register = wm8990_volatile_register,
1363 .controls = wm8990_snd_controls,
1364 .num_controls = ARRAY_SIZE(wm8990_snd_controls),
1365 .dapm_widgets = wm8990_dapm_widgets,
1366 .num_dapm_widgets = ARRAY_SIZE(wm8990_dapm_widgets),
1367 .dapm_routes = wm8990_dapm_routes,
1368 .num_dapm_routes = ARRAY_SIZE(wm8990_dapm_routes),
1379}; 1369};
1380 1370
1381static int wm8990_i2c_probe(struct i2c_client *i2c, 1371static int wm8990_i2c_probe(struct i2c_client *i2c,