diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-10-10 08:34:11 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-10 11:18:12 -0400 |
commit | 93b4d790b748a3475fec2ac962904b36874f0358 (patch) | |
tree | 992fdd95bd2aa12d6422ef8b51cf9dc2be6e7723 /sound/soc/omap/osk5912.c | |
parent | 8966c2dd51909e6e3dcea099df9c501904085818 (diff) |
ASoC: osk5912: 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>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap/osk5912.c')
-rw-r--r-- | sound/soc/omap/osk5912.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c index 18f8a2db2d31..db91ccaf6c97 100644 --- a/sound/soc/omap/osk5912.c +++ b/sound/soc/omap/osk5912.c | |||
@@ -91,25 +91,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
91 | {"MICIN", NULL, "Mic Jack"}, | 91 | {"MICIN", NULL, "Mic Jack"}, |
92 | }; | 92 | }; |
93 | 93 | ||
94 | static int osk_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) | ||
95 | { | ||
96 | struct snd_soc_codec *codec = rtd->codec; | ||
97 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
98 | |||
99 | /* Add osk5912 specific widgets */ | ||
100 | snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets, | ||
101 | ARRAY_SIZE(tlv320aic23_dapm_widgets)); | ||
102 | |||
103 | /* Set up osk5912 specific audio path audio_map */ | ||
104 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
105 | |||
106 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); | ||
107 | snd_soc_dapm_enable_pin(dapm, "Line In"); | ||
108 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); | ||
109 | |||
110 | return 0; | ||
111 | } | ||
112 | |||
113 | /* Digital audio interface glue - connects codec <--> CPU */ | 94 | /* Digital audio interface glue - connects codec <--> CPU */ |
114 | static struct snd_soc_dai_link osk_dai = { | 95 | static struct snd_soc_dai_link osk_dai = { |
115 | .name = "TLV320AIC23", | 96 | .name = "TLV320AIC23", |
@@ -120,7 +101,6 @@ static struct snd_soc_dai_link osk_dai = { | |||
120 | .codec_name = "tlv320aic23-codec", | 101 | .codec_name = "tlv320aic23-codec", |
121 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | | 102 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | |
122 | SND_SOC_DAIFMT_CBM_CFM, | 103 | SND_SOC_DAIFMT_CBM_CFM, |
123 | .init = osk_tlv320aic23_init, | ||
124 | .ops = &osk_ops, | 104 | .ops = &osk_ops, |
125 | }; | 105 | }; |
126 | 106 | ||
@@ -129,6 +109,11 @@ static struct snd_soc_card snd_soc_card_osk = { | |||
129 | .name = "OSK5912", | 109 | .name = "OSK5912", |
130 | .dai_link = &osk_dai, | 110 | .dai_link = &osk_dai, |
131 | .num_links = 1, | 111 | .num_links = 1, |
112 | |||
113 | .dapm_widgets = tlv320aic23_dapm_widgets, | ||
114 | .num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets), | ||
115 | .dapm_routes = audio_map, | ||
116 | .num_dapm_routes = ARRAY_SIZE(audio_map), | ||
132 | }; | 117 | }; |
133 | 118 | ||
134 | static struct platform_device *osk_snd_device; | 119 | static struct platform_device *osk_snd_device; |