Re: [PATCH] ASoC: fsl_esai: Support synchronous mode

2019-04-02 Thread Nicolin Chen
> > On Mon, Apr 01, 2019 at 11:39:10AM +, S.j. Wang wrote: > > > In ESAI synchronous mode, the clock is generated by Tx, So we should > > > always set registers of Tx which relate with the bit clock and frame > > > clock generation (TCCR, TCR, ECR), even there is only Rx is working. > > > > > >

Re: [PATCH] ASoC: fsl_esai: Support synchronous mode

2019-04-01 Thread Nicolin Chen
Shengjiu, On Mon, Apr 01, 2019 at 11:39:10AM +, S.j. Wang wrote: > In ESAI synchronous mode, the clock is generated by Tx, So > we should always set registers of Tx which relate with the > bit clock and frame clock generation (TCCR, TCR, ECR), even > there is only Rx is working. > > Signed-of

Re: [PATCH V2] ASoC: fsl_asrc: add constraint for the asrc of older version

2019-03-01 Thread Nicolin Chen
And better to make it clear: /* Odd channel number is not valid for older ASRC (channel_bits==3) */ > + if (asrc_priv->channel_bits == 3) > + snd_pcm_hw_constraint_step(substream->runtime, 0, > + SNDRV_PCM_HW_PARAM_CHANNELS, 2); For your next version, Acked-by: Nicolin Chen Cheers

Re: [PATCH] ASoC: fsl_asrc: add protection for the asrc of older version

2019-03-01 Thread Nicolin Chen
On Fri, Mar 01, 2019 at 06:55:25AM +, S.j. Wang wrote: > > Alternatively, I feel instead of error-out at here, should we add a HW > > constraint or at least fence it off at the beginning of the hw_params()? > > This > > is actually nothing specific to the pair-request function but a hardware

Re: [PATCH] ASoC: cs42xx8: Remove S32_LE in format list

2019-02-28 Thread Nicolin Chen
Hi Shengjiu, On Thu, Feb 28, 2019 at 05:56:31AM +, S.j. Wang wrote: > cs42xx8 is a 24-bit A/D and 24-bit D/A device, so the S32_LE > should not be in the supported format list. > > Signed-off-by: Shengjiu Wang > --- > sound/soc/codecs/cs42xx8.c | 3 +-- This is for cs42xx8 codec driver, but

Re: [PATCH] ASoC: fsl_asrc: add protection for the asrc of older version

2019-02-28 Thread Nicolin Chen
Hi Shengjiu, On Fri, Mar 01, 2019 at 02:32:38AM +, S.j. Wang wrote: > There is a constraint for the channel number setting on the > asrc of older version (e.g. imx35), the channel number should > be even, odd number isn't valid. > > So add protection when the asrc of older version is used. >

Re: [PATCH V3] ASoC: fsl_esai: fix channel swap issue when stream starts

