diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 12:15:06 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 16:35:14 -0500 |
commit | 0e62780f5f27f24a30d5a08ed731088115e1fe80 (patch) | |
tree | 3124718383331a0070c762468f432d1dfe92215e /sound | |
parent | f235c649c1301ae85d5c7e51e88b13adb30ed6a8 (diff) |
ASoC: Convert WM8741 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm8741.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c index 24d8ec53f35b..3941f50bf187 100644 --- a/sound/soc/codecs/wm8741.c +++ b/sound/soc/codecs/wm8741.c | |||
@@ -85,24 +85,13 @@ SND_SOC_DAPM_OUTPUT("VOUTRP"), | |||
85 | SND_SOC_DAPM_OUTPUT("VOUTRN"), | 85 | SND_SOC_DAPM_OUTPUT("VOUTRN"), |
86 | }; | 86 | }; |
87 | 87 | ||
88 | static const struct snd_soc_dapm_route intercon[] = { | 88 | static const struct snd_soc_dapm_route wm8741_dapm_routes[] = { |
89 | { "VOUTLP", NULL, "DACL" }, | 89 | { "VOUTLP", NULL, "DACL" }, |
90 | { "VOUTLN", NULL, "DACL" }, | 90 | { "VOUTLN", NULL, "DACL" }, |
91 | { "VOUTRP", NULL, "DACR" }, | 91 | { "VOUTRP", NULL, "DACR" }, |
92 | { "VOUTRN", NULL, "DACR" }, | 92 | { "VOUTRN", NULL, "DACR" }, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static int wm8741_add_widgets(struct snd_soc_codec *codec) | ||
96 | { | ||
97 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
98 | |||
99 | snd_soc_dapm_new_controls(dapm, wm8741_dapm_widgets, | ||
100 | ARRAY_SIZE(wm8741_dapm_widgets)); | ||
101 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); | ||
102 | |||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | static struct { | 95 | static struct { |
107 | int value; | 96 | int value; |
108 | int ratio; | 97 | int ratio; |
@@ -456,10 +445,6 @@ static int wm8741_probe(struct snd_soc_codec *codec) | |||
456 | snd_soc_update_bits(codec, WM8741_DACRMSB_ATTENUATION, | 445 | snd_soc_update_bits(codec, WM8741_DACRMSB_ATTENUATION, |
457 | WM8741_UPDATERM, WM8741_UPDATERM); | 446 | WM8741_UPDATERM, WM8741_UPDATERM); |
458 | 447 | ||
459 | snd_soc_add_controls(codec, wm8741_snd_controls, | ||
460 | ARRAY_SIZE(wm8741_snd_controls)); | ||
461 | wm8741_add_widgets(codec); | ||
462 | |||
463 | dev_dbg(codec->dev, "Successful registration\n"); | 448 | dev_dbg(codec->dev, "Successful registration\n"); |
464 | return ret; | 449 | return ret; |
465 | 450 | ||
@@ -488,6 +473,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8741 = { | |||
488 | .reg_cache_size = ARRAY_SIZE(wm8741_reg_defaults), | 473 | .reg_cache_size = ARRAY_SIZE(wm8741_reg_defaults), |
489 | .reg_word_size = sizeof(u16), | 474 | .reg_word_size = sizeof(u16), |
490 | .reg_cache_default = wm8741_reg_defaults, | 475 | .reg_cache_default = wm8741_reg_defaults, |
476 | |||
477 | .controls = wm8741_snd_controls, | ||
478 | .num_controls = ARRAY_SIZE(wm8741_snd_controls), | ||
479 | .dapm_widgets = wm8741_dapm_widgets, | ||
480 | .num_dapm_widgets = ARRAY_SIZE(wm8741_dapm_widgets), | ||
481 | .dapm_routes = wm8741_dapm_routes, | ||
482 | .num_dapm_routes = ARRAY_SIZE(wm8741_dapm_routes), | ||
491 | }; | 483 | }; |
492 | 484 | ||
493 | static const struct of_device_id wm8741_of_match[] = { | 485 | static const struct of_device_id wm8741_of_match[] = { |