summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Chan <B18700@freescale.com>2014-08-07 18:09:19 +0800
committerPeng Fushi <fushi.peng@freescale.com>2014-08-28 16:56:46 +0800
commitf0dcf71f384aeb99f4b2450c79a64bd92387a20b (patch)
tree9bb325882bfcfc2c1b6ce52fed9ca90cce8f9304
parent83fa00ac17c8b978e242d3c8b74c01222b1fffff (diff)
ENGR00326120-1 ASoC: imx-wm8962: fix add route error for mono speaker configuration
In WM8962 mono speaker configuration, "add route SPKOUTL->Ext Spk" error will occur when initializing the codec. This is because in mono speaker configuration, there is no widget naming with "SPKOUTL". Fix this error by using the correct name "SPKOUT" for mono speaker configuration. Signed-off-by: Peter Chan <B18700@freescale.com>
-rw-r--r--sound/soc/imx/imx-wm8962.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sound/soc/imx/imx-wm8962.c b/sound/soc/imx/imx-wm8962.c
index 73d05831dff6..c002cba26785 100644
--- a/sound/soc/imx/imx-wm8962.c
+++ b/sound/soc/imx/imx-wm8962.c
@@ -35,6 +35,7 @@
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/jack.h>
+#include <sound/wm8962.h>
#include <mach/dma.h>
#include <mach/clock.h>
#include <mach/audmux.h>
@@ -386,6 +387,20 @@ static const struct snd_soc_dapm_route audio_map[] = {
};
+static const struct snd_soc_dapm_route mono_spk_audio_map[] = {
+ { "Headphone Jack", NULL, "HPOUTL" },
+ { "Headphone Jack", NULL, "HPOUTR" },
+
+ { "Ext Spk", NULL, "SPKOUT" },
+
+ { "MICBIAS", NULL, "AMIC" },
+ { "IN3R", NULL, "MICBIAS" },
+
+ { "DMIC", NULL, "MICBIAS" },
+ { "DMICDAT", NULL, "DMIC" },
+
+};
+
static ssize_t show_headphone(struct device_driver *dev, char *buf)
{
struct imx_priv *priv = &card_priv;
@@ -447,6 +462,7 @@ static int imx_wm8962_init(struct snd_soc_pcm_runtime *rtd)
struct imx_priv *priv = &card_priv;
struct platform_device *pdev = priv->pdev;
struct mxc_audio_platform_data *plat = pdev->dev.platform_data;
+ struct wm8962_pdata *pdata = dev_get_platdata(codec->dev);
int ret = 0;
gcodec = rtd->codec;
@@ -456,7 +472,12 @@ static int imx_wm8962_init(struct snd_soc_pcm_runtime *rtd)
ARRAY_SIZE(imx_dapm_widgets));
/* Set up imx specific audio path audio_map */
- snd_soc_dapm_add_routes(&codec->dapm, audio_map, ARRAY_SIZE(audio_map));
+ if (pdata != NULL && pdata->spk_mono)
+ snd_soc_dapm_add_routes(&codec->dapm, mono_spk_audio_map,
+ ARRAY_SIZE(mono_spk_audio_map));
+ else
+ snd_soc_dapm_add_routes(&codec->dapm, audio_map,
+ ARRAY_SIZE(audio_map));
snd_soc_dapm_enable_pin(&codec->dapm, "Headphone Jack");
snd_soc_dapm_enable_pin(&codec->dapm, "AMIC");