diff options
author | Lu Guanqun <guanqun.lu@intel.com> | 2011-03-30 09:53:07 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-03-30 17:22:24 -0400 |
commit | b63c963da21d05f40f20de0a586143922bfa19d9 (patch) | |
tree | 836cc4cc3d24dbbb8799cb708d479fb6a870c7ef /sound/soc/codecs | |
parent | a7dca707a73ca700124e04372fc91334d898e6a6 (diff) |
ASoC: Use data based init for ak4535 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>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/ak4535.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index 8b38739c88f8..e1a214ee757f 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c | |||
@@ -230,7 +230,7 @@ static const struct snd_soc_dapm_widget ak4535_dapm_widgets[] = { | |||
230 | SND_SOC_DAPM_INPUT("AIN"), | 230 | SND_SOC_DAPM_INPUT("AIN"), |
231 | }; | 231 | }; |
232 | 232 | ||
233 | static const struct snd_soc_dapm_route audio_map[] = { | 233 | static const struct snd_soc_dapm_route ak4535_audio_map[] = { |
234 | /*stereo mixer */ | 234 | /*stereo mixer */ |
235 | {"Stereo Mixer", "Playback Switch", "DAC"}, | 235 | {"Stereo Mixer", "Playback Switch", "DAC"}, |
236 | {"Stereo Mixer", "Mic Sidetone Switch", "Mic"}, | 236 | {"Stereo Mixer", "Mic Sidetone Switch", "Mic"}, |
@@ -287,17 +287,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
287 | {"Input Mixer", "Aux Capture Switch", "Aux In"}, | 287 | {"Input Mixer", "Aux Capture Switch", "Aux In"}, |
288 | }; | 288 | }; |
289 | 289 | ||
290 | static int ak4535_add_widgets(struct snd_soc_codec *codec) | ||
291 | { | ||
292 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
293 | |||
294 | snd_soc_dapm_new_controls(dapm, ak4535_dapm_widgets, | ||
295 | ARRAY_SIZE(ak4535_dapm_widgets)); | ||
296 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
297 | |||
298 | return 0; | ||
299 | } | ||
300 | |||
301 | static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai, | 290 | static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai, |
302 | int clk_id, unsigned int freq, int dir) | 291 | int clk_id, unsigned int freq, int dir) |
303 | { | 292 | { |
@@ -457,8 +446,6 @@ static int ak4535_probe(struct snd_soc_codec *codec) | |||
457 | 446 | ||
458 | snd_soc_add_controls(codec, ak4535_snd_controls, | 447 | snd_soc_add_controls(codec, ak4535_snd_controls, |
459 | ARRAY_SIZE(ak4535_snd_controls)); | 448 | ARRAY_SIZE(ak4535_snd_controls)); |
460 | ak4535_add_widgets(codec); | ||
461 | |||
462 | return 0; | 449 | return 0; |
463 | } | 450 | } |
464 | 451 | ||
@@ -480,6 +467,10 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4535 = { | |||
480 | .reg_cache_size = ARRAY_SIZE(ak4535_reg), | 467 | .reg_cache_size = ARRAY_SIZE(ak4535_reg), |
481 | .reg_word_size = sizeof(u8), | 468 | .reg_word_size = sizeof(u8), |
482 | .reg_cache_default = ak4535_reg, | 469 | .reg_cache_default = ak4535_reg, |
470 | .dapm_widgets = ak4535_dapm_widgets, | ||
471 | .num_dapm_widgets = ARRAY_SIZE(ak4535_dapm_widgets), | ||
472 | .dapm_routes = ak4535_audio_map, | ||
473 | .num_dapm_routes = ARRAY_SIZE(ak4535_audio_map), | ||
483 | }; | 474 | }; |
484 | 475 | ||
485 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 476 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |