summaryrefslogtreecommitdiff
path: root/sound/soc/ux500/ux500_ab8500.c
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@linaro.org>2011-05-06 14:18:39 +0200
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-03-19 09:00:51 +0100
commite8236d1e6e4ee6e786dddcc332b3d01c43d58938 (patch)
tree0dd31381cf7f80dded79fa54d9541b2917d8e61c /sound/soc/ux500/ux500_ab8500.c
parentc8eaa0393187c4d88a13cfe1c3cc82467aeeed46 (diff)
Ux500 ASoC: Support configuration of I2S interface 1
Added support for configuring the second I2S interface. This is needed for FM-radio. Change-Id: I1a8cd908f66db45b6031d15d33779236a1a55344 Signed-off-by: Ola Lilja <elilola@steludxu2785.(none)> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/19821 Tested-by: Ola LILJA2 <ola.o.lilja@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Roger NILSSON1 <roger.xr.nilsson@stericsson.com> Conflicts: sound/soc/codecs/ab8500_audio.c
Diffstat (limited to 'sound/soc/ux500/ux500_ab8500.c')
-rw-r--r--sound/soc/ux500/ux500_ab8500.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/sound/soc/ux500/ux500_ab8500.c b/sound/soc/ux500/ux500_ab8500.c
index f4cdd36f4d3..d2c0493aa5e 100644
--- a/sound/soc/ux500/ux500_ab8500.c
+++ b/sound/soc/ux500/ux500_ab8500.c
@@ -147,14 +147,13 @@ void ux500_ab8500_shutdown(struct snd_pcm_substream *substream)
rx_slots = DEF_RX_SLOTS;
}
-int ux500_ab8500_hw_params(
- struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
+int ux500_ab8500_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
- unsigned int fmt;
+ unsigned int fmt, fmt_if1;
int channels, ret = 0, slots, slot_width, driver_mode;
bool streamIsPlayback;
@@ -238,14 +237,25 @@ int ux500_ab8500_hw_params(
pr_debug("%s: CPU-DAI TDM: TX=0x%04X RX=0x%04x\n",
__func__, tx_slots, rx_slots);
- ret = snd_soc_dai_set_tdm_slot(cpu_dai, tx_slots, rx_slots,
- slots, slot_width);
+ ret = snd_soc_dai_set_tdm_slot(cpu_dai, tx_slots, rx_slots, slots, slot_width);
+ if (ret)
+ return ret;
pr_debug("%s: CODEC-DAI TDM: TX=0x%04X RX=0x%04x\n",
__func__, tx_slots, rx_slots);
- ret += snd_soc_dai_set_tdm_slot(codec_dai, tx_slots, rx_slots, slots, slot_width);
+ ret = snd_soc_dai_set_tdm_slot(codec_dai, tx_slots, rx_slots, slots, slot_width);
+ if (ret)
+ return ret;
- return ret;
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ pr_debug("%s: Setup IF1 for FM-radio.\n", __func__);
+ fmt_if1 = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_I2S;
+ ret = ab8500_audio_setup_if1(codec_dai->codec, fmt_if1, 16, 1);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
}
static int regulator_event(struct snd_soc_dapm_widget *w,