aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-03 12:21:43 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-03 16:35:16 -0500
commit0f185e3f8b06c1d0fd817af3d4c03f9c21d776e9 (patch)
tree69f306219566c683d5c798192341676200b744ab /sound/soc
parent0e62780f5f27f24a30d5a08ed731088115e1fe80 (diff)
ASoC: Convert WM8750 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm8750.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index fa5732d78225..e4c50ce7d9c0 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -301,7 +301,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
301 SND_SOC_DAPM_INPUT("RINPUT3"), 301 SND_SOC_DAPM_INPUT("RINPUT3"),
302}; 302};
303 303
304static const struct snd_soc_dapm_route audio_map[] = { 304static const struct snd_soc_dapm_route wm8750_dapm_routes[] = {
305 /* left mixer */ 305 /* left mixer */
306 {"Left Mixer", "Playback Switch", "Left DAC"}, 306 {"Left Mixer", "Playback Switch", "Left DAC"},
307 {"Left Mixer", "Left Bypass Switch", "Left Line Mux"}, 307 {"Left Mixer", "Left Bypass Switch", "Left Line Mux"},
@@ -395,17 +395,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
395 {"Right ADC", NULL, "Right ADC Mux"}, 395 {"Right ADC", NULL, "Right ADC Mux"},
396}; 396};
397 397
398static int wm8750_add_widgets(struct snd_soc_codec *codec)
399{
400 struct snd_soc_dapm_context *dapm = &codec->dapm;
401
402 snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets,
403 ARRAY_SIZE(wm8750_dapm_widgets));
404 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
405
406 return 0;
407}
408
409struct _coeff_div { 398struct _coeff_div {
410 u32 mclk; 399 u32 mclk;
411 u32 rate; 400 u32 rate;
@@ -708,9 +697,6 @@ static int wm8750_probe(struct snd_soc_codec *codec)
708 snd_soc_update_bits(codec, WM8750_LINVOL, 0x0100, 0x0100); 697 snd_soc_update_bits(codec, WM8750_LINVOL, 0x0100, 0x0100);
709 snd_soc_update_bits(codec, WM8750_RINVOL, 0x0100, 0x0100); 698 snd_soc_update_bits(codec, WM8750_RINVOL, 0x0100, 0x0100);
710 699
711 snd_soc_add_controls(codec, wm8750_snd_controls,
712 ARRAY_SIZE(wm8750_snd_controls));
713 wm8750_add_widgets(codec);
714 return ret; 700 return ret;
715} 701}
716 702
@@ -729,6 +715,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8750 = {
729 .reg_cache_size = ARRAY_SIZE(wm8750_reg), 715 .reg_cache_size = ARRAY_SIZE(wm8750_reg),
730 .reg_word_size = sizeof(u16), 716 .reg_word_size = sizeof(u16),
731 .reg_cache_default = wm8750_reg, 717 .reg_cache_default = wm8750_reg,
718
719 .controls = wm8750_snd_controls,
720 .num_controls = ARRAY_SIZE(wm8750_snd_controls),
721 .dapm_widgets = wm8750_dapm_widgets,
722 .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets),
723 .dapm_routes = wm8750_dapm_routes,
724 .num_dapm_routes = ARRAY_SIZE(wm8750_dapm_routes),
732}; 725};
733 726
734static const struct of_device_id wm8750_of_match[] = { 727static const struct of_device_id wm8750_of_match[] = {