diff options
author | Lu Guanqun <guanqun.lu@intel.com> | 2011-03-30 09:53:09 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-03-30 17:21:39 -0400 |
commit | 51fb1a8704f6bccfcf5248f9edc2751c272fbdf2 (patch) | |
tree | f25c3dcf062bde55734fb8870ab1665376c04b9a | |
parent | fc3b9230cc2cdbcbef37953fe8cf5af0977e7a95 (diff) |
ASoC: Use data based init for cx20442 DAPM
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/cx20442.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index 0bb424af956f..d68ea532cc7f 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c | |||
@@ -86,18 +86,6 @@ static const struct snd_soc_dapm_route cx20442_audio_map[] = { | |||
86 | {"ADC", NULL, "Input Mixer"}, | 86 | {"ADC", NULL, "Input Mixer"}, |
87 | }; | 87 | }; |
88 | 88 | ||
89 | static int cx20442_add_widgets(struct snd_soc_codec *codec) | ||
90 | { | ||
91 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
92 | |||
93 | snd_soc_dapm_new_controls(dapm, cx20442_dapm_widgets, | ||
94 | ARRAY_SIZE(cx20442_dapm_widgets)); | ||
95 | snd_soc_dapm_add_routes(dapm, cx20442_audio_map, | ||
96 | ARRAY_SIZE(cx20442_audio_map)); | ||
97 | |||
98 | return 0; | ||
99 | } | ||
100 | |||
101 | static unsigned int cx20442_read_reg_cache(struct snd_soc_codec *codec, | 89 | static unsigned int cx20442_read_reg_cache(struct snd_soc_codec *codec, |
102 | unsigned int reg) | 90 | unsigned int reg) |
103 | { | 91 | { |
@@ -344,8 +332,6 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec) | |||
344 | return -ENOMEM; | 332 | return -ENOMEM; |
345 | snd_soc_codec_set_drvdata(codec, cx20442); | 333 | snd_soc_codec_set_drvdata(codec, cx20442); |
346 | 334 | ||
347 | cx20442_add_widgets(codec); | ||
348 | |||
349 | cx20442->control_data = NULL; | 335 | cx20442->control_data = NULL; |
350 | codec->hw_write = NULL; | 336 | codec->hw_write = NULL; |
351 | codec->card->pop_time = 0; | 337 | codec->card->pop_time = 0; |
@@ -377,6 +363,10 @@ static struct snd_soc_codec_driver cx20442_codec_dev = { | |||
377 | .reg_word_size = sizeof(u8), | 363 | .reg_word_size = sizeof(u8), |
378 | .read = cx20442_read_reg_cache, | 364 | .read = cx20442_read_reg_cache, |
379 | .write = cx20442_write, | 365 | .write = cx20442_write, |
366 | .dapm_widgets = cx20442_dapm_widgets, | ||
367 | .num_dapm_widgets = ARRAY_SIZE(cx20442_dapm_widgets), | ||
368 | .dapm_routes = cx20442_audio_map, | ||
369 | .num_dapm_routes = ARRAY_SIZE(cx20442_audio_map), | ||
380 | }; | 370 | }; |
381 | 371 | ||
382 | static int cx20442_platform_probe(struct platform_device *pdev) | 372 | static int cx20442_platform_probe(struct platform_device *pdev) |