Skip to content
Snippets Groups Projects
Commit d89f3a34 authored by Shengjiu Wang's avatar Shengjiu Wang Committed by Leonard Crestez
Browse files

MLK-19733-3: ASoC: imx-wm8958: Remove duplicate jack kcontrol


We first add the jack kcontrol in commit c2c7959e ("MLK-11479-09
pulseaudio5.0 mute Headphone volume when Headphone plugged")

After that there is change in kernel by commit f63e8581 ("ASoC: jack:
create kctls according to jack pins info"), the jack kcontrol will be
created with snd_soc_jack_add_pins.

So our change for jack kcontrol in machine driver is not need now, for
driver already call imx_wm8958_gpio_init -> snd_soc_card_jack_new ->
snd_soc_jack_add_pins. otherwise the jack kcontrol will be created twice.

Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 696ff858bb3a484c2ec105c62b29f39e0e61905b)
Signed-off-by: default avatarVipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: default avatarSrikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
parent 1343b528
No related branches found
No related tags found
No related merge requests found
...@@ -46,8 +46,6 @@ struct imx_priv { ...@@ -46,8 +46,6 @@ struct imx_priv {
int hp_active_low; int hp_active_low;
struct snd_soc_codec *codec; struct snd_soc_codec *codec;
struct platform_device *pdev; struct platform_device *pdev;
struct snd_kcontrol *headphone_kctl;
struct snd_card *snd_card;
}; };
static struct imx_priv card_priv; static struct imx_priv card_priv;
...@@ -89,12 +87,10 @@ static int hpjack_status_check(void *data) ...@@ -89,12 +87,10 @@ static int hpjack_status_check(void *data)
snprintf(buf, 32, "STATE=%d", 2); snprintf(buf, 32, "STATE=%d", 2);
snd_soc_dapm_disable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk"); snd_soc_dapm_disable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk");
ret = imx_hp_jack_gpio.report; ret = imx_hp_jack_gpio.report;
snd_kctl_jack_report(priv->snd_card, priv->headphone_kctl, 1);
} else { } else {
snprintf(buf, 32, "STATE=%d", 0); snprintf(buf, 32, "STATE=%d", 0);
snd_soc_dapm_enable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk"); snd_soc_dapm_enable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk");
ret = 0; ret = 0;
snd_kctl_jack_report(priv->snd_card, priv->headphone_kctl, 0);
} }
envp[0] = "NAME=headphone"; envp[0] = "NAME=headphone";
...@@ -529,13 +525,6 @@ static int imx_wm8958_probe(struct platform_device *pdev) ...@@ -529,13 +525,6 @@ static int imx_wm8958_probe(struct platform_device *pdev)
goto fail; goto fail;
} }
priv->snd_card = data->card.snd_card;
priv->headphone_kctl = snd_kctl_jack_new("Headphone", NULL);
ret = snd_ctl_add(data->card.snd_card, priv->headphone_kctl);
if (ret)
goto fail;
ret = imx_wm8958_gpio_init(&data->card); ret = imx_wm8958_gpio_init(&data->card);
if (gpio_is_valid(priv->hp_gpio)) { if (gpio_is_valid(priv->hp_gpio)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment