]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00209739-5 WM8962: check DMIC status
authorGary Zhang <b13634@freescale.com>
Tue, 22 May 2012 03:03:41 +0000 (11:03 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:11:56 +0000 (14:11 +0200)
if there are no amic_detect pin, by checking
DMIC pin status to get to know which mic is used

Signed-off-by: Gary Zhang <b13634@freescale.com>
sound/soc/imx/imx-wm8962.c

index 354aae434055e68aa7c741d6cd78fe09fb209a98..aa3122f6d765e6f65ad5a74a209bfb7c8fcd85b9 100644 (file)
@@ -262,7 +262,7 @@ static void amic_detect_handler(struct work_struct *work)
 
        if (priv->amic_status == 0)
                snprintf(buf, 32, "STATE=%d", 2);
-    else
+       else
                snprintf(buf, 32, "STATE=%d", 0);
 
        envp[0] = "NAME=amic";
@@ -369,7 +369,8 @@ static int imx_wm8962_init(struct snd_soc_pcm_runtime *rtd)
                        snd_soc_dapm_nc_pin(&codec->dapm, "DMIC");
                else
                        snd_soc_dapm_enable_pin(&codec->dapm, "DMIC");
-       }
+       } else if (!snd_soc_dapm_get_pin_status(&codec->dapm, "DMICDAT"))
+               snd_soc_dapm_nc_pin(&codec->dapm, "DMIC");
 
        return 0;
 }