diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-08-27 09:50:56 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-27 10:33:34 -0400 |
commit | aac97b5fd9537b62a68830d189509297cdac5ad9 (patch) | |
tree | 6075fdd4bd35baac1a6744afd4a826509a312491 /sound/soc/codecs/tlv320aic32x4.c | |
parent | d8dfad3876e4386666b759da3c833d62fb8b2267 (diff) |
ASoC: tlv320aic32x4: Convert table based control and DAPM setup
Let the core take care of instantiating the controls and DAPM widgets and
routes, this makes the code a bit shorter.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/tlv320aic32x4.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic32x4.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index 17df4e32feac..2ed57d4aa445 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c | |||
@@ -338,18 +338,6 @@ static inline int aic32x4_get_divs(int mclk, int rate) | |||
338 | return -EINVAL; | 338 | return -EINVAL; |
339 | } | 339 | } |
340 | 340 | ||
341 | static int aic32x4_add_widgets(struct snd_soc_codec *codec) | ||
342 | { | ||
343 | snd_soc_dapm_new_controls(&codec->dapm, aic32x4_dapm_widgets, | ||
344 | ARRAY_SIZE(aic32x4_dapm_widgets)); | ||
345 | |||
346 | snd_soc_dapm_add_routes(&codec->dapm, aic32x4_dapm_routes, | ||
347 | ARRAY_SIZE(aic32x4_dapm_routes)); | ||
348 | |||
349 | snd_soc_dapm_new_widgets(&codec->dapm); | ||
350 | return 0; | ||
351 | } | ||
352 | |||
353 | static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai, | 341 | static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai, |
354 | int clk_id, unsigned int freq, int dir) | 342 | int clk_id, unsigned int freq, int dir) |
355 | { | 343 | { |
@@ -683,9 +671,6 @@ static int aic32x4_probe(struct snd_soc_codec *codec) | |||
683 | } | 671 | } |
684 | 672 | ||
685 | aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 673 | aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
686 | snd_soc_add_codec_controls(codec, aic32x4_snd_controls, | ||
687 | ARRAY_SIZE(aic32x4_snd_controls)); | ||
688 | aic32x4_add_widgets(codec); | ||
689 | 674 | ||
690 | /* | 675 | /* |
691 | * Workaround: for an unknown reason, the ADC needs to be powered up | 676 | * Workaround: for an unknown reason, the ADC needs to be powered up |
@@ -714,6 +699,13 @@ static struct snd_soc_codec_driver soc_codec_dev_aic32x4 = { | |||
714 | .suspend = aic32x4_suspend, | 699 | .suspend = aic32x4_suspend, |
715 | .resume = aic32x4_resume, | 700 | .resume = aic32x4_resume, |
716 | .set_bias_level = aic32x4_set_bias_level, | 701 | .set_bias_level = aic32x4_set_bias_level, |
702 | |||
703 | .controls = aic32x4_snd_controls, | ||
704 | .num_controls = ARRAY_SIZE(aic32x4_snd_controls), | ||
705 | .dapm_widgets = aic32x4_dapm_widgets, | ||
706 | .num_dapm_widgets = ARRAY_SIZE(aic32x4_dapm_widgets), | ||
707 | .dapm_routes = aic32x4_dapm_routes, | ||
708 | .num_dapm_routes = ARRAY_SIZE(aic32x4_dapm_routes), | ||
717 | }; | 709 | }; |
718 | 710 | ||
719 | static int aic32x4_i2c_probe(struct i2c_client *i2c, | 711 | static int aic32x4_i2c_probe(struct i2c_client *i2c, |