2019-02-26 Thread Nicolin Chen
fore xSMA. Apparently having this mask settings in the trigger() does not look very common, so I believe a line of comments would help a lot. You may add my Acked-by in your next version: Acked-by: Nicolin Chen Thanks > + regmap_update_bits(esai_priv->regmap, REG_ESAI_x

Re: [PATCH V2] ASoC: fsl_esai: fix channel swap issue when stream starts

2019-02-25 Thread Nicolin Chen
On Tue, Feb 26, 2019 at 02:01:14AM +, S.j. Wang wrote: > > > diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index > > > afe67c865330..23bd0ad4ac31 100644 > > > --- a/sound/soc/fsl/fsl_esai.c > > > +++ b/sound/soc/fsl/fsl_esai.c > > > @@ -54,6 +54,8 @@ struct fsl_esai { > > >

Re: [PATCH V2] ASoC: fsl_esai: fix channel swap issue when stream starts

2019-02-25 Thread Nicolin Chen
On Mon, Feb 25, 2019 at 02:48:18AM +, S.j. Wang wrote: > There is very low possibility ( < 0.1% ) that channel swap happened > in beginning when multi output/input pin is enabled. The issue is > that hardware can't send data to correct pin in the beginning with > the normal enable flow. > > Th

Re: [PATCH] ASoC: fsl_spdif: fix sysclk_df type

2019-02-19 Thread Nicolin Chen
On Mon, Feb 18, 2019 at 03:25:00PM +, Viorel Suman wrote: > According to RM SPDIF STC SYSCLK_DF field is 9-bit wide, values > being in 0..511 range. Use a proper type to handle sysclk_df. > > Signed-off-by: Viorel Suman Acked-by: Nicolin Chen > --- > sound/soc/fs

Re: [PATCH] ASoC: fsl_spdif: fix TXCLK_DF mask

2019-02-19 Thread Nicolin Chen
On Mon, Feb 18, 2019 at 02:12:17PM +, Viorel Suman wrote: > According to RM SPDIF TXCLK_DF mask is 7-bit wide. > > Signed-off-by: Viorel Suman Acked-by: Nicolin Chen > --- > sound/soc/fsl/fsl_spdif.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > di

Re: [PATCH v5 0/3] Add NXP AUDMIX device and machine drivers

2019-02-15 Thread Nicolin Chen
On Fri, Feb 15, 2019 at 02:01:32PM +, Viorel Suman wrote: > The patchset adds NXP Audio Mixer (AUDMIX) device and machine > drivers and related DT bindings documentation. For this series, Acked-by: Nicolin Chen And Rob gave his at the previous version already. Thanks. > Changes

Re: [PATCH] ASoC: fsl_esai: fix register setting issue in RIGHT_J mode

2019-02-15 Thread Nicolin Chen
On Fri, Feb 15, 2019 at 11:04:38AM +, S.j. Wang wrote: > The ESAI_xCR_xWA is xCR's bit, not the xCCR's bit, driver set it to > wrong register, correct it. > > Signed-off-by: Shengjiu Wang Would need this for stable kernel too. Ackedy-by: Nicolin Chen Thanks.

Re: [PATCH v3 2/4] ASoC: add fsl_audmix DT binding documentation

2019-01-25 Thread Nicolin Chen
On Thu, Jan 17, 2019 at 12:46:29PM +, Viorel Suman wrote: > + - dais : Must contain a list of phandles to AUDMIX connected > + DAIs. The current implementation requires two phandles > + to SAI interfaces to be provided, the first SAI in

Re: [PATCH v4 2/3] ASoC: add fsl_audmix DT binding documentation

2019-01-25 Thread Nicolin Chen
On Tue, Jan 22, 2019 at 11:14:27AM +, Viorel Suman wrote: > Add the DT binding documentation for NXP Audio Mixer > CPU DAI driver. > > Signed-off-by: Viorel Suman > --- > .../devicetree/bindings/sound/fsl,audmix.txt | 54 > ++ > 1 file changed, 54 insertions(+) >

Re: [PATCH v3 0/4] Add NXP AUDMIX device and machine drivers

2019-01-18 Thread Nicolin Chen
On Fri, Jan 18, 2019 at 01:16:24PM +, Viorel Suman wrote: > > > 1. Moved "dais" node from machine driver DTS node to device driver > > > DTS node > > >   as suggested by Rob. > > That was not what I suggested. You still have a virtual node which > > looks to me to be unnecessary. > > To me rem

Re: [PATCH v3 0/4] Add NXP AUDMIX device and machine drivers

2019-01-17 Thread Nicolin Chen
On Thu, Jan 17, 2019 at 02:22:18PM -0800, Nicolin Chen wrote: > On Thu, Jan 17, 2019 at 12:46:25PM +, Viorel Suman wrote: > > The patchset adds NXP Audio Mixer (AUDMIX) device and machine > > drivers and related DT bindings documentation. > > > > Changes since V

Re: [PATCH v3 0/4] Add NXP AUDMIX device and machine drivers

2019-01-17 Thread Nicolin Chen
tation. > > Viorel Suman (4): > ASoC: fsl: Add Audio Mixer CPU DAI driver > ASoC: add fsl_audmix DT binding documentation > ASoC: fsl: Add Audio Mixer machine driver > ASoC: add imx-audmix DT binding documentation Reviewed-by: Nicolin Chen

Re: [PATCH v2 0/4] Add NXP AUDMIX device and machine drivers

2019-01-11 Thread Nicolin Chen
t; ASoC: fsl: Add Audio Mixer CPU DAI driver > ASoC: add fsl_audmix DT binding documentation > ASoC: fsl: Add Audio Mixer machine driver > ASoC: add imx-audmix DT binding Documentation For this series, Acked-by: Nicolin Chen Thanks > > .../devicetree/bindings/sound/fs

Re: [RFC PATCH] ASoC: fsl: Add Audio Mixer CPU DAI driver

2019-01-03 Thread Nicolin Chen
Hi, On Thu, Jan 03, 2019 at 03:56:46PM +, Viorel Suman wrote: > > >  sound/soc/fsl/fsl_amix.c   | 554 > > > + > > >  sound/soc/fsl/fsl_amix.h   | 101 > > I aimn't against the naming here, but it seems to be AUDMIX in RM?

Re: [RFC PATCH] ASoC: fsl: Add Audio Mixer CPU DAI driver

2018-12-26 Thread Nicolin Chen
Hi Viorel, Sorry for the late response, having been on a long vacation. The code looks pretty clean. Just some small concerns/questions below. On Wed, Dec 19, 2018 at 12:30 AM Viorel Suman wrote: > > This patch implements Audio Mixer CPU DAI driver for NXP iMX8 SOCs. > The Audio Mixer is a on-c

Re: [PATCH] ASoC: Use of_node_name_eq for node name comparisons

2018-12-05 Thread Nicolin Chen
Hi Rob, On Thu, Dec 6, 2018 at 3:51 AM Rob Herring wrote: > > Convert string compares of DT node names to use of_node_name_eq helper > instead. This removes direct access to the node name pointer. > > For the FSL ASoC card, the full node names appear to be "ssi", "esai", > and "sai", so there's n

Re: [alsa-devel] [PATCH] ASoC: fsl_spdif: Use 64-bit arithmetic instead of 32-bit

2018-07-04 Thread Nicolin Chen
pe u64 (64 bits, unsigned) and the following > expression is currently being evaluated using 32-bit arithmetic: > > rate[index] * txclk_df * 64 > > Addresses-Coverity-ID: 1222129 ("Unintentional integer overflow") > Signed-off-by: Gustavo A. R. Silva Acked-by: Nic

[PATCH] ASoC: fsl_esai: Add freq check in set_dai_sysclk()

2018-04-08 Thread Nicolin Chen
The freq parameter indicates the physical frequency of an actual input clock or a desired frequency of an output clock for HCKT/R. It should never be passed 0. This might cause Division-by-zero. So this patch adds a check to fix it. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_esai.c | 6

[PATCH] ASoC: fsl_esai: Fix divisor calculation failure at lower ratio

2018-04-08 Thread Nicolin Chen
get the ratio. So a simple fix could be just to set PM directly instead of going into the loop-search. Reported-by: Marek Vasut Signed-off-by: Nicolin Chen Cc: Marek Vasut --- sound/soc/fsl/fsl_esai.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/fsl/fsl_esai.c b/sound

[PATCH] ASoC: fsl_ssi: Fix mode setting when changing channel number

2018-04-07 Thread Nicolin Chen
slot number for Normal-Mode-None-Net settings while mono audio cases still need 2 slots. So this patch can also fix it. And it adds an extra line of comments to declare ssi->i2s_net does not reflect the register value but merely the initial setting from the set_dai_fmt(). Reported-by: Mika Penttil

Re: [trivial PATCH V2] treewide: Align function definition open/close braces

2018-03-21 Thread Nicolin Chen
printk.c | 4 ++-- > lib/raid6/sse2.c | 14 +++--- For fsl_dma.c: > sound/soc/fsl/fsl_dma.c | 2 +- Acked-by: Nicolin Chen Thanks > 19 files changed, 28 insertions(+), 28 deletions(-) &g

[PATCH v6 17/17] ASoC: fsl_ssi: Use ssi->streams instead of reading register

2018-02-12 Thread Nicolin Chen
Since ssi->streams is being updated along with SCR register and its SSIEN bit, it's simpler to use it instead. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 7 +-- 1 file ch

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

2018-02-12 Thread Nicolin Chen
-DT cases. This patch also moves symmetric_channels of AC97 from the probe to the structure snd_soc_dai_driver for simplification. Additionally, since PowerPC and AC97 use the same pdev pointer to register a platform device, this patch also unifies related code. Signed-off-by: Nicolin Chen Tested

[PATCH v6 15/17] ASoC: fsl_ssi: Add bool synchronous to mark synchronous mode

2018-02-12 Thread Nicolin Chen
Using symmetric_rates in the cpu_dai_drv is a bit implicit, so this patch adds a bool synchronous instead. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 13 - 1 file changed, 8

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

2018-02-12 Thread Nicolin Chen
s for SND_SOC_DAIFMT_AC97 like others. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 74 +++-- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/soun

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

2018-02-12 Thread Nicolin Chen
bits for AC97 in the platform remote() function. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 33 +++-- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git

[PATCH v6 12/17] ASoC: fsl_ssi: Move one-time configurations to probe()

2018-02-12 Thread Nicolin Chen
The probe() could handle some one-time configurations since they will not be changed once being configured. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 39

[PATCH v6 11/17] ASoC: fsl_ssi: Use snd_soc_init_dma_data instead

2018-02-12 Thread Nicolin Chen
Since there is a helper function, use it to help readability. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc

[PATCH v6 10/17] ASoC: fsl_ssi: Set xFEN0 and xFEN1 together

2018-02-12 Thread Nicolin Chen
It'd be safer to enable both FIFOs for TX or RX at the same time. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --

[PATCH v6 09/17] ASoC: fsl_ssi: Clean up fsl_ssi_setup_regvals()

2018-02-12 Thread Nicolin Chen
This patch cleans fsl_ssi_setup_regvals() by following changes: 1) Moving DBG bits to the first lines. 2) Setting SSIE, RE/TE as default and cleaning it for AC97 Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc

