ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
Subsystems (3)
PATCH 1/1 ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
Add SND_SOC_DAIFMT_CBM_CFS support for Freescale architecture. Successfully tested on i.MX 6Quad Wandboard and UDOO boards connected to the pcm1792a codec.
In CBM_CFS mode, when using a sample size of 16 bits, we cannot use CCSR_SSI_SCR_I2S_MODE_MASTER since we get a frame sync every 16 bits.
--- sound/soc/fsl/fsl_ssi.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-)
sound/soc/fsl/fsl_ssi.c +28 -5
@@ -259,6 +259,11 @@ static bool fsl_ssi_is_i2s_master(struct fsl_ssi_private *ssi_private)SND_SOC_DAIFMT_CBS_CFS ; } +static bool fsl_ssi_is_i2s_cbm_cfs (struct fsl_ssi_private *ssi_private) +{ +return (ssi_private->dai_fmt &SND_SOC_DAIFMT_MASTER_MASK ) == +SND_SOC_DAIFMT_CBM_CFS ; +}/** * fsl_ssi_isr: SSI interrupt handler *
@@ -705,6 +710,23 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, } } +if (!fsl_ssi_is_ac97 (ssi_private)) { +u8 i2smode; +/* +* Switch to normal net mode in order to have a frame sync +* signal every 32 bits instead of 16 bits +*/ +if (fsl_ssi_is_i2s_cbm_cfs (ssi_private) && sample_size ==16 ) + i2smode =CCSR_SSI_SCR_I2S_MODE_NORMAL | +CCSR_SSI_SCR_NET ; +else + i2smode = ssi_private->i2s_mode; + +regmap_update_bits (regs,CCSR_SSI_SCR , +CCSR_SSI_SCR_NET |CCSR_SSI_SCR_I2S_MODE_MASK , + channels ==1 ?0 : i2smode); + } +/* * FIXME: The documentation says that SxCCR[WL] should not be * modified while the SSI is enabled. The only time this can
@@ -724,11 +746,6 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream,regmap_update_bits (regs,CCSR_SSI_SRCCR , CCSR_SSI_SxCCR_WL_MASK, wl); -if (!fsl_ssi_is_ac97 (ssi_private)) -regmap_update_bits (regs,CCSR_SSI_SCR , -CCSR_SSI_SCR_NET |CCSR_SSI_SCR_I2S_MODE_MASK , - channels ==1 ?0 : ssi_private->i2s_mode); -return 0 ; }
@@ -780,6 +797,7 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi_private *ssi_private,switch (fmt &SND_SOC_DAIFMT_FORMAT_MASK ) {case SND_SOC_DAIFMT_I2S :switch (fmt &SND_SOC_DAIFMT_MASTER_MASK ) { +case SND_SOC_DAIFMT_CBM_CFS :case SND_SOC_DAIFMT_CBS_CFS : ssi_private->i2s_mode |=CCSR_SSI_SCR_I2S_MODE_MASTER ; regmap_update_bits(regs, CCSR_SSI_STCCR,
@@ -853,6 +871,11 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi_private *ssi_private,case SND_SOC_DAIFMT_CBM_CFM : scr &= ~CCSR_SSI_SCR_SYS_CLK_EN ;break ; +case SND_SOC_DAIFMT_CBM_CFS : + strcr &= ~CCSR_SSI_STCR_TXDIR ; + strcr |=CCSR_SSI_STCR_TFDIR ; + scr &= ~CCSR_SSI_SCR_SYS_CLK_EN ; +break ;default :return -EINVAL ; }
Signature · 1 line
2.0.0
Quoted 9 lines · Fabio Falzoi
Add
SND_SOC_DAIFMT_CBM_CFSsupport for Freescale architecture. Successfully tested on i.MX 6Quad Wandboard and UDOO boards connected to the pcm1792a codec.
InCBM_CFSmode, when using a sample size of 16 bits, we cannot useCCSR_SSI_SCR_I2S_MODE_MASTERsince we get a frame sync every 16 bits.Signed-off-by Michael Trimarchi<[email protected]>Signed-off-by Fabio Falzoi<[email protected]>Tested-by Angelo Adamo<[email protected]>
Fabio Estevam
reviewerQuoted 3 lines · Fabio Falzoi
Add
SND_SOC_DAIFMT_CBM_CFSsupport for Freescale architecture. Successfully tested on i.MX 6Quad Wandboard and UDOO boards connected to the pcm1792a codec.
Great, do you plan to submit the audio support into imx6q-udoo.dts?
Thanks
Hi Fabio
Quoted 8 lines · Fabio Estevam
Quoted 3 lines · Fabio Falzoi
Add
SND_SOC_DAIFMT_CBM_CFSsupport for Freescale architecture. Successfully tested on i.MX 6Quad Wandboard and UDOO boards connected to the pcm1792a codec.Great, do you plan to submit the audio support into
imx6q-udoo.dts?Thanks
udoo is not based on pcm1792a but on ac97 codec. I have seen somewhere the driver I can cleanup and let it go. We have solded the pcm1792a on wandboard and udoo ;) and on pandaboard es :D.
Michael
Fabio Estevam
reviewerQuoted 3 lines · Michael Trimarchi
udoo is not based on pcm1792a but on ac97 codec. I have seen somewhere the driver I can cleanup and let it go. We have solded the pcm1792a on wandboard and udoo ;) and on pandaboard es :D.
Ah, good point :-)
Yes, Udoo has the vt1613 codec
(https://github.com/UDOOboard/Kernel_Unico/blob/master/sound/soc/codecs/vt1613.c
), which has not been upstreamed yet.
Thanks
Quoted 5 lines · Fabio Falzoi
Add
SND_SOC_DAIFMT_CBM_CFSsupport for Freescale architecture. Successfully tested on i.MX 6Quad Wandboard and UDOO boards connected to the pcm1792a codec.
InCBM_CFSmode, when using a sample size of 16 bits, we cannot useCCSR_SSI_SCR_I2S_MODE_MASTERsince we get a frame sync every 16 bits.
Applied, thanks.
Hi Mark
Quoted 8 lines · Mark Brown
Quoted 5 lines · Fabio Falzoi
Add
SND_SOC_DAIFMT_CBM_CFSsupport for Freescale architecture. Successfully tested on i.MX 6Quad Wandboard and UDOO boards connected to the pcm1792a codec.
InCBM_CFSmode, when using a sample size of 16 bits, we cannot useCCSR_SSI_SCR_I2S_MODE_MASTERsince we get a frame sync every 16 bits.Applied, thanks.
where do you apply it (I mean branch)?
Michael
Fabio Estevam
reviewerQuoted 1 line · Michael Trimarchi
where do you apply it (I mean branch)?
It also shows in linux-next.
Hi Fabio
Quoted 8 lines · Fabio Estevam
Quoted 1 line · Michael Trimarchi
where do you apply it (I mean branch)?
It also shows in linux-next.
Thank you
Michael