[PATCH] ASoC: fsl_ssi: fix AC'97 mode

2015-06-27 Thread Maciej S. Szmigiero
Currently the AC'97 mode in fsl_ssi driver isn't functional. This patch implements the following changes to make it work properly: * IPG clock have to be enabled during AC'97 CODEC register access, * AC'97 DAI driver struct need the same probe method as I2S one to setup DMA params, * AC'97 bus

Re: [PATCH] ASoC: fsl_ssi: fix AC'97 mode

2015-06-27 Thread Maciej S. Szmigiero
Hello Fabio, W dniu 28.06.2015 01:06, Fabio Estevam pisze: Hi Maciej, On Sat, Jun 27, 2015 at 7:51 PM, Maciej S. Szmigiero m...@maciej.szmigiero.name wrote: Currently the AC'97 mode in fsl_ssi driver isn't functional. Thanks for the fix. I look forward to test it on my udoo board

Re: [PATCH] ASoC: fsl_ssi: fix AC'97 mode

2015-06-28 Thread Maciej S. Szmigiero
W dniu 28.06.2015 06:27, Timur Tabi pisze: Maciej S. Szmigiero wrote: +if (newbinding fsl_ssi_is_ac97(ssi_private)) { Is the newbinding necessary? I thought only the original PowerPC device trees were the only one that have the old binding, and they never supported AC97

[PATCH 1/6] ASoC: fsl_ssi: enable IPG clock during AC'97 reg access

2015-06-28 Thread Maciej S. Szmigiero
IPG clock have to be enabled during AC'97 CODEC register access in fsl_ssi driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH 3/6] ASoC: fsl_ssi: enable AC'97 asymmetric rates

2015-06-28 Thread Maciej S. Szmigiero
AC'97 bus can support asymmetric playback/capture rates so enable them in this case in fsl_ssi driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH 2/6] ASoC: fsl_ssi: AC'97 DAI driver needs probe method too

2015-06-28 Thread Maciej S. Szmigiero
AC'97 DAI driver struct need the same probe method as I2S one to setup DMA params in fsl_ssi driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH 6/6] ASoC: fsl_ssi: adjust set DAI format in AC'97 mode

2015-06-28 Thread Maciej S. Szmigiero
Adjust set DAI format function in fsl_ssi driver so it doesn't fail and clears RXDIR in AC'97 mode. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH 5/6] ASoC: fsl_ssi: instantiate AC'97 CODEC

2015-06-28 Thread Maciej S. Szmigiero
Instantiate AC'97 CODEC in fsl_ssi driver AC'97 mode. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index

[PATCH 4/6] ASoC: fsl_ssi: add AC'97 ops setting check and cleanup

2015-06-28 Thread Maciej S. Szmigiero
Check whether setting AC'97 ops succeeded and clean them on removal so the fsl_ssi driver can be reloaded. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git

Re: [PATCH 3/6] ASoC: fsl_ssi: enable AC'97 asymmetric rates

