提交 c29b206f 编写于 作者: P Peter Ujfalusi 提交者: Mark Brown

ASoC: OMAP: Use single-phase for DSP mode

Use single-phase mode for the DSP mode and keep the dual phase
mode for the I2S mode.

The mono (1 channel) mode already used single phase mode,
now it is more cleaner. There is no need to configure the
second phase, when the single phase is used.
Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: NJarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 0d960e88
...@@ -214,8 +214,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -214,8 +214,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data); struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs; struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
int dma, bus_id = mcbsp_data->bus_id, id = cpu_dai->id; int dma, bus_id = mcbsp_data->bus_id, id = cpu_dai->id;
int wlen, channels; int wlen, channels, wpf;
unsigned long port; unsigned long port;
unsigned int format;
if (cpu_class_is_omap1()) { if (cpu_class_is_omap1()) {
dma = omap1_dma_reqs[bus_id][substream->stream]; dma = omap1_dma_reqs[bus_id][substream->stream];
...@@ -243,18 +244,23 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -243,18 +244,23 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
channels = params_channels(params); format = mcbsp_data->fmt & SND_SOC_DAIFMT_FORMAT_MASK;
wpf = channels = params_channels(params);
switch (channels) { switch (channels) {
case 2: case 2:
if (format == SND_SOC_DAIFMT_I2S) {
/* Use dual-phase frames */ /* Use dual-phase frames */
regs->rcr2 |= RPHASE; regs->rcr2 |= RPHASE;
regs->xcr2 |= XPHASE; regs->xcr2 |= XPHASE;
/* Set 1 word per (McBSP) frame for phase1 and phase2 */
wpf--;
regs->rcr2 |= RFRLEN2(wpf - 1);
regs->xcr2 |= XFRLEN2(wpf - 1);
}
case 1: case 1:
/* Set 1 word per (McBSP) frame */ /* Set word per (McBSP) frame for phase1 */
regs->rcr2 |= RFRLEN2(1 - 1); regs->rcr1 |= RFRLEN1(wpf - 1);
regs->rcr1 |= RFRLEN1(1 - 1); regs->xcr1 |= XFRLEN1(wpf - 1);
regs->xcr2 |= XFRLEN2(1 - 1);
regs->xcr1 |= XFRLEN1(1 - 1);
break; break;
default: default:
/* Unsupported number of channels */ /* Unsupported number of channels */
...@@ -276,9 +282,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -276,9 +282,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
} }
/* Set FS period and length in terms of bit clock periods */ /* Set FS period and length in terms of bit clock periods */
switch (mcbsp_data->fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (format) {
case SND_SOC_DAIFMT_I2S: case SND_SOC_DAIFMT_I2S:
regs->srgr2 |= FPER(wlen * 2 - 1); regs->srgr2 |= FPER(wlen * channels - 1);
regs->srgr1 |= FWID(wlen - 1); regs->srgr1 |= FWID(wlen - 1);
break; break;
case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_B:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册