mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 13:21:45 +00:00
ASoC: simple-card: move hp and mic detection to soc_card probe
This patch moves headphone and microphone detection to probe() of snd_soc_card from init() of snd_soc_dai_link. This is because init() is called (and an input device /dev/input/eventX is created too) twice or above if simple card has two or more DAI links. Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
62c2c9fcac
commit
8d1bd113a1
1 changed files with 17 additions and 8 deletions
|
@ -149,14 +149,6 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = asoc_simple_card_init_hp(rtd->card, &priv->hp_jack, PREFIX);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = asoc_simple_card_init_mic(rtd->card, &priv->mic_jack, PREFIX);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,6 +342,22 @@ card_parse_end:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int asoc_simple_soc_card_probe(struct snd_soc_card *card)
|
||||||
|
{
|
||||||
|
struct simple_card_data *priv = snd_soc_card_get_drvdata(card);
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = asoc_simple_card_init_hp(card, &priv->hp_jack, PREFIX);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = asoc_simple_card_init_mic(card, &priv->mic_jack, PREFIX);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int asoc_simple_card_probe(struct platform_device *pdev)
|
static int asoc_simple_card_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct simple_card_data *priv;
|
struct simple_card_data *priv;
|
||||||
|
@ -385,6 +393,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
|
||||||
card->dev = dev;
|
card->dev = dev;
|
||||||
card->dai_link = priv->dai_link;
|
card->dai_link = priv->dai_link;
|
||||||
card->num_links = num;
|
card->num_links = num;
|
||||||
|
card->probe = asoc_simple_soc_card_probe;
|
||||||
|
|
||||||
if (np && of_device_is_available(np)) {
|
if (np && of_device_is_available(np)) {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue