diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-11-05 04:46:34 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-05 09:49:06 -0500 |
commit | a6bf30698825718f22a689a54ea023cdf51a4c76 (patch) | |
tree | c21b5d2b9d54ec4ad402843576e236f25d2ba9c1 | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
ASoC: wm8737: Use table based DAPM and control setup
Makes the code a bit cleaner and shorter.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/wm8737.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c index 744a422ecb05..fe41dd2b9b45 100644 --- a/sound/soc/codecs/wm8737.c +++ b/sound/soc/codecs/wm8737.c | |||
@@ -277,17 +277,6 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
277 | { "AIF", NULL, "ADCR" }, | 277 | { "AIF", NULL, "ADCR" }, |
278 | }; | 278 | }; |
279 | 279 | ||
280 | static int wm8737_add_widgets(struct snd_soc_codec *codec) | ||
281 | { | ||
282 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
283 | |||
284 | snd_soc_dapm_new_controls(dapm, wm8737_dapm_widgets, | ||
285 | ARRAY_SIZE(wm8737_dapm_widgets)); | ||
286 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); | ||
287 | |||
288 | return 0; | ||
289 | } | ||
290 | |||
291 | /* codec mclk clock divider coefficients */ | 280 | /* codec mclk clock divider coefficients */ |
292 | static const struct { | 281 | static const struct { |
293 | u32 mclk; | 282 | u32 mclk; |
@@ -593,10 +582,6 @@ static int wm8737_probe(struct snd_soc_codec *codec) | |||
593 | /* Bias level configuration will have done an extra enable */ | 582 | /* Bias level configuration will have done an extra enable */ |
594 | regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies); | 583 | regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies); |
595 | 584 | ||
596 | snd_soc_add_codec_controls(codec, wm8737_snd_controls, | ||
597 | ARRAY_SIZE(wm8737_snd_controls)); | ||
598 | wm8737_add_widgets(codec); | ||
599 | |||
600 | return 0; | 585 | return 0; |
601 | 586 | ||
602 | err_enable: | 587 | err_enable: |
@@ -617,6 +602,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8737 = { | |||
617 | .suspend = wm8737_suspend, | 602 | .suspend = wm8737_suspend, |
618 | .resume = wm8737_resume, | 603 | .resume = wm8737_resume, |
619 | .set_bias_level = wm8737_set_bias_level, | 604 | .set_bias_level = wm8737_set_bias_level, |
605 | |||
606 | .controls = wm8737_snd_controls, | ||
607 | .num_controls = ARRAY_SIZE(wm8737_snd_controls), | ||
608 | .dapm_widgets = wm8737_dapm_widgets, | ||
609 | .num_dapm_widgets = ARRAY_SIZE(wm8737_dapm_widgets), | ||
610 | .dapm_routes = intercon, | ||
611 | .num_dapm_routes = ARRAY_SIZE(intercon), | ||
620 | }; | 612 | }; |
621 | 613 | ||
622 | static const struct of_device_id wm8737_of_match[] = { | 614 | static const struct of_device_id wm8737_of_match[] = { |