aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8903.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-27 08:43:45 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-29 18:14:53 -0400
commitecd015127813c7893f6900cf54c6362b26d8ff90 (patch)
treea2b8abe4f8b6d4335351be6253321cca2a26031e /sound/soc/codecs/wm8903.c
parent60e627b4530819a3c67434ef6eafd3e702ce6572 (diff)
ASoC: Convert WM8903 to table based DAPM setup
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/codecs/wm8903.c')
-rw-r--r--sound/soc/codecs/wm8903.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index ae1cadfae84c..a739e09a8309 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -926,7 +926,7 @@ SND_SOC_DAPM_SUPPLY("CLK_DSP", WM8903_CLOCK_RATES_2, 1, 0, NULL, 0),
926SND_SOC_DAPM_SUPPLY("CLK_SYS", WM8903_CLOCK_RATES_2, 2, 0, NULL, 0), 926SND_SOC_DAPM_SUPPLY("CLK_SYS", WM8903_CLOCK_RATES_2, 2, 0, NULL, 0),
927}; 927};
928 928
929static const struct snd_soc_dapm_route intercon[] = { 929static const struct snd_soc_dapm_route wm8903_intercon[] = {
930 930
931 { "CLK_DSP", NULL, "CLK_SYS" }, 931 { "CLK_DSP", NULL, "CLK_SYS" },
932 { "Mic Bias", NULL, "CLK_SYS" }, 932 { "Mic Bias", NULL, "CLK_SYS" },
@@ -1079,17 +1079,6 @@ static const struct snd_soc_dapm_route intercon[] = {
1079 { "Right Line Output PGA", NULL, "Charge Pump" }, 1079 { "Right Line Output PGA", NULL, "Charge Pump" },
1080}; 1080};
1081 1081
1082static int wm8903_add_widgets(struct snd_soc_codec *codec)
1083{
1084 struct snd_soc_dapm_context *dapm = &codec->dapm;
1085
1086 snd_soc_dapm_new_controls(dapm, wm8903_dapm_widgets,
1087 ARRAY_SIZE(wm8903_dapm_widgets));
1088 snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
1089
1090 return 0;
1091}
1092
1093static int wm8903_set_bias_level(struct snd_soc_codec *codec, 1082static int wm8903_set_bias_level(struct snd_soc_codec *codec,
1094 enum snd_soc_bias_level level) 1083 enum snd_soc_bias_level level)
1095{ 1084{
@@ -2020,7 +2009,6 @@ static int wm8903_probe(struct snd_soc_codec *codec)
2020 2009
2021 snd_soc_add_controls(codec, wm8903_snd_controls, 2010 snd_soc_add_controls(codec, wm8903_snd_controls,
2022 ARRAY_SIZE(wm8903_snd_controls)); 2011 ARRAY_SIZE(wm8903_snd_controls));
2023 wm8903_add_widgets(codec);
2024 2012
2025 wm8903_init_gpio(codec); 2013 wm8903_init_gpio(codec);
2026 2014
@@ -2046,6 +2034,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8903 = {
2046 .reg_cache_default = wm8903_reg_defaults, 2034 .reg_cache_default = wm8903_reg_defaults,
2047 .volatile_register = wm8903_volatile_register, 2035 .volatile_register = wm8903_volatile_register,
2048 .seq_notifier = wm8903_seq_notifier, 2036 .seq_notifier = wm8903_seq_notifier,
2037 .dapm_widgets = wm8903_dapm_widgets,
2038 .num_dapm_widgets = ARRAY_SIZE(wm8903_dapm_widgets),
2039 .dapm_routes = wm8903_intercon,
2040 .num_dapm_routes = ARRAY_SIZE(wm8903_intercon),
2049}; 2041};
2050 2042
2051#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 2043#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)