diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-29 16:45:27 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-20 08:58:25 -0500 |
commit | 3294c4c603a1c4ce00e5b8495e99dd3ba076f1e3 (patch) | |
tree | 2035b3093c109d2a3cbd4c7d68b6a0ff51a3020e /sound/soc/codecs/wm8955.c | |
parent | 95860fdf0f565f96fc37561b6794177604f89097 (diff) |
ASoC: Convert WM8955 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8955.c')
-rw-r--r-- | sound/soc/codecs/wm8955.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index 11fb2dd40c5c..61fe97433e73 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c | |||
@@ -544,7 +544,7 @@ SND_SOC_DAPM_OUTPUT("MONOOUT"), | |||
544 | SND_SOC_DAPM_OUTPUT("OUT3"), | 544 | SND_SOC_DAPM_OUTPUT("OUT3"), |
545 | }; | 545 | }; |
546 | 546 | ||
547 | static const struct snd_soc_dapm_route wm8955_intercon[] = { | 547 | static const struct snd_soc_dapm_route wm8955_dapm_routes[] = { |
548 | { "DACL", NULL, "SYSCLK" }, | 548 | { "DACL", NULL, "SYSCLK" }, |
549 | { "DACR", NULL, "SYSCLK" }, | 549 | { "DACR", NULL, "SYSCLK" }, |
550 | 550 | ||
@@ -589,21 +589,6 @@ static const struct snd_soc_dapm_route wm8955_intercon[] = { | |||
589 | { "OUT3", NULL, "OUT3 PGA" }, | 589 | { "OUT3", NULL, "OUT3 PGA" }, |
590 | }; | 590 | }; |
591 | 591 | ||
592 | static int wm8955_add_widgets(struct snd_soc_codec *codec) | ||
593 | { | ||
594 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
595 | |||
596 | snd_soc_add_controls(codec, wm8955_snd_controls, | ||
597 | ARRAY_SIZE(wm8955_snd_controls)); | ||
598 | |||
599 | snd_soc_dapm_new_controls(dapm, wm8955_dapm_widgets, | ||
600 | ARRAY_SIZE(wm8955_dapm_widgets)); | ||
601 | snd_soc_dapm_add_routes(dapm, wm8955_intercon, | ||
602 | ARRAY_SIZE(wm8955_intercon)); | ||
603 | |||
604 | return 0; | ||
605 | } | ||
606 | |||
607 | static int wm8955_hw_params(struct snd_pcm_substream *substream, | 592 | static int wm8955_hw_params(struct snd_pcm_substream *substream, |
608 | struct snd_pcm_hw_params *params, | 593 | struct snd_pcm_hw_params *params, |
609 | struct snd_soc_dai *dai) | 594 | struct snd_soc_dai *dai) |
@@ -981,7 +966,6 @@ static int wm8955_probe(struct snd_soc_codec *codec) | |||
981 | /* Bias level configuration will have done an extra enable */ | 966 | /* Bias level configuration will have done an extra enable */ |
982 | regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); | 967 | regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); |
983 | 968 | ||
984 | wm8955_add_widgets(codec); | ||
985 | return 0; | 969 | return 0; |
986 | 970 | ||
987 | err_enable: | 971 | err_enable: |
@@ -1006,6 +990,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8955 = { | |||
1006 | .suspend = wm8955_suspend, | 990 | .suspend = wm8955_suspend, |
1007 | .resume = wm8955_resume, | 991 | .resume = wm8955_resume, |
1008 | .set_bias_level = wm8955_set_bias_level, | 992 | .set_bias_level = wm8955_set_bias_level, |
993 | |||
994 | .controls = wm8955_snd_controls, | ||
995 | .num_controls = ARRAY_SIZE(wm8955_snd_controls), | ||
996 | .dapm_widgets = wm8955_dapm_widgets, | ||
997 | .num_dapm_widgets = ARRAY_SIZE(wm8955_dapm_widgets), | ||
998 | .dapm_routes = wm8955_dapm_routes, | ||
999 | .num_dapm_routes = ARRAY_SIZE(wm8955_dapm_routes), | ||
1009 | }; | 1000 | }; |
1010 | 1001 | ||
1011 | static const struct regmap_config wm8955_regmap = { | 1002 | static const struct regmap_config wm8955_regmap = { |