diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-10-10 08:34:09 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-10 11:18:11 -0400 |
commit | d2266025ea26b6f3f8f93da6fad129541c82bd7c (patch) | |
tree | 291e5da282143637142b6d841bfb14d45bc9ebb2 /sound | |
parent | d8058469606bfd1b0d6fca830a997ba06f83e5dc (diff) |
ASoC: am3517evm: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core. With this change we do not need the init function
since the remaining snd_soc_dapm_enable_pin calls are
not needed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Anuj Aggarwal <anuj.aggarwal@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/omap/am3517evm.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c index f5a4d65b2f60..8da55e916451 100644 --- a/sound/soc/omap/am3517evm.c +++ b/sound/soc/omap/am3517evm.c | |||
@@ -90,26 +90,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
90 | {"MICIN", NULL, "Mic In"}, | 90 | {"MICIN", NULL, "Mic In"}, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static int am3517evm_aic23_init(struct snd_soc_pcm_runtime *rtd) | ||
94 | { | ||
95 | struct snd_soc_codec *codec = rtd->codec; | ||
96 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
97 | |||
98 | /* Add am3517-evm specific widgets */ | ||
99 | snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets, | ||
100 | ARRAY_SIZE(tlv320aic23_dapm_widgets)); | ||
101 | |||
102 | /* Set up davinci-evm specific audio path audio_map */ | ||
103 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
104 | |||
105 | /* always connected */ | ||
106 | snd_soc_dapm_enable_pin(dapm, "Line Out"); | ||
107 | snd_soc_dapm_enable_pin(dapm, "Line In"); | ||
108 | snd_soc_dapm_enable_pin(dapm, "Mic In"); | ||
109 | |||
110 | return 0; | ||
111 | } | ||
112 | |||
113 | /* Digital audio interface glue - connects codec <--> CPU */ | 93 | /* Digital audio interface glue - connects codec <--> CPU */ |
114 | static struct snd_soc_dai_link am3517evm_dai = { | 94 | static struct snd_soc_dai_link am3517evm_dai = { |
115 | .name = "TLV320AIC23", | 95 | .name = "TLV320AIC23", |
@@ -120,7 +100,6 @@ static struct snd_soc_dai_link am3517evm_dai = { | |||
120 | .codec_name = "tlv320aic23-codec.2-001a", | 100 | .codec_name = "tlv320aic23-codec.2-001a", |
121 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | | 101 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | |
122 | SND_SOC_DAIFMT_CBM_CFM, | 102 | SND_SOC_DAIFMT_CBM_CFM, |
123 | .init = am3517evm_aic23_init, | ||
124 | .ops = &am3517evm_ops, | 103 | .ops = &am3517evm_ops, |
125 | }; | 104 | }; |
126 | 105 | ||
@@ -129,6 +108,11 @@ static struct snd_soc_card snd_soc_am3517evm = { | |||
129 | .name = "am3517evm", | 108 | .name = "am3517evm", |
130 | .dai_link = &am3517evm_dai, | 109 | .dai_link = &am3517evm_dai, |
131 | .num_links = 1, | 110 | .num_links = 1, |
111 | |||
112 | .dapm_widgets = tlv320aic23_dapm_widgets, | ||
113 | .num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets), | ||
114 | .dapm_routes = audio_map, | ||
115 | .num_dapm_routes = ARRAY_SIZE(audio_map), | ||
132 | }; | 116 | }; |
133 | 117 | ||
134 | static struct platform_device *am3517evm_snd_device; | 118 | static struct platform_device *am3517evm_snd_device; |