* [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
@ 2014-08-04 15:08 Fabio Falzoi
2014-08-04 15:13 ` Timur Tabi
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Fabio Falzoi @ 2014-08-04 15:08 UTC (permalink / raw)
To: alsa-devel
Cc: adamo.a60, timur, lgirdwood, broonie, Fabio Falzoi, mpa, michael
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.
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Tested-by: Angelo Adamo <adamo.a60@gmail.com>
---
sound/soc/fsl/fsl_ssi.c | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 87eb577..2fc3e66 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -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;
}
--
2.0.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
2014-08-04 15:08 [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS Fabio Falzoi
@ 2014-08-04 15:13 ` Timur Tabi
2014-08-04 15:27 ` Fabio Estevam
2014-08-07 17:45 ` Mark Brown
2 siblings, 0 replies; 9+ messages in thread
From: Timur Tabi @ 2014-08-04 15:13 UTC (permalink / raw)
To: Fabio Falzoi; +Cc: alsa-devel, adamo.a60, lgirdwood, broonie, mpa, michael
On 08/04/2014 10:08 AM, Fabio Falzoi wrote:
> 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.
>
> Signed-off-by: Michael Trimarchi<michael@amarulasolutions.com>
> Signed-off-by: Fabio Falzoi<fabio.falzoi84@gmail.com>
> Tested-by: Angelo Adamo<adamo.a60@gmail.com>
Acked-by: Timur Tabi <timur@tabi.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
2014-08-04 15:08 [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS Fabio Falzoi
2014-08-04 15:13 ` Timur Tabi
@ 2014-08-04 15:27 ` Fabio Estevam
2014-08-04 15:29 ` Michael Trimarchi
2014-08-07 17:45 ` Mark Brown
2 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2014-08-04 15:27 UTC (permalink / raw)
To: Fabio Falzoi
Cc: alsa-devel@alsa-project.org, adamo.a60, Timur Tabi, Liam Girdwood,
Mark Brown, Markus Pargmann, michael
On Mon, Aug 4, 2014 at 12:08 PM, Fabio Falzoi <fabio.falzoi84@gmail.com> wrote:
> 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.
Great, do you plan to submit the audio support into imx6q-udoo.dts?
Thanks
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
2014-08-04 15:27 ` Fabio Estevam
@ 2014-08-04 15:29 ` Michael Trimarchi
2014-08-04 15:51 ` Fabio Estevam
0 siblings, 1 reply; 9+ messages in thread
From: Michael Trimarchi @ 2014-08-04 15:29 UTC (permalink / raw)
To: Fabio Estevam
Cc: alsa-devel@alsa-project.org, Angelo Adamo, Liam Girdwood,
Timur Tabi, Mark Brown, Fabio Falzoi, Markus Pargmann
Hi Fabio
On Mon, Aug 4, 2014 at 5:27 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Aug 4, 2014 at 12:08 PM, Fabio Falzoi <fabio.falzoi84@gmail.com> wrote:
>> 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.
>
> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
2014-08-04 15:29 ` Michael Trimarchi
@ 2014-08-04 15:51 ` Fabio Estevam
0 siblings, 0 replies; 9+ messages in thread
From: Fabio Estevam @ 2014-08-04 15:51 UTC (permalink / raw)
To: Michael Trimarchi
Cc: alsa-devel@alsa-project.org, Angelo Adamo, Liam Girdwood,
Timur Tabi, Mark Brown, Fabio Falzoi, Markus Pargmann
On Mon, Aug 4, 2014 at 12:29 PM, Michael Trimarchi
<michael@amarulasolutions.com> wrote:
> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
2014-08-04 15:08 [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS Fabio Falzoi
2014-08-04 15:13 ` Timur Tabi
2014-08-04 15:27 ` Fabio Estevam
@ 2014-08-07 17:45 ` Mark Brown
2014-09-12 17:37 ` Michael Trimarchi
2 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2014-08-07 17:45 UTC (permalink / raw)
To: Fabio Falzoi; +Cc: alsa-devel, adamo.a60, timur, lgirdwood, mpa, michael
[-- Attachment #1.1: Type: text/plain, Size: 384 bytes --]
On Mon, Aug 04, 2014 at 05:08:07PM +0200, Fabio Falzoi wrote:
> 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.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
2014-08-07 17:45 ` Mark Brown
@ 2014-09-12 17:37 ` Michael Trimarchi
2014-09-12 18:07 ` Fabio Estevam
0 siblings, 1 reply; 9+ messages in thread
From: Michael Trimarchi @ 2014-09-12 17:37 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel@alsa-project.org, Angelo Adamo, Liam Girdwood,
Timur Tabi, Fabio Falzoi, Markus Pargmann
Hi Mark
On Thu, Aug 7, 2014 at 7:45 PM, Mark Brown <broonie@kernel.org> wrote:
> On Mon, Aug 04, 2014 at 05:08:07PM +0200, Fabio Falzoi wrote:
>> 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.
>
> Applied, thanks.
where do you apply it (I mean branch)?
Michael
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
2014-09-12 17:37 ` Michael Trimarchi
@ 2014-09-12 18:07 ` Fabio Estevam
2014-09-12 18:11 ` Michael Trimarchi
0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2014-09-12 18:07 UTC (permalink / raw)
To: Michael Trimarchi
Cc: alsa-devel@alsa-project.org, Angelo Adamo, Liam Girdwood,
Timur Tabi, Mark Brown, Fabio Falzoi, Markus Pargmann
On Fri, Sep 12, 2014 at 2:37 PM, Michael Trimarchi
<michael@amarulasolutions.com> wrote:
> where do you apply it (I mean branch)?
https://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/sound/soc/fsl/fsl_ssi.c?h=for-next&id=cf4f7fc3e7336e2e946880890e60ed36178889ea
It also shows in linux-next.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS
2014-09-12 18:07 ` Fabio Estevam
@ 2014-09-12 18:11 ` Michael Trimarchi
0 siblings, 0 replies; 9+ messages in thread
From: Michael Trimarchi @ 2014-09-12 18:11 UTC (permalink / raw)
To: Fabio Estevam
Cc: alsa-devel@alsa-project.org, Angelo Adamo, Liam Girdwood,
Timur Tabi, Mark Brown, Fabio Falzoi, Markus Pargmann
Hi Fabio
On Fri, Sep 12, 2014 at 8:07 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Fri, Sep 12, 2014 at 2:37 PM, Michael Trimarchi
> <michael@amarulasolutions.com> wrote:
>
>> where do you apply it (I mean branch)?
>
> https://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/sound/soc/fsl/fsl_ssi.c?h=for-next&id=cf4f7fc3e7336e2e946880890e60ed36178889ea
>
> It also shows in linux-next.
Thank you
Michael
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-09-12 18:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-04 15:08 [PATCH] ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFS Fabio Falzoi
2014-08-04 15:13 ` Timur Tabi
2014-08-04 15:27 ` Fabio Estevam
2014-08-04 15:29 ` Michael Trimarchi
2014-08-04 15:51 ` Fabio Estevam
2014-08-07 17:45 ` Mark Brown
2014-09-12 17:37 ` Michael Trimarchi
2014-09-12 18:07 ` Fabio Estevam
2014-09-12 18:11 ` Michael Trimarchi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.