diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-21 10:46:51 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-21 13:07:18 -0500 |
commit | 56a926dd72bd836f71216ba5b034adb7f48e80e9 (patch) | |
tree | 6810cfe6569be1e86237b3d4c8ac5fd6b562996e | |
parent | afe713089a5cce680ff76fab554c42d5cbb577d0 (diff) |
ASoC: Convert WM8753 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/wm8753.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 3a629d0d690e..13156c836c9a 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -486,7 +486,7 @@ SND_SOC_DAPM_INPUT("MIC2"), | |||
486 | SND_SOC_DAPM_VMID("VREF"), | 486 | SND_SOC_DAPM_VMID("VREF"), |
487 | }; | 487 | }; |
488 | 488 | ||
489 | static const struct snd_soc_dapm_route audio_map[] = { | 489 | static const struct snd_soc_dapm_route wm8753_dapm_routes[] = { |
490 | /* left mixer */ | 490 | /* left mixer */ |
491 | {"Left Mixer", "Left Playback Switch", "Left DAC"}, | 491 | {"Left Mixer", "Left Playback Switch", "Left DAC"}, |
492 | {"Left Mixer", "Voice Playback Switch", "Voice DAC"}, | 492 | {"Left Mixer", "Voice Playback Switch", "Voice DAC"}, |
@@ -640,17 +640,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
640 | {"ACOP", NULL, "ALC Mixer"}, | 640 | {"ACOP", NULL, "ALC Mixer"}, |
641 | }; | 641 | }; |
642 | 642 | ||
643 | static int wm8753_add_widgets(struct snd_soc_codec *codec) | ||
644 | { | ||
645 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
646 | |||
647 | snd_soc_dapm_new_controls(dapm, wm8753_dapm_widgets, | ||
648 | ARRAY_SIZE(wm8753_dapm_widgets)); | ||
649 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
650 | |||
651 | return 0; | ||
652 | } | ||
653 | |||
654 | /* PLL divisors */ | 643 | /* PLL divisors */ |
655 | struct _pll_div { | 644 | struct _pll_div { |
656 | u32 div2:1; | 645 | u32 div2:1; |
@@ -1467,10 +1456,6 @@ static int wm8753_probe(struct snd_soc_codec *codec) | |||
1467 | snd_soc_update_bits(codec, WM8753_LINVOL, 0x0100, 0x0100); | 1456 | snd_soc_update_bits(codec, WM8753_LINVOL, 0x0100, 0x0100); |
1468 | snd_soc_update_bits(codec, WM8753_RINVOL, 0x0100, 0x0100); | 1457 | snd_soc_update_bits(codec, WM8753_RINVOL, 0x0100, 0x0100); |
1469 | 1458 | ||
1470 | snd_soc_add_controls(codec, wm8753_snd_controls, | ||
1471 | ARRAY_SIZE(wm8753_snd_controls)); | ||
1472 | wm8753_add_widgets(codec); | ||
1473 | |||
1474 | return 0; | 1459 | return 0; |
1475 | } | 1460 | } |
1476 | 1461 | ||
@@ -1492,6 +1477,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8753 = { | |||
1492 | .reg_cache_size = ARRAY_SIZE(wm8753_reg), | 1477 | .reg_cache_size = ARRAY_SIZE(wm8753_reg), |
1493 | .reg_word_size = sizeof(u16), | 1478 | .reg_word_size = sizeof(u16), |
1494 | .reg_cache_default = wm8753_reg, | 1479 | .reg_cache_default = wm8753_reg, |
1480 | |||
1481 | .controls = wm8753_snd_controls, | ||
1482 | .num_controls = ARRAY_SIZE(wm8753_snd_controls), | ||
1483 | .dapm_widgets = wm8753_dapm_widgets, | ||
1484 | .num_dapm_widgets = ARRAY_SIZE(wm8753_dapm_widgets), | ||
1485 | .dapm_routes = wm8753_dapm_routes, | ||
1486 | .num_dapm_routes = ARRAY_SIZE(wm8753_dapm_routes), | ||
1495 | }; | 1487 | }; |
1496 | 1488 | ||
1497 | static const struct of_device_id wm8753_of_match[] = { | 1489 | static const struct of_device_id wm8753_of_match[] = { |