From d89f3a340fd577174052925ab484b306a79bc59b Mon Sep 17 00:00:00 2001 From: Shengjiu Wang <shengjiu.wang@nxp.com> Date: Thu, 27 Sep 2018 11:53:36 +0800 Subject: [PATCH] MLK-19733-3: ASoC: imx-wm8958: Remove duplicate jack kcontrol We first add the jack kcontrol in commit c2c7959e3af3 ("MLK-11479-09 pulseaudio5.0 mute Headphone volume when Headphone plugged") After that there is change in kernel by commit f63e8581e277 ("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: Shengjiu Wang <shengjiu.wang@nxp.com> (cherry picked from commit 696ff858bb3a484c2ec105c62b29f39e0e61905b) Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com> Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com> --- sound/soc/fsl/imx-wm8958.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sound/soc/fsl/imx-wm8958.c b/sound/soc/fsl/imx-wm8958.c index a8343d1cbc2122..210f6662eb098f 100644 --- a/sound/soc/fsl/imx-wm8958.c +++ b/sound/soc/fsl/imx-wm8958.c @@ -46,8 +46,6 @@ struct imx_priv { int hp_active_low; struct snd_soc_codec *codec; struct platform_device *pdev; - struct snd_kcontrol *headphone_kctl; - struct snd_card *snd_card; }; static struct imx_priv card_priv; @@ -89,12 +87,10 @@ static int hpjack_status_check(void *data) snprintf(buf, 32, "STATE=%d", 2); snd_soc_dapm_disable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk"); ret = imx_hp_jack_gpio.report; - snd_kctl_jack_report(priv->snd_card, priv->headphone_kctl, 1); } else { snprintf(buf, 32, "STATE=%d", 0); snd_soc_dapm_enable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk"); ret = 0; - snd_kctl_jack_report(priv->snd_card, priv->headphone_kctl, 0); } envp[0] = "NAME=headphone"; @@ -529,13 +525,6 @@ static int imx_wm8958_probe(struct platform_device *pdev) 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); if (gpio_is_valid(priv->hp_gpio)) { -- GitLab