[PATCH v6 08/17] ASoC: fsl_ssi: Add DAIFMT define for AC97

2018-02-12 Thread Nicolin Chen
The _fsl_ssi_set_dai_fmt() bypasses an undefined format for AC97 mode. However, it's not really necessary if AC97 has its complete format defined. So this patch adds a DAIFMT macro of complete format including a clock direction and polarity. Signed-off-by: Nicolin Chen Tested-by: Caleb

[PATCH v6 07/17] ASoC: fsl_ssi: Clean up helper functions of trigger()

2018-02-12 Thread Nicolin Chen
patch simplifies these helper functions with the following changes: - Changing to two helper functions of enable and disable instead of TX and RX. - Removing fsl_ssi_rxtx_config() by separately integrating it to two newly introduced enable & disable functions. Signed-off-by: Nicolin Chen Tested-

[PATCH v6 06/17] ASoC: fsl_ssi: Clear FIFO directly in fsl_ssi_config()

2018-02-12 Thread Nicolin Chen
the AC97 check. Note that SOR register is safe from offline_config HW limit. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 33 ++--- 1 file changed, 10 insertions

[PATCH v6 05/17] ASoC: fsl_ssi: Rename fsl_ssi_disable_val macro

2018-02-12 Thread Nicolin Chen
o use something like ssi_excl_shared_bits. This patch also bisects fsl_ssi_disable_val into two macros of two corresponding steps and then shortens its parameter names. It also updates callers in the fsl_ssi_config() accordingly. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Mac

