summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNitin Garg <nitin.garg@freescale.com>2012-10-18 19:08:40 -0500
committerNitin Garg <nitin.garg@freescale.com>2012-10-18 19:20:26 -0500
commiteec23c400e5c39ae338b9112031a302230220294 (patch)
tree5fdaf2380778e78b88838a7f467b24bd6c048200 /sound
parent9034a8901397e22523530adafa4c1256ab15fb12 (diff)
ENGR00230334-2: Port 3.0.35 linux kernel to iMX53 SMD for Jellybean bringup.
Port 3.0.35 linux kernel to iMX53 SMD for Jellybean bringup. Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/imx/Kconfig2
-rw-r--r--sound/soc/imx/imx-hdmi-dma.c11
-rw-r--r--sound/soc/imx/imx-sgtl5000.c30
3 files changed, 36 insertions, 7 deletions
diff --git a/sound/soc/imx/Kconfig b/sound/soc/imx/Kconfig
index 72d85503d495..7fb135ab70f1 100644
--- a/sound/soc/imx/Kconfig
+++ b/sound/soc/imx/Kconfig
@@ -52,7 +52,7 @@ config SND_SOC_PHYCORE_AC97
config SND_SOC_IMX_SGTL5000
tristate "SoC Audio support for i.MX boards with sgtl5000"
- depends on I2C && (MACH_MX35_3DS || MACH_MX51_BABBAGE \
+ depends on I2C && (MACH_MX35_3DS || MACH_MX51_BABBAGE || MACH_MX53_SMD \
|| MACH_MX6Q_SABRELITE || MACH_MX6Q_ARM2)
select SND_SOC_SGTL5000
select SND_MXC_SOC_MX2
diff --git a/sound/soc/imx/imx-hdmi-dma.c b/sound/soc/imx/imx-hdmi-dma.c
index 342f9c85f481..a7f9e12af734 100644
--- a/sound/soc/imx/imx-hdmi-dma.c
+++ b/sound/soc/imx/imx-hdmi-dma.c
@@ -577,6 +577,7 @@ static void hdmi_dma_mmap_copy(struct snd_pcm_substream *substream,
}
}
+#ifdef CONFIG_ARCH_MX6
static void hdmi_sdma_isr(void *data)
{
struct imx_hdmi_dma_runtime_data *rtd = data;
@@ -637,7 +638,7 @@ static void hdmi_sdma_isr(void *data)
return;
}
-
+#endif
static irqreturn_t hdmi_dma_isr(int irq, void *dev_id)
{
@@ -925,6 +926,7 @@ static int hdmi_dma_copy(struct snd_pcm_substream *substream, int channel,
return 0;
}
+#ifdef CONFIG_ARCH_MX6
static bool hdmi_filter(struct dma_chan *chan, void *param)
{
@@ -1020,8 +1022,7 @@ static int hdmi_sdma_config(struct imx_hdmi_dma_runtime_data *params)
return 0;
}
-
-
+#endif
static int hdmi_dma_hw_free(struct snd_pcm_substream *substream)
{
@@ -1039,7 +1040,9 @@ static int hdmi_dma_hw_params(struct snd_pcm_substream *substream,
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct imx_hdmi_dma_runtime_data *rtd = runtime->private_data;
+#ifdef CONFIG_ARCH_MX6
int err;
+#endif
rtd->buffer_bytes = params_buffer_bytes(params);
rtd->periods = params_periods(params);
@@ -1070,6 +1073,7 @@ static int hdmi_dma_hw_params(struct snd_pcm_substream *substream,
}
rtd->dma_period_bytes = rtd->period_bytes * rtd->buffer_ratio;
+#ifdef CONFIG_ARCH_MX6
if (hdmi_SDMA_check()) {
rtd->sdma_params.buffer_num = rtd->periods;
rtd->sdma_params.phyaddr = rtd->phy_hdmi_sdma_t;
@@ -1087,6 +1091,7 @@ static int hdmi_dma_hw_params(struct snd_pcm_substream *substream,
if (err)
return err;
}
+#endif
snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
diff --git a/sound/soc/imx/imx-sgtl5000.c b/sound/soc/imx/imx-sgtl5000.c
index 9325dc8e346c..c73ab7ec19a4 100644
--- a/sound/soc/imx/imx-sgtl5000.c
+++ b/sound/soc/imx/imx-sgtl5000.c
@@ -3,7 +3,7 @@
* sgtl5000 codec
*
* Copyright 2009 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
- * Copyright (C) 2011 Freescale Semiconductor, Inc.
+ * Copyright (C) 2011-2012 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -43,6 +43,11 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
.pin = "Headphone Jack",
.mask = SND_JACK_HEADPHONE,
},
+ {
+ .pin = "Ext Spk",
+ .mask = SND_JACK_HEADPHONE,
+ .invert = 1,
+ },
};
/* Headphones jack detection gpios */
@@ -195,11 +200,29 @@ static int sgtl5000_set_line_in(struct snd_kcontrol *kcontrol,
return 1;
}
+static int spk_amp_event(struct snd_soc_dapm_widget *w,
+ struct snd_kcontrol *kcontrol, int event)
+{
+ struct imx_sgtl5000_priv *priv = &card_priv;
+ struct platform_device *pdev = priv->pdev;
+ struct mxc_audio_platform_data *plat = pdev->dev.platform_data;
+
+ if (plat->amp_enable == NULL)
+ return 0;
+
+ if (SND_SOC_DAPM_EVENT_ON(event))
+ plat->amp_enable(1);
+ else
+ plat->amp_enable(0);
+
+ return 0;
+}
+
/* imx_3stack card dapm widgets */
static const struct snd_soc_dapm_widget imx_3stack_dapm_widgets[] = {
SND_SOC_DAPM_MIC("Mic Jack", NULL),
SND_SOC_DAPM_LINE("Line In Jack", NULL),
- SND_SOC_DAPM_SPK("Ext Spk", NULL),
+ SND_SOC_DAPM_SPK("Ext Spk", spk_amp_event),
SND_SOC_DAPM_HP("Headphone Jack", NULL),
};
@@ -246,7 +269,8 @@ static int imx_3stack_sgtl5000_init(struct snd_soc_pcm_runtime *rtd)
snd_soc_dapm_add_routes(&codec->dapm, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_disable_pin(&codec->dapm, "Line In Jack");
- snd_soc_dapm_enable_pin(&codec->dapm, "Headphone Jack");
+ snd_soc_dapm_disable_pin(&codec->dapm, "Headphone Jack");
+ snd_soc_dapm_enable_pin(&codec->dapm, "Ext Spk");
snd_soc_dapm_sync(&codec->dapm);
if (hs_jack_gpios[0].gpio != -1) {