ALSA: ASoC: DaVinci: i2s, evm, pass same value to codec and cpu_dai
Fix the meaning of SND_SOC_DAIFMT_NB_NF to match that used in the codec. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
@@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#define EVM_CODEC_CLOCK 22579200
|
#define EVM_CODEC_CLOCK 22579200
|
||||||
|
|
||||||
|
#define AUDIO_FORMAT (SND_SOC_DAIFMT_I2S | \
|
||||||
|
SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_NF)
|
||||||
static int evm_hw_params(struct snd_pcm_substream *substream,
|
static int evm_hw_params(struct snd_pcm_substream *substream,
|
||||||
struct snd_pcm_hw_params *params)
|
struct snd_pcm_hw_params *params)
|
||||||
{
|
{
|
||||||
@@ -37,16 +39,12 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* set codec DAI configuration */
|
/* set codec DAI configuration */
|
||||||
ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
|
ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT);
|
||||||
SND_SOC_DAIFMT_CBM_CFM |
|
|
||||||
SND_SOC_DAIFMT_NB_NF);
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* set cpu DAI configuration */
|
/* set cpu DAI configuration */
|
||||||
ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
|
ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
|
||||||
SND_SOC_DAIFMT_CBM_CFM |
|
|
||||||
SND_SOC_DAIFMT_IB_NF);
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@@ -271,7 +271,7 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
|
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
|
||||||
case SND_SOC_DAIFMT_IB_NF:
|
case SND_SOC_DAIFMT_NB_NF:
|
||||||
/* CLKRP Receive clock polarity,
|
/* CLKRP Receive clock polarity,
|
||||||
* 1 - sampled on rising edge of CLKR
|
* 1 - sampled on rising edge of CLKR
|
||||||
* valid on rising edge
|
* valid on rising edge
|
||||||
@@ -283,7 +283,7 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
|
|||||||
*/
|
*/
|
||||||
pcr |= (DAVINCI_MCBSP_PCR_CLKXP | DAVINCI_MCBSP_PCR_CLKRP);
|
pcr |= (DAVINCI_MCBSP_PCR_CLKXP | DAVINCI_MCBSP_PCR_CLKRP);
|
||||||
break;
|
break;
|
||||||
case SND_SOC_DAIFMT_NB_IF:
|
case SND_SOC_DAIFMT_IB_IF:
|
||||||
/* CLKRP Receive clock polarity,
|
/* CLKRP Receive clock polarity,
|
||||||
* 0 - sampled on falling edge of CLKR
|
* 0 - sampled on falling edge of CLKR
|
||||||
* valid on falling edge
|
* valid on falling edge
|
||||||
@@ -295,7 +295,7 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
|
|||||||
*/
|
*/
|
||||||
pcr |= (DAVINCI_MCBSP_PCR_FSXP | DAVINCI_MCBSP_PCR_FSRP);
|
pcr |= (DAVINCI_MCBSP_PCR_FSXP | DAVINCI_MCBSP_PCR_FSRP);
|
||||||
break;
|
break;
|
||||||
case SND_SOC_DAIFMT_IB_IF:
|
case SND_SOC_DAIFMT_NB_IF:
|
||||||
/* CLKRP Receive clock polarity,
|
/* CLKRP Receive clock polarity,
|
||||||
* 1 - sampled on rising edge of CLKR
|
* 1 - sampled on rising edge of CLKR
|
||||||
* valid on rising edge
|
* valid on rising edge
|
||||||
@@ -308,7 +308,7 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
|
|||||||
pcr |= (DAVINCI_MCBSP_PCR_CLKXP | DAVINCI_MCBSP_PCR_CLKRP |
|
pcr |= (DAVINCI_MCBSP_PCR_CLKXP | DAVINCI_MCBSP_PCR_CLKRP |
|
||||||
DAVINCI_MCBSP_PCR_FSXP | DAVINCI_MCBSP_PCR_FSRP);
|
DAVINCI_MCBSP_PCR_FSXP | DAVINCI_MCBSP_PCR_FSRP);
|
||||||
break;
|
break;
|
||||||
case SND_SOC_DAIFMT_NB_NF:
|
case SND_SOC_DAIFMT_IB_NF:
|
||||||
/* CLKRP Receive clock polarity,
|
/* CLKRP Receive clock polarity,
|
||||||
* 0 - sampled on falling edge of CLKR
|
* 0 - sampled on falling edge of CLKR
|
||||||
* valid on falling edge
|
* valid on falling edge
|
||||||
|
Reference in New Issue
Block a user