[PATCH v6 04/17] ASoC: fsl_ssi: Maintain a mask of active streams

2018-02-12 Thread Nicolin Chen
here is no active stream. This patch fixes this issue by adding a variable to log the active streams manually. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 15 +++ 1 file changed, 11

[PATCH v6 01/17] ASoC: fsl_ssi: Redefine RX and TX macros

2018-02-12 Thread Nicolin Chen
limit their value within [0, 1]. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 4 sound/soc/fsl/fsl_ssi.h | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/s

[PATCH v6 03/17] ASoC: fsl_ssi: Clean up set_dai_tdm_slot()

2018-02-12 Thread Nicolin Chen
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 Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Rev

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

2018-02-12 Thread Nicolin Chen
rue in imx51. Caleb has tested all versions with TDM lookback tests on i.MX6. Maciej has tested v5 with AC97 tests on i.MX6. Example of uncovered tests: PowerPC and FIQ. Nicolin Chen (17): ASoC: fsl_ssi: Redefine RX and TX macros ASoC: fsl_ssi: Keep ssi->i2s_net updated ASoC: fsl_ssi: Clea

[PATCH v6 02/17] ASoC: fsl_ssi: Keep ssi->i2s_net updated

2018-02-12 Thread Nicolin Chen
up the ssi->i2s_net instead of reading the register. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- sound/soc/fsl/fsl_ssi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/f

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

