提交 93b4d790 编写于 作者: P Peter Ujfalusi 提交者: Mark Brown

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: NPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 8966c2dd
...@@ -91,25 +91,6 @@ static const struct snd_soc_dapm_route audio_map[] = { ...@@ -91,25 +91,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
{"MICIN", NULL, "Mic Jack"}, {"MICIN", NULL, "Mic Jack"},
}; };
static int osk_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
/* Add osk5912 specific widgets */
snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
ARRAY_SIZE(tlv320aic23_dapm_widgets));
/* Set up osk5912 specific audio path audio_map */
snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
snd_soc_dapm_enable_pin(dapm, "Line In");
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
return 0;
}
/* Digital audio interface glue - connects codec <--> CPU */ /* Digital audio interface glue - connects codec <--> CPU */
static struct snd_soc_dai_link osk_dai = { static struct snd_soc_dai_link osk_dai = {
.name = "TLV320AIC23", .name = "TLV320AIC23",
...@@ -120,7 +101,6 @@ static struct snd_soc_dai_link osk_dai = { ...@@ -120,7 +101,6 @@ static struct snd_soc_dai_link osk_dai = {
.codec_name = "tlv320aic23-codec", .codec_name = "tlv320aic23-codec",
.dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBM_CFM, SND_SOC_DAIFMT_CBM_CFM,
.init = osk_tlv320aic23_init,
.ops = &osk_ops, .ops = &osk_ops,
}; };
...@@ -129,6 +109,11 @@ static struct snd_soc_card snd_soc_card_osk = { ...@@ -129,6 +109,11 @@ static struct snd_soc_card snd_soc_card_osk = {
.name = "OSK5912", .name = "OSK5912",
.dai_link = &osk_dai, .dai_link = &osk_dai,
.num_links = 1, .num_links = 1,
.dapm_widgets = tlv320aic23_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets),
.dapm_routes = audio_map,
.num_dapm_routes = ARRAY_SIZE(audio_map),
}; };
static struct platform_device *osk_snd_device; static struct platform_device *osk_snd_device;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册