2015-06-28 Thread Maciej S. Szmigiero
W dniu 28.06.2015 16:01, Timur Tabi pisze: Maciej S. Szmigiero wrote: /* Are the RX and the TX clocks locked? */ if (!of_find_property(np, fsl,ssi-asynchronous, NULL)) { -ssi_private-cpu_dai_drv.symmetric_rates = 1; +if (!fsl_ssi_is_ac97(ssi_private

[PATCH 3/6] ASoC: fsl_ssi: enable AC'97 asymmetric rates

2015-07-30 Thread Maciej S. Szmigiero
AC'97 bus can support asymmetric playback/capture rates so enable them in this case in fsl_ssi driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH 6/6] ASoC: fsl_ssi: adjust set DAI format in AC'97 mode

2015-07-30 Thread Maciej S. Szmigiero
Adjust set DAI format function in fsl_ssi driver so it doesn't fail and clears RXDIR in AC'97 mode. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH 5/6] ASoC: fsl_ssi: instantiate AC'97 CODEC

2015-07-30 Thread Maciej S. Szmigiero
Instantiate AC'97 CODEC in fsl_ssi driver AC'97 mode. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index

[PATCH 1/6] ASoC: fsl_ssi: enable IPG clock during AC'97 reg access

2015-07-30 Thread Maciej S. Szmigiero
IPG clock have to be enabled during AC'97 CODEC register access in fsl_ssi driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH 4/6] ASoC: fsl_ssi: add AC'97 ops setting check and cleanup

2015-07-30 Thread Maciej S. Szmigiero
Check whether setting AC'97 ops succeeded and clean them on removal so the fsl_ssi driver can be reloaded. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git

[PATCH 2/6] ASoC: fsl_ssi: AC'97 DAI driver needs probe method too

2015-07-30 Thread Maciej S. Szmigiero
AC'97 DAI driver struct need the same probe method as I2S one to setup DMA params in fsl_ssi driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

Re: [PATCH 1/6] ASoC: fsl_ssi: enable IPG clock during AC'97 reg access

2015-07-30 Thread Maciej S. Szmigiero
Hi Fabio, On 30.07.2015 17:20, Fabio Estevam wrote: Hi Maciej, On Thu, Jul 30, 2015 at 11:33 AM, Maciej S. Szmigiero m...@maciej.szmigiero.name wrote: static unsigned short fsl_ssi_ac97_read(struct snd_ac97 *ac97, @@ -1151,6 +1160,14 @@ static unsigned short fsl_ssi_ac97_read(struct

[PATCH 6/6 v2] ASoC: fsl_ssi: adjust set DAI format in AC'97 mode

2015-08-02 Thread Maciej S. Szmigiero
Adjust set DAI format function in fsl_ssi driver so it doesn't fail and clears RXDIR in AC'97 mode. Changes from v1: fix indentation to be consistent with rest of the driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c |8 +--- 1 files changed,

Re: [PATCH 6/6 v2] ASoC: fsl_ssi: adjust set DAI format in AC'97 mode

2015-08-03 Thread Maciej S. Szmigiero
On 03.08.2015 18:21, Mark Brown wrote: On Mon, Aug 03, 2015 at 12:44:11AM +0200, Maciej S. Szmigiero wrote: Adjust set DAI format function in fsl_ssi driver so it doesn't fail and clears RXDIR in AC'97 mode. Changes from v1: fix indentation to be consistent with rest of the driver. Inter

Re: [PATCH 5/6] ASoC: fsl_ssi: instantiate AC'97 CODEC

2015-07-31 Thread Maciej S. Szmigiero
On 31.07.2015 07:46, Markus Pargmann wrote: On Thu, Jul 30, 2015 at 04:35:23PM +0200, Maciej S. Szmigiero wrote: Instantiate AC'97 CODEC in fsl_ssi driver AC'97 mode. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl/fsl_ssi.c | 21 + 1

Re: [PATCH 6/6] ASoC: fsl_ssi: adjust set DAI format in AC'97 mode

2015-07-31 Thread Maciej S. Szmigiero
On 31.07.2015 07:58, Markus Pargmann wrote: On Thu, Jul 30, 2015 at 04:35:58PM +0200, Maciej S. Szmigiero wrote: Adjust set DAI format function in fsl_ssi driver so it doesn't fail and clears RXDIR in AC'97 mode. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- sound/soc/fsl

Re: [PATCH 3/6] ASoC: fsl_ssi: enable AC'97 asymmetric rates

2015-07-31 Thread Maciej S. Szmigiero
Hi Markus, Thanks for looking into the changes. On 31.07.2015 07:53, Markus Pargmann wrote: On Fri, Jul 31, 2015 at 07:27:19AM +0200, Markus Pargmann wrote: Hi, On Thu, Jul 30, 2015 at 04:34:19PM +0200, Maciej S. Szmigiero wrote: AC'97 bus can support asymmetric playback/capture rates so

[PATCH 1/6][RESEND] ASoC: fsl_ssi: enable IPG clock during AC'97 reg access

2015-08-05 Thread Maciej S. Szmigiero
IPG clock have to be enabled during AC'97 CODEC register access in fsl_ssi driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- This is a resend without changes, to keep the whole series together. sound/soc/fsl/fsl_ssi.c | 19 +++ 1 files changed, 19

[PATCH 2/6][RESEND] ASoC: fsl_ssi: AC'97 DAI driver needs probe method too

2015-08-05 Thread Maciej S. Szmigiero
AC'97 DAI driver struct need the same probe method as I2S one to setup DMA params in fsl_ssi driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- This is a resend without changes, to keep the whole series together. sound/soc/fsl/fsl_ssi.c |1 + 1 files changed, 1

[PATCH 3/6][RESEND] ASoC: fsl_ssi: enable AC'97 asymmetric rates

2015-08-05 Thread Maciej S. Szmigiero
AC'97 bus can support asymmetric playback/capture rates so enable them in this case in fsl_ssi driver. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- This is a resend without changes, to keep the whole series together. sound/soc/fsl/fsl_ssi.c |4 +++- 1 files changed, 3

[PATCH 5/6][RESEND] ASoC: fsl_ssi: instantiate AC'97 CODEC

2015-08-05 Thread Maciej S. Szmigiero
Instantiate AC'97 CODEC in fsl_ssi driver AC'97 mode. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- This is a resend without changes, to keep the whole series together. sound/soc/fsl/fsl_ssi.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff

[PATCH 6/6 v2][RESEND] ASoC: fsl_ssi: adjust set DAI format in AC'97 mode

2015-08-05 Thread Maciej S. Szmigiero
Adjust set DAI format function in fsl_ssi driver so it doesn't fail and clears RXDIR in AC'97 mode. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- Changes from v1: fix indentation to be consistent with rest of the driver. sound/soc/fsl/fsl_ssi.c |8 +--- 1 files changed,

[PATCH 4/6][RESEND] ASoC: fsl_ssi: add AC'97 ops setting check and cleanup

2015-08-05 Thread Maciej S. Szmigiero
Check whether setting AC'97 ops succeeded and clean them on removal so the fsl_ssi driver can be reloaded. Signed-off-by: Maciej Szmigiero m...@maciej.szmigiero.name --- This is a resend without changes, to keep the whole series together. sound/soc/fsl/fsl_ssi.c |9 - 1 files

[PATCH 1/2] ASoC: fsl-asoc-card: put ASRC OF node in case of unknown device

2015-08-31 Thread Maciej S. Szmigiero
In case of unknown DT compatible device the ASRC OF node possibly acquired earlier by of_parse_phandle() has to be put before returning from probe method. Signed-off-by: Maciej Szmigiero --- sound/soc/fsl/fsl-asoc-card.c |3 ++- 1 files changed, 2 insertions(+),

[PATCH 2/2] ASoC: fsl-asoc-card: add AC'97 support

2015-08-31 Thread Maciej S. Szmigiero
Add AC'97 support to fsl-asoc-card using generic ASoC AC'97 CODEC. The SSI controller will silently enable any TX AC'97 slots that have their bits set in SLOTREQ received from CODEC and then will redirect some of playback samples there. That's why it is important to make sure that any of CODEC

[PATCH v2] ASoC: fsl-asoc-card: add AC'97 support

2015-09-18 Thread Maciej S. Szmigiero
Add AC'97 support to fsl-asoc-card using generic ASoC AC'97 CODEC. The SSI controller will silently enable any TX AC'97 slots that have their bits set in SLOTREQ received from CODEC and then will redirect some of playback samples there. That's why it is important to make sure that any of CODEC

[PATCH 2/3] ASoC: fsl_ssi: mark some registers precious

2015-12-20 Thread Maciej S. Szmigiero
Mark some registers precious since their reads have side effects (like clearing flags). Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- sound/soc/fsl/fsl_ssi.c | 16 1 file changed, 16 insertions(+) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/s

[PATCH] ASoC: fsl-asoc-card: use different route map for AC'97 mode

2015-12-20 Thread Maciej S. Szmigiero
fsl_ssi uses different stream names ("AC97 Playback" / "AC97 Capture") in AC'97 mode so in this case fsl-asoc-card route map should also be using them. Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- sound/soc/fsl/fsl-asoc-card.c | 10 +- 1

[PATCH 1/3] ASoC: fsl_ssi: mark SACNT register volatile

2015-12-20 Thread Maciej S. Szmigiero
SACNT register should be marked volatile since its WR and RD bits are cleared by SSI after completing the relevant operation. This unbreaks AC'97 register access. Fixes: 05cf237972fe ("ASoC: fsl_ssi: Add driver suspend and resume to support MEGA Fast") Signed-off-by: Maciej S. Sz

[PATCH 3/3] ASoC: fsl_ssi: remove register defaults

2015-12-20 Thread Maciej S. Szmigiero
: 05cf237972fe ("ASoC: fsl_ssi: Add driver suspend and resume to support MEGA Fast") Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- sound/soc/fsl/fsl_ssi.c | 16 1 file changed, 16 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl

Re: [PATCH 3/3] ASoC: fsl_ssi: remove register defaults

2016-01-11 Thread Maciej S. Szmigiero
Hi Fabio, Thanks for testing. On 11.01.2016 13:10, Fabio Estevam wrote: > On Mon, Jan 11, 2016 at 10:04 AM, Fabio Estevam wrote: > >> This patch causes the following issue in linux-next: >> >> [2.526984] [ cut here ] >> [2.531632] WARNING:

Re: [PATCH 3/3] ASoC: fsl_ssi: remove register defaults

2016-01-11 Thread Maciej S. Szmigiero
On 11.01.2016 15:00, Mark Brown wrote: > On Mon, Jan 11, 2016 at 10:10:56AM -0200, Fabio Estevam wrote: >> On Mon, Jan 11, 2016 at 10:04 AM, Fabio Estevam wrote: > >>> [2.526984] [ cut here ] >>> [2.531632] WARNING: CPU: 1 PID: 1 at

Re: [PATCH 1/3] ASoC: fsl_ssi: mark SACNT register volatile

2016-01-11 Thread Maciej S. Szmigiero
Hi Timur, Thanks for review. On 10.01.2016 22:33, Timur Tabi wrote: > Maciej S. Szmigiero wrote: >> +regmap_write(regs, CCSR_SSI_SACNT, >> +ssi_private->regcache_sacnt); > > So I'm not familiar with all of the regcache features, but I understand this &g

[PATCH] ASoC: fsl_ssi: remove explicit register defaults

2016-01-18 Thread Maciej S. Szmigiero
Fast") Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- sound/soc/fsl/fsl_ssi.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) This replaces "ASoC: fsl_ssi: remove register defaults" submission. It ma

Re: [PATCH 3/3] ASoC: fsl_ssi: remove register defaults

2016-01-18 Thread Maciej S. Szmigiero
Hi Fabio, On 18.01.2016 13:51, Fabio Estevam wrote: > Hi Maciej, > > On Sun, Jan 17, 2016 at 8:02 PM, Maciej S. Szmigiero > <m...@maciej.szmigiero.name> wrote: > >> Patch updated according to Timur's suggestions (needs regmap fix): >> diff --git a/sound/

Re: [PATCH 3/3] ASoC: fsl_ssi: remove register defaults

2016-01-17 Thread Maciej S. Szmigiero
On 17.01.2016 19:38, Timur Tabi wrote: > Maciej S. Szmigiero wrote: >> On 17.01.2016 15:16, Maciej S. Szmigiero wrote: >>> On 17.01.2016 06:16, Timur Tabi wrote: >>>> Maciej S. Szmigiero wrote: >>>>> This is because (at least according to the d

Re: [PATCH 3/3] ASoC: fsl_ssi: remove register defaults

2016-01-16 Thread Maciej S. Szmigiero
Hi Fabio, On 11.01.2016 15:05, Fabio Estevam wrote: > Hi Maciej, > > On Mon, Jan 11, 2016 at 11:57 AM, Maciej S. Szmigiero > <m...@maciej.szmigiero.name> wrote: >> Hi Fabio, > >> This will disable register cache so it isn't right. >> Could you try

Re: [PATCH 3/3] ASoC: fsl_ssi: remove register defaults

2016-01-16 Thread Maciej S. Szmigiero
On 17.01.2016 01:10, Timur Tabi wrote: > Maciej S. Szmigiero wrote: >> +static const struct regmap_config fsl_ssi_regconfig_imx21 = { >> +.max_register = CCSR_SSI_SRMSK, >> +.reg_bits = 32, >> +.val_bits = 32, >> +.reg_stride = 4, >> +.v

Re: [PATCH 3/3] ASoC: fsl_ssi: remove register defaults

2016-01-17 Thread Maciej S. Szmigiero
On 17.01.2016 06:16, Timur Tabi wrote: > Maciej S. Szmigiero wrote: >> This is because (at least according to the datasheet) imx21-class SSI >> registers end at CCSR_SSI_SRMSK (no SACC{ST,EN,DIS} regs), so >> reading them for cache initialization may not be safe. >>

Re: [PATCH 3/3] ASoC: fsl_ssi: remove register defaults

2016-01-17 Thread Maciej S. Szmigiero
On 17.01.2016 15:16, Maciej S. Szmigiero wrote: > On 17.01.2016 06:16, Timur Tabi wrote: >> Maciej S. Szmigiero wrote: >>> This is because (at least according to the datasheet) imx21-class SSI >>> registers end at CCSR_SSI_SRMSK (no SACC{ST,EN,DIS} regs), so

Re: [PATCH] ASoC: fsl_ssi: remove explicit register defaults

2016-02-01 Thread Maciej S. Szmigiero
On 01.02.2016 22:10, Mark Brown wrote: > On Mon, Feb 01, 2016 at 05:58:06PM +0100, Maciej S. Szmigiero wrote: > >> Looks like a possible solution would be to change >> regmap_raw_read() to do read using _regmap_read in >> case the cache is bypassed and there is no -&

Re: [PATCH] ASoC: fsl_ssi: remove explicit register defaults

2016-02-01 Thread Maciej S. Szmigiero
Hi Fabio, On 01.02.2016 13:05, Fabio Estevam wrote: > Hi Maciej, > > On Mon, Jan 18, 2016 at 5:07 PM, Maciej S. Szmigiero > <m...@maciej.szmigiero.name> wrote: >> There is no guarantee that on fsl_ssi module load >> SSI registers will have their power-

Re: [PATCH] ASoC: fsl_ssi: remove explicit register defaults

2016-02-01 Thread Maciej S. Szmigiero
On 01.02.2016 13:13, Fabio Estevam wrote: > Hi Maciej, > > On Mon, Feb 1, 2016 at 10:07 AM, Maciej S. Szmigiero > <m...@maciej.szmigiero.name> wrote: >> Is regmap patch from >> http://www.spinics.net/lists/kernel/msg2161934.html >> applied to the tested

Re: [PATCH] ASoC: fsl_ssi: remove explicit register defaults

2016-02-01 Thread Maciej S. Szmigiero
On 01.02.2016 13:25, Maciej S. Szmigiero wrote: > On 01.02.2016 13:13, Fabio Estevam wrote: >> Hi Maciej, >> >> On Mon, Feb 1, 2016 at 10:07 AM, Maciej S. Szmigiero >> <m...@maciej.szmigiero.name> wrote: >>> Is regmap patch from >>> http://www.s

Re: [PATCH v3 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S, U}20

2017-11-27 Thread Maciej S. Szmigiero
On 27.11.2017 18:40, Takashi Sakamoto wrote: (..) > > Looks good to me. > > Reviewed-by: Takashi Sakamoto Thanks. > In next time to post any of your v2 patchset, it's better to add commenters > of v1 patchset to CC list, so that your patch reaches the person who has

Re: [alsa-devel] [PATCH v3 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S, U}20

2017-11-27 Thread Maciej S. Szmigiero
On 27.11.2017 21:28, Takashi Iwai wrote: > On Mon, 27 Nov 2017 00:09:47 +0100, > Maciej S. Szmigiero wrote: >> diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h >> index 58acd00cae19..d970879944fc 100644 >> --- a/include/sound/soc-dai.h >> +++ b/includ

[PATCH v4 2/2] ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture

2017-11-27 Thread Maciej S. Szmigiero
e so allow this, too. Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- Changes from v1: Adapt format name to changes in the first patch from this series. Changes from v2, v3: None. sound/soc/fsl/fsl_ssi.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-)

[PATCH v4 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20

2017-11-27 Thread Maciej S. Szmigiero
This format is similar to existing SNDRV_PCM_FORMAT_{S,U}20_3 that keep 20-bit PCM samples in 3 bytes, however i.MX6 platform SSI FIFO does not allow 3-byte accesses (including DMA) so a 4-byte (more conventional) format is needed for it. Signed-off-by: Maciej S. Szmigiero &l

[PATCH v3 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20

2017-11-26 Thread Maciej S. Szmigiero
This format is similar to existing SNDRV_PCM_FORMAT_{S,U}20_3 that keep 20-bit PCM samples in 3 bytes, however i.MX6 platform SSI FIFO does not allow 3-byte accesses (including DMA) so a 4-byte (more conventional) format is needed for it. Signed-off-by: Maciej S. Szmigiero &l

Re: [PATCH v2 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S, U}20

2017-11-26 Thread Maciej S. Szmigiero
Hi, On 26.11.2017 10:27, Takashi Sakamoto wrote: > Hi, > (..) > Before applying this patch: > 166 /* FIXME: the following three formats are not defined properly > yet */ > 167 [SNDRV_PCM_FORMAT_MPEG] = { > 168 .le = -1, .signd = -1, > 169 }, > 170

[PATCH v3 2/2] ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture

2017-11-26 Thread Maciej S. Szmigiero
e so allow this, too. Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- Changes from v1: Adapt format name to changes in the first patch from this series. Changes from v2: None. sound/soc/fsl/fsl_ssi.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-)

Re: [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S, U}20_4

2017-11-22 Thread Maciej S. Szmigiero
On 23.11.2017 00:27, Takashi Sakamoto wrote: > On Nov 23 2017 04:17, Maciej S. Szmigiero wrote: (..) >> --- a/include/uapi/sound/asound.h >> +++ b/include/uapi/sound/asound.h >> @@ -236,7 +236,11 @@ typedef int __bitwise snd_pcm_format_t; >>   #define    SNDRV_PCM_FOR

Re: [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20_4

2017-11-23 Thread Maciej S. Szmigiero
On 23.11.2017 09:08, Takashi Iwai wrote: > On Wed, 22 Nov 2017 20:17:34 +0100, > Maciej S. Szmigiero wrote: >> >> This format is similar to existing SNDRV_PCM_FORMAT_{S,U}20_3 that keep >> 20-bit PCM samples in 3 bytes, however i.MX6 platform SSI FIFO does not >> al

Re: [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S, U}20_4

2017-11-23 Thread Maciej S. Szmigiero
On 23.11.2017 08:40, Takashi Sakamoto wrote: > On Nov 23 2017 08:44, Maciej S. Szmigiero wrote: >> On 23.11.2017 00:27, Takashi Sakamoto wrote: >>> On Nov 23 2017 04:17, Maciej S. Szmigiero wrote: >> (..) >>>> --- a/include/uapi/sound/asound.h >>>>

Re: [PATCH v4 2/2] ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture

2017-11-30 Thread Maciej S. Szmigiero
Hi Nicolin, On 30.11.2017 08:23, Nicolin Chen wrote: > Hi Maciej, > > On Mon, Nov 27, 2017 at 11:34:44PM +0100, Maciej S. Szmigiero wrote: >> There is no problem in using different bit widths in playback and capture >> in AC'97 mode so allow this, too. > >> @@ -

Re: [PATCH v4 2/2] ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture

2017-11-30 Thread Maciej S. Szmigiero
On 01.12.2017 00:53, Nicolin Chen wrote: > On Thu, Nov 30, 2017 at 08:20:08PM +0100, Maciej S. Szmigiero wrote: > >> In the AC'97 mode we have to differentiate two things: >> 1) Bit width of the physical AC'97 interface ("AC-link"), >> 2) Bit width of samples t

[PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20_4

2017-11-22 Thread Maciej S. Szmigiero
This format is similar to existing SNDRV_PCM_FORMAT_{S,U}20_3 that keep 20-bit PCM samples in 3 bytes, however i.MX6 platform SSI FIFO does not allow 3-byte accesses (including DMA) so a 4-byte format is needed for it. Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- i

[PATCH 2/2] ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture

2017-11-22 Thread Maciej S. Szmigiero
e so allow this, too. Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- sound/soc/fsl/fsl_ssi.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 20ef09e1a395..2aed089fdd76 100644 --- a/sou

[PATCH v2 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20

2017-11-23 Thread Maciej S. Szmigiero
This format is similar to existing SNDRV_PCM_FORMAT_{S,U}20_3 that keep 20-bit PCM samples in 3 bytes, however i.MX6 platform SSI FIFO does not allow 3-byte accesses (including DMA) so a 4-byte (more conventional) format is needed for it. Signed-off-by: Maciej S. Szmigiero &l

[PATCH v2 2/2] ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture

2017-11-23 Thread Maciej S. Szmigiero
e so allow this, too. Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- Changes from v1: Adapt format name to changes in the first patch from this series. sound/soc/fsl/fsl_ssi.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl

Re: [PATCH v2 03/11] ASoC: fsl_ssi: Refine all comments

2017-12-13 Thread Maciej S. Szmigiero
On 13.12.2017 07:34, Nicolin Chen wrote: > This patch refines the comments by: > 1) Removing all out-of-date comments > 2) Removing all not-so-useful comments > 3) Unifying the styles of all comments > 4) Simplifying over-descriptive comments > 5) Adding comments to improve code readablity > 6)

Re: [PATCH v2 05/11] ASoC: fsl_ssi: Refine indentations and wrappings

2017-12-13 Thread Maciej S. Szmigiero
On 13.12.2017 07:34, Nicolin Chen wrote: > This patch just simply unifies the coding style. > > Signed-off-by: Nicolin Chen > --- > > Changelog > v1->v2 > * Added two missing indentation changes > * Removed two extra blank lines. > > sound/soc/fsl/fsl_ssi.c | 239

Re: [PATCH v2 00/11] ASoC: fsl_ssi: Clean up - coding style level

2017-12-13 Thread Maciej S. Szmigiero
place fsl_ssi_rxtx_reg_val with fsl_ssi_regvals > ASoC: fsl_ssi: Rename i2smode to i2s_net > ASoC: fsl_ssi: Define ternary macros to simplify code > > sound/soc/fsl/fsl_ssi.c | 1373 > +++-------- > sound/soc/fsl/fsl_ssi.h | 4

[PATCH 1/2] ASoC: fsl_ssi: AC'97 ops need regmap, clock and cleaning up on failure

2017-11-20 Thread Maciej S. Szmigiero
AC'97 ops (register read / write) need SSI regmap and clock, so they have to be set after them. We also need to set these ops back to NULL if we fail the probe. Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- sound/soc/fsl/fsl_ssi.c | 18 -- 1 file c

[PATCH] ASoC: fsl_ssi: remove duplicated flag setting in fsl_ssi_setup_reg_vals()

2017-11-20 Thread Maciej S. Szmigiero
We don't need to set CCSR_SSI_SIER_RFF0_EN / CCSR_SSI_SIER_TFE0_EN bits in reg->rx.sier / reg->tx.sier variables in a non-AC'97 mode considering we had just initialized these variables to these very values unconditionally a few lines earlier. Signed-off-by: Maciej S. Szmigi

[PATCH 2/2] ASoC: fsl_ssi: serialize AC'97 register access operations

2017-11-20 Thread Maciej S. Szmigiero
in this driver takes 100us+ let's use a mutex for this. Use this opportunity to also change a default value returned from AC'97 register read function from -1 to 0, since that's what AC'97 specs require to be returned when unknown / undefined registers are read. Signed-off-by: Maciej S. Szmigiero &l

[PATCH] ASoC: fsl_ssi: call _fsl_ssi_set_dai_fmt() just once in AC'97 mode

2017-11-20 Thread Maciej S. Szmigiero
, this should be necessary only for the very first playback but let's play safe here and make sure that no extra slots are enabled every time a playback is started. Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- sound/soc/fsl/fsl_ssi.c | 20 1 file chang

Re: [alsa-devel] [PATCH 1/2] ASoC: fsl_ssi: AC'97 ops need regmap, clock and cleaning up on failure

2017-11-20 Thread Maciej S. Szmigiero
On 21.11.2017 01:32, Nicolin Chen wrote: > On Mon, Nov 20, 2017 at 11:14:55PM +0100, Maciej S. Szmigiero wrote: (..) >> @@ -1460,12 +1460,6 @@ static int fsl_ssi_probe(struct platform_device *pdev) >> sizeof(fsl_ssi_ac97_dai)); >> >>

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: call _fsl_ssi_set_dai_fmt() just once in AC'97 mode

2017-11-20 Thread Maciej S. Szmigiero
On 21.11.2017 01:00, Nicolin Chen wrote: > On Mon, Nov 20, 2017 at 11:13:45PM +0100, Maciej S. Szmigiero wrote: (..) >> We need to make sure, however, that only proper channel slots are enabled >> at playback start time since some AC'97 CODECs (like VT1613) were observed >> r

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: call _fsl_ssi_set_dai_fmt() just once in AC'97 mode

2017-11-21 Thread Maciej S. Szmigiero
On 21.11.2017 02:14, Nicolin Chen wrote: > On Tue, Nov 21, 2017 at 01:32:09AM +0100, Maciej S. Szmigiero wrote: >> On 21.11.2017 01:00, Nicolin Chen wrote: >>> On Mon, Nov 20, 2017 at 11:13:45PM +0100, Maciej S. Szmigiero wrote: >> (..) >>>> We need to make sur

Re: [alsa-devel] [PATCH 2/2] ASoC: fsl_ssi: serialize AC'97 register access operations

2017-11-21 Thread Maciej S. Szmigiero
On 21.11.2017 02:52, Nicolin Chen wrote: > On Mon, Nov 20, 2017 at 11:16:07PM +0100, Maciej S. Szmigiero wrote: (..) >> static unsigned short fsl_ssi_ac97_read(struct snd_ac97 *ac97, >> @@ -1287,16 +1295,18 @@ static unsigned short fsl_ssi_ac97_read(struct >> snd_ac97 *ac97,

[PATCH v2 2/2] ASoC: fsl_ssi: call _fsl_ssi_set_dai_fmt() just once in AC'97 mode

2017-11-21 Thread Maciej S. Szmigiero
S. Szmigiero <m...@maciej.szmigiero.name> --- Changes from v1: The SACCST setup code was split out into a separate commit. sound/soc/fsl/fsl_ssi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 375aaaf6080d..70df6bf832df

[PATCH v2 1/2] ASoC: fsl_ssi: only enable proper channel slots in AC'97 mode

2017-11-21 Thread Maciej S. Szmigiero
enabled mean ruined playback let's play safe here and make sure that no extra slots are enabled in SACCST every time a playback is started. Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> --- Changes from v1: Split out this part from "fsl_ssi: call _fsl_ssi_set_dai_fmt(

Re: [PATCH 00/10] ASoC: fsl_ssi: Clean up - coding style level

2017-12-05 Thread Maciej S. Szmigiero
On 05.12.2017 20:33, Nicolin Chen wrote: > On Tue, Dec 05, 2017 at 02:01:17PM +0100, Maciej S. Szmigiero wrote: > >>> ==Verification== >>> Theoretically, it only needs code review, build and sanity tests. I >>> have done build and sanity tests on an i.MX

Re: [PATCH 00/10] ASoC: fsl_ssi: Clean up - coding style level

2017-12-05 Thread Maciej S. Szmigiero
Hi Nicolin, On 04.12.2017 21:46, Nicolin Chen wrote: > ==Background== > The fsl_ssi driver was designed for PPC originally and then it has > been updated to support different modes for i.MX Series, including > SDMA, I2S Master mode, AC97 and older i.MXs with FIQ, by different > contributors for

Re: [PATCH v1 11/15] ASoC: fsl_ssi: Setup AC97 in dai_probe()

2018-01-04 Thread Maciej S. Szmigiero
On 04.01.2018 20:07, Nicolin Chen wrote: > On Mon, Jan 01, 2018 at 04:17:20PM +0100, Maciej S. Szmigiero wrote: >>> AC97 configures some registers earlier to start a communication >>> with CODECs, so this patch moves those register settings to the >>> dai_probe() as w

Re: [PATCH v4 16/17] ASoC: fsl_ssi: Move DT related code to a separate probe()

2018-01-16 Thread Maciej S. Szmigiero
On 16.01.2018 00:16, Nicolin Chen wrote: > This patch cleans up probe() function by moving all Device Tree > related code into a separate function. It allows the probe() to > be Device Tree independent. This will be very useful for future > integration of imx-ssi driver which has similar

Re: [PATCH v4 00/17] ASoC: fsl_ssi: Clean up - program flow level

2018-01-16 Thread Maciej S. Szmigiero
On 16.01.2018 00:16, Nicolin Chen wrote: > ==Change log== > v4 > * Reworked the series by taking suggestions from Maciej > + Added TXBIT0 bit back to play safe in PATCH-14 > + Made bool synchronous exclusive with AC97 mode in PATCH-16 > v3 > * Reworked the series by taking suggestions from

Re: [PATCH v4 13/17] ASoC: fsl_ssi: Setup AC97 in fsl_ssi_hw_init()

2018-01-16 Thread Maciej S. Szmigiero
On 16.01.2018 00:16, Nicolin Chen wrote: > AC97 configures most of registers earlier to start a communication > with CODECs in order to successfully initialize CODEC. Currently, > _fsl_ssi_set_dai_fmt() and fsl_ssi_setup_ac97() are called to get > all SSI registers properly set. > > Since now the

Re: [PATCH v4 00/17] ASoC: fsl_ssi: Clean up - program flow level

2018-01-16 Thread Maciej S. Szmigiero
On 17.01.2018 00:52, Nicolin Chen wrote: > On Wed, Jan 17, 2018 at 12:38:09AM +0100, Maciej S. Szmigiero wrote: > >>> Example of uncovered tests: AC97, PowerPC and FIQ. >> >> I've tested the whole series in the AC'97 mode on an i.MX6 UDOO board >> and everything

Re: [PATCH v5 00/17] ASoC: fsl_ssi: Clean up - program flow level

2018-01-17 Thread Maciej S. Szmigiero
ith foreground record (starting at different >time) via I2S Master and Slave mode > - Background record with foreground playback (starting at different >time) via I2S Master and Slave mode > * All tests above by hacking offline_config to true in imx51. > > Caleb has tested v1

Re: [PATCH v3 16/17] ASoC: fsl_ssi: Move DT related code to a separate probe()

2018-01-15 Thread Maciej S. Szmigiero
On 15.01.2018 05:21, Nicolin Chen wrote: > This patch cleans up probe() function by moving all Device Tree > related code into a separate function. It allows the probe() to > be Device Tree independent. This will be very useful for future > integration of imx-ssi driver which has similar

Re: [PATCH v3 14/17] ASoC: fsl_ssi: Clean up _fsl_ssi_set_dai_fmt()

2018-01-15 Thread Maciej S. Szmigiero
On 15.01.2018 05:21, Nicolin Chen wrote: > The _fsl_ssi_set_dai_fmt() is a helper function being called from > fsl_ssi_set_dai_fmt() as an ASoC operation and fsl_ssi_hw_init() > mainly for AC97 format initialization. > > This patch cleans the _fsl_ssi_set_dai_fmt() in following ways: > * Removing

Re: [PATCH v2 04/16] ASoC: fsl_ssi: Rename fsl_ssi_disable_val macro

2018-01-14 Thread Maciej S. Szmigiero
On 11.01.2018 07:43, Nicolin Chen wrote: > The define of fsl_ssi_disable_val is not so clear as it mixes two > steps of calculations together. And those parameter names are also > a bit long to read. > > Since it just tries to exclude the shared bits from the regvals of > current stream while the

Re: [PATCH v2 13/16] ASoC: fsl_ssi: Clean up _fsl_ssi_set_dai_fmt()

2018-01-14 Thread Maciej S. Szmigiero
On 11.01.2018 07:43, Nicolin Chen wrote: > The _fsl_ssi_set_dai_fmt() is a helper function being called from > fsl_ssi_set_dai_fmt() as an ASoC operation and fsl_ssi_hw_init() > mainly for AC97 format initialization. > > This patch cleans the _fsl_ssi_set_dai_fmt() in following ways: > * Removing

Re: [PATCH v2 14/16] ASoC: fsl_ssi: Remove cpu_dai_drv from fsl_ssi structure

2018-01-14 Thread Maciej S. Szmigiero
On 11.01.2018 07:43, Nicolin Chen wrote: > The cpu_dai_drv is only used for symmetric_rates. So this patch replaces > it with a synchronous boolean flag. You make cpu_dai_drv common to all SSI instances instead of per-instance. What if you have multiple SSIs in the system with different

Re: [PATCH v5 00/17] ASoC: fsl_ssi: Clean up - program flow level

2018-01-17 Thread Maciej S. Szmigiero
On 17.01.2018 21:02, Nicolin Chen wrote: > On Wed, Jan 17, 2018 at 08:38:48PM +0100, Maciej S. Szmigiero wrote: > >> However, I have a small nitpick regarding a comment newly added in >> this version of patch 16: >> +/* >> + * Do not set SSI d

Re: [PATCH v2 03/16] ASoC: fsl_ssi: Maintain a mask of active streams

2018-01-14 Thread Maciej S. Szmigiero
On 11.01.2018 07:43, Nicolin Chen wrote: > Checking TE and RE bits in SCR register doesn't work for AC97 mode > which enables SSIEN, TE and RE in the fsl_ssi_setup_ac97() that's > called during probe(). > > So when running into the trigger(), it will always get the result > of both TE and RE

Re: [PATCH v2 06/16] ASoC: fsl_ssi: Clean up helper functions of trigger()

2018-01-14 Thread Maciej S. Szmigiero
On 11.01.2018 07:43, Nicolin Chen wrote: > The trigger() calls fsl_ssi_tx_config() and fsl_ssi_rx_config(), > and both of them jump to fsl_ssi_config(). And fsl_ssi_config() > later calls another fsl_ssi_rxtx_config(). > > However, the whole routine, especially fsl_ssi_config() function, > is too

Re: [PATCH v1 03/15] ASoC: fsl_ssi: Rename fsl_ssi_disable_val macro

2018-01-01 Thread Maciej S. Szmigiero
On 19.12.2017 18:00, Nicolin Chen wrote: > The define of fsl_ssi_disable_val is not so clear as it mixes two > steps of calculations together. And those parameter names are also > a bit long to read. > > Since it just tries to exclude the shared bits from the regvals of > current stream while the

Re: [PATCH v1 05/15] ASoC: fsl_ssi: Clean up helper functions of trigger()

2018-01-01 Thread Maciej S. Szmigiero
On 19.12.2017 18:00, Nicolin Chen wrote: > The trigger() calls fsl_ssi_tx_config() and fsl_ssi_rx_config(), > and both of them jump to fsl_ssi_config(). And fsl_ssi_config() > later calls another fsl_ssi_rxtx_config(). > > However, the whole routine, especially fsl_ssi_config() function, > is too

Re: [PATCH v1 01/15] ASoC: fsl_ssi: Clean up set_dai_tdm_slot()

2018-01-01 Thread Maciej S. Szmigiero
On 19.12.2017 18:00, Nicolin Chen wrote: > This patch replaces the register read with ssi->i2s_net for > simplification. It also removes masking SSIEN from scr value > since it's handled later by regmap_update_bits() to set this > scr value back. > > Signed-off-by: Nicolin Chen

Re: [PATCH v1 11/15] ASoC: fsl_ssi: Setup AC97 in dai_probe()

2018-01-01 Thread Maciej S. Szmigiero
On 19.12.2017 18:00, Nicolin Chen wrote: > AC97 configures some registers earlier to start a communication > with CODECs, so this patch moves those register settings to the > dai_probe() as well, along with other register configurations. > > It also applies _fsl_ssi_set_dai_fmt() to AC97 only