2018-01-17 Thread Nicolin Chen
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 dev as the parent of AC97 CODEC device since > + * it does not hav

[PATCH v5 17/17] ASoC: fsl_ssi: Use ssi->streams instead of reading register

2018-01-16 Thread Nicolin Chen
Since ssi->streams is being updated along with SCR register and its SSIEN bit, it's simpler to use it instead. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl

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

2018-01-16 Thread Nicolin Chen
-DT cases. This patch also moves symmetric_channels of AC97 from the probe to the structure snd_soc_dai_driver for simplification. Additionally, since PowerPC and AC97 use the same pdev pointer to register a platform device, this patch also unifies related code. Signed-off-by: Nicolin Chen Tested

[PATCH v5 15/17] ASoC: fsl_ssi: Add bool synchronous to mark synchronous mode

2018-01-16 Thread Nicolin Chen
Using symmetric_rates in the cpu_dai_drv is a bit implicit, so this patch adds a bool synchronous instead. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v3 * Removed all cpu_dai_drv changes sound/soc/fsl/fsl_ssi.c | 13 - 1 file changed, 8 insertions(+), 5

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

2018-01-16 Thread Nicolin Chen
s for SND_SOC_DAIFMT_AC97 like others. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v4 * Added TXBIT0 bit back to play safe v3 * Put CBM_CFS behind the baudclk check to keep the same program flow as before sound/soc/fsl/fsl_ssi.c | 74 +++

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

2018-01-16 Thread Nicolin Chen
bits for AC97 in the platform remote() function. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v5 * Moved fsl_ssi_hw_clean() after unregister CODEC platform dev * For cleanup sequence, disabled TE and RE first while SSIEN at last v2 * Moved all to fsl_ssi_hw_init() in

[PATCH v5 12/17] ASoC: fsl_ssi: Move one-time configurations to probe()

2018-01-16 Thread Nicolin Chen
The probe() could handle some one-time configurations since they will not be changed once being configured. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v2 * Moved all to fsl_ssi_hw_init() in platform probe() sound/soc/fsl/fsl_ssi.c | 39

[PATCH v5 11/17] ASoC: fsl_ssi: Use snd_soc_init_dma_data instead

2018-01-16 Thread Nicolin Chen
Since there is a helper function, use it to help readability. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index ba06e94..e1fe511

[PATCH v5 10/17] ASoC: fsl_ssi: Set xFEN0 and xFEN1 together

2018-01-16 Thread Nicolin Chen
It'd be safer to enable both FIFOs for TX or RX at the same time. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index e5

[PATCH v5 09/17] ASoC: fsl_ssi: Clean up fsl_ssi_setup_regvals()

2018-01-16 Thread Nicolin Chen
This patch cleans fsl_ssi_setup_regvals() by following changes: 1) Moving DBG bits to the first lines. 2) Setting SSIE, RE/TE as default and cleaning it for AC97 Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 17 ++--- 1 file changed, 6 insertions

[PATCH v5 08/17] ASoC: fsl_ssi: Add DAIFMT define for AC97

2018-01-16 Thread Nicolin Chen
The _fsl_ssi_set_dai_fmt() bypasses an undefined format for AC97 mode. However, it's not really necessary if AC97 has its complete format defined. So this patch adds a DAIFMT macro of complete format including a clock direction and polarity. Signed-off-by: Nicolin Chen Tested-by: Caleb

[PATCH v5 07/17] ASoC: fsl_ssi: Clean up helper functions of trigger()

2018-01-16 Thread Nicolin Chen
patch simplifies these helper functions with the following changes: - Changing to two helper functions of enable and disable instead of TX and RX. - Removing fsl_ssi_rxtx_config() by separately integrating it to two newly introduced enable & disable functions. Signed-off-by: Nicolin Chen Tested-

[PATCH v5 06/17] ASoC: fsl_ssi: Clear FIFO directly in fsl_ssi_config()

2018-01-16 Thread Nicolin Chen
the AC97 check. Note that SOR register is safe from offline_config HW limit. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v3 * Replaced "bool dir" with "int dir" and "int adir" v2 * Replaced bool tx with bool dir

[PATCH v5 05/17] ASoC: fsl_ssi: Rename fsl_ssi_disable_val macro

