summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorXinyu Chen <xinyu.chen@freescale.com>2011-12-13 16:40:18 +0800
committerXinyu Chen <xinyu.chen@freescale.com>2011-12-13 16:40:18 +0800
commit18e894b2240b58718d665329ca5d2c0681feb901 (patch)
treecde13eb1f88f47b31fe1f101a25027ec1eef73f5 /sound
parentc5d492b9a9539992d8cc040a8a675d0e445c0d0d (diff)
parentbdcbf429b11f93bd0df305f9c04c09616009fc3d (diff)
Merge remote-tracking branch 'fsl-linux-sdk/imx_2.6.38' into imx_2.6.38_android
Conflicts: arch/arm/mach-mx6/board-mx6q_arm2.c arch/arm/mach-mx6/board-mx6q_sabrelite.c
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/cs42888.h1
-rw-r--r--sound/soc/imx/imx-cs42888.c9
-rw-r--r--sound/soc/imx/imx-ssi.c22
3 files changed, 23 insertions, 9 deletions
diff --git a/sound/soc/codecs/cs42888.h b/sound/soc/codecs/cs42888.h
index a650c9da5338..bea8beb8b70d 100644
--- a/sound/soc/codecs/cs42888.h
+++ b/sound/soc/codecs/cs42888.h
@@ -19,6 +19,7 @@
* the .codec_dai field of your machine driver's snd_soc_dai_link structure.
*/
extern struct snd_soc_dai_driver cs42888_dai;
+#define CS42888_RST 235
/*
* The ASoC codec device structure for the CS42888. Assign this structure
diff --git a/sound/soc/imx/imx-cs42888.c b/sound/soc/imx/imx-cs42888.c
index d34be0a0e8f9..4c9ca9857464 100644
--- a/sound/soc/imx/imx-cs42888.c
+++ b/sound/soc/imx/imx-cs42888.c
@@ -20,6 +20,7 @@
#include <linux/delay.h>
#include <linux/regulator/consumer.h>
#include <linux/fsl_devices.h>
+#include <linux/gpio.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
@@ -33,7 +34,6 @@
#include "imx-esai.h"
#include "../codecs/cs42888.h"
-
struct imx_priv_state {
int hw;
};
@@ -45,8 +45,13 @@ static int imx_3stack_startup(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
- if (!cpu_dai->active)
+
+ if (!cpu_dai->active) {
hw_state.hw = 0;
+ gpio_direction_output(CS42888_RST, 0);
+ msleep(100);
+ gpio_direction_output(CS42888_RST, 1);
+ }
return 0;
}
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c
index 8cf85b06b780..559dbfb7319d 100644
--- a/sound/soc/imx/imx-ssi.c
+++ b/sound/soc/imx/imx-ssi.c
@@ -99,10 +99,6 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
case SND_SOC_DAIFMT_I2S:
/* data on rising edge of bclk, frame low 1clk before data */
strcr |= SSI_STCR_TFSI | SSI_STCR_TEFS | SSI_STCR_TXBIT0;
- if (ssi->flags & IMX_SSI_USE_I2S_SLAVE) {
- scr &= ~SSI_I2S_MODE_MASK;
- scr |= SSI_SCR_I2S_MODE_SLAVE;
- }
break;
case SND_SOC_DAIFMT_LEFT_J:
/* data on rising edge of bclk, frame high with data */
@@ -138,10 +134,21 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
/* DAI clock master masks */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+ case SND_SOC_DAIFMT_CBS_CFS:
+ strcr |= SSI_STCR_TFDIR | SSI_STCR_TXDIR;
+ if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) {
+ scr &= ~SSI_I2S_MODE_MASK;
+ scr |= SSI_SCR_I2S_MODE_MSTR;
+ }
+ break;
case SND_SOC_DAIFMT_CBM_CFM:
+ strcr &= ~(SSI_STCR_TFDIR | SSI_STCR_TXDIR);
+ if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) {
+ scr &= ~SSI_I2S_MODE_MASK;
+ scr |= SSI_SCR_I2S_MODE_SLAVE;
+ }
break;
default:
- /* Master mode not implemented, needs handling of clocks. */
return -EINVAL;
}
@@ -279,9 +286,10 @@ static int imx_ssi_hw_params(struct snd_pcm_substream *substream,
scr = readl(ssi->base + SSI_SCR);
- if (channels == 1)
+ if (channels == 1) {
scr &= ~SSI_SCR_NET;
- else
+ scr &= ~SSI_I2S_MODE_MASK;
+ } else
scr |= SSI_SCR_NET;
writel(scr, ssi->base + SSI_SCR);