Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+7 -17
+7 -17
sound/soc/codecs/wm8990.c
··· 787 787 SND_SOC_DAPM_OUTPUT("Internal DAC Sink"), 788 788 }; 789 789 790 - static const struct snd_soc_dapm_route audio_map[] = { 790 + static const struct snd_soc_dapm_route wm8990_dapm_routes[] = { 791 791 /* Make DACs turn on when playing even if not mixed into any outputs */ 792 792 {"Internal DAC Sink", NULL, "Left DAC"}, 793 793 {"Internal DAC Sink", NULL, "Right DAC"}, ··· 911 911 {"ROP", NULL, "ROPMIX"}, 912 912 {"RON", NULL, "RONMIX"}, 913 913 }; 914 - 915 - static 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 914 927 915 /* PLL divisors */ 928 916 struct _pll_div { ··· 1340 1352 snd_soc_write(codec, WM8990_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8)); 1341 1353 snd_soc_write(codec, WM8990_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8)); 1342 1354 1343 - snd_soc_add_codec_controls(codec, wm8990_snd_controls, 1344 - ARRAY_SIZE(wm8990_snd_controls)); 1345 - wm8990_add_widgets(codec); 1346 - 1347 1355 return 0; 1348 1356 } 1349 1357 ··· 1360 1376 .reg_word_size = sizeof(u16), 1361 1377 .reg_cache_default = wm8990_reg, 1362 1378 .volatile_register = wm8990_volatile_register, 1379 + .controls = wm8990_snd_controls, 1380 + .num_controls = ARRAY_SIZE(wm8990_snd_controls), 1381 + .dapm_widgets = wm8990_dapm_widgets, 1382 + .num_dapm_widgets = ARRAY_SIZE(wm8990_dapm_widgets), 1383 + .dapm_routes = wm8990_dapm_routes, 1384 + .num_dapm_routes = ARRAY_SIZE(wm8990_dapm_routes), 1363 1385 }; 1364 1386 1365 1387 static int wm8990_i2c_probe(struct i2c_client *i2c,