2018-01-16 Thread Nicolin Chen
o use something like ssi_excl_shared_bits. This patch also bisects fsl_ssi_disable_val into two macros of two corresponding steps and then shortens its parameter names. It also updates callers in the fsl_ssi_config() accordingly. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changel

[PATCH v5 04/17] ASoC: fsl_ssi: Maintain a mask of active streams

2018-01-16 Thread Nicolin Chen
here is no active stream. This patch fixes this issue by adding a variable to log the active streams manually. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v3 * Replaced "bool dir" with "int dir" v2 * Replaced bool tx with bool dir sound/soc/fsl/fsl_ssi.

[PATCH v5 03/17] ASoC: fsl_ssi: Clean up set_dai_tdm_slot()

2018-01-16 Thread Nicolin Chen
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 Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 ++

[PATCH v5 02/17] ASoC: fsl_ssi: Keep ssi->i2s_net updated

2018-01-16 Thread Nicolin Chen
up the ssi->i2s_net instead of reading the register. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 001e453..9847a1d 1006

[PATCH v5 01/17] ASoC: fsl_ssi: Redefine RX and TX macros

2018-01-16 Thread Nicolin Chen
limit their value within [0, 1]. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 4 sound/soc/fsl/fsl_ssi.h | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index aecd00f..001e453 100644

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

2018-01-16 Thread Nicolin Chen
ime) 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-v4 with TDM lookback tests on i.MX6. Example of uncovered tests: AC97, Powe

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

2018-01-16 Thread Nicolin Chen
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 seems to work fine as long as few small changes are made > to patches 13 and 16.

[PATCH v4 17/17] ASoC: fsl_ssi: Use ssi->streams instead of reading register

2018-01-15 Thread Nicolin Chen
Since ssi->streams is being updated along with SCR register and its SSIEN bit, it's simpler to use it instead. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl

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

2018-01-15 Thread Nicolin Chen
-DT cases. This patch also moves symmetric_channels of AC97 from the probe to the structure snd_soc_dai_driver for simplification. Additionally, since PowerPC and AC97 use the same pdev pointer to register a platform device, this patch also unifies related code. Signed-off-by: Nicolin Chen Tested

[PATCH v4 15/17] ASoC: fsl_ssi: Add bool synchronous to mark synchronous mode

2018-01-15 Thread Nicolin Chen
Using symmetric_rates in the cpu_dai_drv is a bit implicit, so this patch adds a bool synchronous instead. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v3 * Removed all cpu_dai_drv changes in PATCH-15 sound/soc/fsl/fsl_ssi.c | 13 - 1 file changed, 8

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

2018-01-15 Thread Nicolin Chen
s for SND_SOC_DAIFMT_AC97 like others. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v4 * Added TXBIT0 bit back to play safe v3 * Put CBM_CFS behind the baudclk check to keep the same program flow as before sound/soc/fsl/fsl_ssi.c | 74 +++

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

2018-01-15 Thread Nicolin Chen
bits for AC97 in the platform remote() function. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v2 * Moved all to fsl_ssi_hw_init() in platform probe() * Added fsl_ssi_hw_clean() instead of dai remove() sound/soc/fsl/fsl_ssi.c | 26 -- 1 file changed

[PATCH v4 12/17] ASoC: fsl_ssi: Move one-time configurations to probe()

2018-01-15 Thread Nicolin Chen
The probe() could handle some one-time configurations since they will not be changed once being configured. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v2 * Moved all to fsl_ssi_hw_init() in platform probe() sound/soc/fsl/fsl_ssi.c | 39

[PATCH v4 11/17] ASoC: fsl_ssi: Use snd_soc_init_dma_data instead

2018-01-15 Thread Nicolin Chen
Since there is a helper function, use it to help readability. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index ba06e94..e1fe511

[PATCH v4 10/17] ASoC: fsl_ssi: Set xFEN0 and xFEN1 together

2018-01-15 Thread Nicolin Chen
It'd be safer to enable both FIFOs for TX or RX at the same time. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index e5

[PATCH v4 09/17] ASoC: fsl_ssi: Clean up fsl_ssi_setup_regvals()

2018-01-15 Thread Nicolin Chen
This patch cleans fsl_ssi_setup_regvals() by following changes: 1) Moving DBG bits to the first lines. 2) Setting SSIE, RE/TE as default and cleaning it for AC97 Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 17 ++--- 1 file changed, 6 insertions

