summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2014-07-31 18:08:18 -0700
committerMark Brown <broonie@linaro.org>2014-08-01 07:25:16 +0100
commit1a7889ca8aba333d7c74fad543d692c31bc7f280 (patch)
tree6438a05b4fc37b1749cdd92106bce2d82e59203a /sound/soc/sh
parent7c63f3c02f5a998621758239abed43c5bd454b70 (diff)
downloadlinux-stable-1a7889ca8aba333d7c74fad543d692c31bc7f280.tar.gz
linux-stable-1a7889ca8aba333d7c74fad543d692c31bc7f280.tar.bz2
linux-stable-1a7889ca8aba333d7c74fad543d692c31bc7f280.zip
ASoC: rsnd: fixup SND_SOC_DAIFMT_xB_xF behavior
In current R-Car rsnd driver, the SND_SOC_DAIFMT_xB_xF flags are used to HW default behavior, but, it should be used to specific format. The waveforms of LEFT_J/RIGHT_J format with SND_SOC_DAIFMT_NB_NF flag will be started from "falling edge" without this patch. But, it should be started from "rising edge". Reported-by: Jun Watanabe <jun.watanabe.ue@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/rcar/core.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index d7c669790dd4..19f78963e8b9 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -624,40 +624,41 @@ static int rsnd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
return -EINVAL;
}
- /* set clock inversion */
- switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
- case SND_SOC_DAIFMT_NB_IF:
- rdai->bit_clk_inv = 0;
- rdai->frm_clk_inv = 1;
- break;
- case SND_SOC_DAIFMT_IB_NF:
- rdai->bit_clk_inv = 1;
- rdai->frm_clk_inv = 0;
- break;
- case SND_SOC_DAIFMT_IB_IF:
- rdai->bit_clk_inv = 1;
- rdai->frm_clk_inv = 1;
- break;
- case SND_SOC_DAIFMT_NB_NF:
- default:
- rdai->bit_clk_inv = 0;
- rdai->frm_clk_inv = 0;
- break;
- }
-
/* set format */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
rdai->sys_delay = 0;
rdai->data_alignment = 0;
+ rdai->frm_clk_inv = 0;
break;
case SND_SOC_DAIFMT_LEFT_J:
rdai->sys_delay = 1;
rdai->data_alignment = 0;
+ rdai->frm_clk_inv = 1;
break;
case SND_SOC_DAIFMT_RIGHT_J:
rdai->sys_delay = 1;
rdai->data_alignment = 1;
+ rdai->frm_clk_inv = 1;
+ break;
+ }
+
+ /* set clock inversion */
+ switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+ case SND_SOC_DAIFMT_NB_IF:
+ rdai->bit_clk_inv = rdai->bit_clk_inv;
+ rdai->frm_clk_inv = !rdai->frm_clk_inv;
+ break;
+ case SND_SOC_DAIFMT_IB_NF:
+ rdai->bit_clk_inv = !rdai->bit_clk_inv;
+ rdai->frm_clk_inv = rdai->frm_clk_inv;
+ break;
+ case SND_SOC_DAIFMT_IB_IF:
+ rdai->bit_clk_inv = !rdai->bit_clk_inv;
+ rdai->frm_clk_inv = !rdai->frm_clk_inv;
+ break;
+ case SND_SOC_DAIFMT_NB_NF:
+ default:
break;
}