[PATCH v4 08/17] ASoC: fsl_ssi: Add DAIFMT define for AC97

2018-01-15 Thread Nicolin Chen
The _fsl_ssi_set_dai_fmt() bypasses an undefined format for AC97 mode. However, it's not really necessary if AC97 has its complete format defined. So this patch adds a DAIFMT macro of complete format including a clock direction and polarity. Signed-off-by: Nicolin Chen Tested-by: Caleb

[PATCH v4 07/17] ASoC: fsl_ssi: Clean up helper functions of trigger()

2018-01-15 Thread Nicolin Chen
patch simplifies these helper functions with the following changes: - Changing to two helper functions of enable and disable instead of TX and RX. - Removing fsl_ssi_rxtx_config() by separately integrating it to two newly introduced enable & disable functions. Signed-off-by: Nicolin Chen Tested-

[PATCH v4 06/17] ASoC: fsl_ssi: Clear FIFO directly in fsl_ssi_config()

2018-01-15 Thread Nicolin Chen
the AC97 check. Note that SOR register is safe from offline_config HW limit. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v3 * Replaced "bool dir" with "int dir" and "int adir" v2 * Replaced bool tx with bool dir

[PATCH v4 05/17] ASoC: fsl_ssi: Rename fsl_ssi_disable_val macro

2018-01-15 Thread Nicolin Chen
o use something like ssi_excl_shared_bits. This patch also bisects fsl_ssi_disable_val into two macros of two corresponding steps and then shortens its parameter names. It also updates callers in the fsl_ssi_config() accordingly. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changel

[PATCH v4 04/17] ASoC: fsl_ssi: Maintain a mask of active streams

2018-01-15 Thread Nicolin Chen
here is no active stream. This patch fixes this issue by adding a variable to log the active streams manually. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v3 * Replaced "bool dir" with "int dir" v2 * Replaced bool tx with bool dir sound/soc/fsl/fsl_ssi.

[PATCH v4 03/17] ASoC: fsl_ssi: Clean up set_dai_tdm_slot()

2018-01-15 Thread Nicolin Chen
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 Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 ++

[PATCH v4 02/17] ASoC: fsl_ssi: Keep ssi->i2s_net updated

2018-01-15 Thread Nicolin Chen
up the ssi->i2s_net instead of reading the register. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 001e453..9847a1d 1006

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

2018-01-15 Thread Nicolin Chen
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 with TDM lookback tests on i.MX6. Example of uncovered tests: AC97, PowerPC and FIQ. Nicolin Chen

[PATCH v4 01/17] ASoC: fsl_ssi: Redefine RX and TX macros

2018-01-15 Thread Nicolin Chen
limit their value within [0, 1]. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 4 sound/soc/fsl/fsl_ssi.h | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index aecd00f..001e453 100644

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

2018-01-15 Thread Nicolin Chen
On Mon, Jan 15, 2018 at 10:16:28PM +0100, Maciej S. Szmigiero wrote: > > * Removing TXBIT0 configurations since this bit is set to 1 as its > > reset value and there is no use case so far to unset it. And it > > is safe to remove since regmap_update_bits() won't touch it. > > I didn't get any

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

2018-01-15 Thread Nicolin Chen
On Mon, Jan 15, 2018 at 10:16:39PM +0100, Maciej S. Szmigiero wrote: > > /* Check if being used in AC97 mode */ > > sprop = of_get_property(np, "fsl,mode", NULL); > > - if (sprop) { > > - if (!strcmp(sprop, "ac97-slave")) > > - ssi->dai_fmt = FSLSSI_AC97_DAIFM

[PATCH v3 17/17] ASoC: fsl_ssi: Use ssi->streams instead of reading register

2018-01-14 Thread Nicolin Chen
Since ssi->streams is being updated along with SCR register and its SSIEN bit, it's simpler to use it instead. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl

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

2018-01-14 Thread Nicolin Chen
-DT cases. This patch also moves symmetric_channels of AC97 from the probe to the structure snd_soc_dai_driver for simplification. Additionally, since PowerPC and AC97 use the same pdev pointer to register a platform device, this patch also unifies related code. Signed-off-by: Nicolin Chen Tested

[PATCH v3 15/17] ASoC: fsl_ssi: Add bool synchronous to mark synchronous mode

2018-01-14 Thread Nicolin Chen
Using symmetric_rates in the cpu_dai_drv is a bit implicit, so this patch adds a bool synchronous instead. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v3 * Removed all cpu_dai_drv changes in PATCH-15 sound/soc/fsl/fsl_ssi.c | 13 - 1 file changed, 8

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

2018-01-14 Thread Nicolin Chen
since regmap_update_bits() won't touch it. * Moving baudclk check to the switch-case routine to skip the I2S master check. And moving SxCCR.DC settings after baudclk check. * Adding format settings for SND_SOC_DAIFMT_AC97 like others. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog

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

2018-01-14 Thread Nicolin Chen
bits for AC97 in the platform remote() function. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v2 * Moved all to fsl_ssi_hw_init() in platform probe() * Added fsl_ssi_hw_clean() instead of dai remove() sound/soc/fsl/fsl_ssi.c | 26 -- 1 file changed

[PATCH v3 12/17] ASoC: fsl_ssi: Move one-time configurations to probe()

2018-01-14 Thread Nicolin Chen
The probe() could handle some one-time configurations since they will not be changed once being configured. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v2 * Moved all to fsl_ssi_hw_init() in platform probe() sound/soc/fsl/fsl_ssi.c | 39

[PATCH v3 11/17] ASoC: fsl_ssi: Use snd_soc_init_dma_data instead

2018-01-14 Thread Nicolin Chen
Since there is a helper function, use it to help readability. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index ba06e94..e1fe511

[PATCH v3 10/17] ASoC: fsl_ssi: Set xFEN0 and xFEN1 together

2018-01-14 Thread Nicolin Chen
It'd be safer to enable both FIFOs for TX or RX at the same time. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index e5

[PATCH v3 09/17] ASoC: fsl_ssi: Clean up fsl_ssi_setup_regvals()

2018-01-14 Thread Nicolin Chen
This patch cleans fsl_ssi_setup_regvals() by following changes: 1) Moving DBG bits to the first lines. 2) Setting SSIE, RE/TE as default and cleaning it for AC97 Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 17 ++--- 1 file changed, 6 insertions

[PATCH v3 08/17] ASoC: fsl_ssi: Add DAIFMT define for AC97

2018-01-14 Thread Nicolin Chen
The _fsl_ssi_set_dai_fmt() bypasses an undefined format for AC97 mode. However, it's not really necessary if AC97 has its complete format defined. So this patch adds a DAIFMT macro of complete format including a clock direction and polarity. Signed-off-by: Nicolin Chen Tested-by: Caleb

[PATCH v3 07/17] ASoC: fsl_ssi: Clean up helper functions of trigger()

2018-01-14 Thread Nicolin Chen
patch simplifies these helper functions with the following changes: - Changing to two helper functions of enable and disable instead of TX and RX. - Removing fsl_ssi_rxtx_config() by separately integrating it to two newly introduced enable & disable functions. Signed-off-by: Nicolin Chen Tested-

[PATCH v3 06/17] ASoC: fsl_ssi: Clear FIFO directly in fsl_ssi_config()

2018-01-14 Thread Nicolin Chen
the AC97 check. Note that SOR register is safe from offline_config HW limit. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v3 * Replaced "bool dir" with "int dir" and "int adir" v2 * Replaced bool tx with bool dir

[PATCH v3 05/17] ASoC: fsl_ssi: Rename fsl_ssi_disable_val macro

2018-01-14 Thread Nicolin Chen
o use something like ssi_excl_shared_bits. This patch also bisects fsl_ssi_disable_val into two macros of two corresponding steps and then shortens its parameter names. It also updates callers in the fsl_ssi_config() accordingly. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changel

[PATCH v3 04/17] ASoC: fsl_ssi: Maintain a mask of active streams

2018-01-14 Thread Nicolin Chen
here is no active stream. This patch fixes this issue by adding a variable to log the active streams manually. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- Changelog v3 * Replaced "bool dir" with "int dir" v2 * Replaced bool tx with bool dir sound/soc/fsl/fsl_ssi.

[PATCH v3 03/17] ASoC: fsl_ssi: Clean up set_dai_tdm_slot()

2018-01-14 Thread Nicolin Chen
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 Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 7 ++

<    1   2   3   4   5   6   7   8   >