ASoC: cirrus: Series of fixes for ep93xx-i2s
Subsystems (6)
Alexander Sverdlin
maintainercover ASoC: cirrus: Series of fixes for ep93xx-i2s
This series is a result of long-running debugging of rarely screwed I2S stream out of EP9302 chip. Logic analyser shows that the stream is shifted by one byte (out of 32 bits per sample) which leads to noise intead of original stream.
DMA is verified to work fine (no underrun). The issue is only reproducible under high load (CPU or AMBA bus -- not yet clear). This stream corruption happens at the same time I2S controller reports internal FIFO underrun (even though according to documentation, it should handle an underrun gracefully).
First two patches are fixing unrelated issues in I2S driver found during debugging of the stream shift. Third one is simplification of the driver to prepare for workaround.
Both controller configuration options for TX FIFO underrun handling were tested, both do not work reliable. Hence, this ugly watchdog in the last patch.
The whole series is tested on a board similar to EDB9302 (identical in sound part).
Alexander Sverdlin (5):
ASoC: cirrus: i2s: Fix LRCLK configuration
ASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup
ASoC: cirrus: i2s: Stop enabling I2S2 and I2S3 FIFOs
ARM: ep93xx: i2s: Add IRQ to platform device resources
ASoC: cirrus: i2s: IRQ-based stream watchdog
arch/arm/mach-ep93xx/core.c | 1 + sound/soc/cirrus/Kconfig | 17 +++++++ sound/soc/cirrus/edb93xx.c | 2 +- sound/soc/cirrus/ep93xx-i2s.c | 106 +++++++++++++++++++++++++++++++++-------- sound/soc/cirrus/snappercl15.c | 2 +- 5 files changed, 106 insertions(+), 22 deletions(-)
Signature · 1 line
2.16.2
Alexander Sverdlin
maintainerPATCH 1/5 ASoC: cirrus: i2s: Fix LRCLK configuration
The bit responsible for LRCLK polarity is i2s_tlrs (0), not i2s_trel (2) (refer to "EP93xx User's Guide").
Previously card drivers which specified SND_SOC_DAIFMT_NB_IF actually got SND_SOC_DAIFMT_NB_NF, an adaptation is necessary to retain the old behavior.
--- sound/soc/cirrus/edb93xx.c | 2 +- sound/soc/cirrus/ep93xx-i2s.c | 8 ++++---- sound/soc/cirrus/snappercl15.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
sound/soc/cirrus/edb93xx.c +1 -1
@@ -67,7 +67,7 @@ static struct snd_soc_dai_link edb93xx_dai = { .cpu_dai_name = "ep93xx-i2s", .codec_name = "spi0.0", .codec_dai_name = "cs4271-hifi", - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .ops = &edb93xx_ops, };
sound/soc/cirrus/ep93xx-i2s.c +4 -4
@@ -213,24 +213,24 @@ static int ep93xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,switch (fmt &SND_SOC_DAIFMT_INV_MASK ) {case SND_SOC_DAIFMT_NB_NF :/* Negative bit clock, lrclk low on left word */ - clk_cfg &= ~(EP93XX_I2S_CLKCFG_CKP |EP93XX_I2S_CLKCFG_REL ); + clk_cfg &= ~(EP93XX_I2S_CLKCFG_CKP |EP93XX_I2S_CLKCFG_LRS );break ;case SND_SOC_DAIFMT_NB_IF :/* Negative bit clock, lrclk low on right word */ clk_cfg &= ~EP93XX_I2S_CLKCFG_CKP ; - clk_cfg |=EP93XX_I2S_CLKCFG_REL ; + clk_cfg |=EP93XX_I2S_CLKCFG_LRS ;break ;case SND_SOC_DAIFMT_IB_NF :/* Positive bit clock, lrclk low on left word */ clk_cfg |=EP93XX_I2S_CLKCFG_CKP ; - clk_cfg &= ~EP93XX_I2S_CLKCFG_REL ; + clk_cfg &= ~EP93XX_I2S_CLKCFG_LRS ;break ;case SND_SOC_DAIFMT_IB_IF :/* Positive bit clock, lrclk low on right word */ - clk_cfg |=EP93XX_I2S_CLKCFG_CKP |EP93XX_I2S_CLKCFG_REL ; + clk_cfg |=EP93XX_I2S_CLKCFG_CKP |EP93XX_I2S_CLKCFG_LRS ;break ; }
sound/soc/cirrus/snappercl15.c +1 -1
@@ -72,7 +72,7 @@ static struct snd_soc_dai_link snappercl15_dai = { .codec_dai_name = "tlv320aic23-hifi", .codec_name = "tlv320aic23-codec.0-001a", .platform_name = "ep93xx-i2s", - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .ops = &snappercl15_ops, };
Signature · 1 line
2.16.2
Mark Brown
maintainerApplied "ASoC: cirrus: i2s: Fix LRCLK configuration" to the asoc tree
The patch
ASoC: cirrus: i2s: Fix LRCLK configuration
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
2d534113be9a2aa532a1ae127a57e83558aed358Mon Sep 17 00:00:00 2001
From: Alexander Sverdlin <[email protected]>
Date: Sat, 28 Apr 2018 22:51:38 +0200
Subject: [PATCH] ASoC: cirrus: i2s: Fix LRCLK configuration
The bit responsible for LRCLK polarity is i2s_tlrs (0), not i2s_trel (2) (refer to "EP93xx User's Guide").
Previously card drivers which specified SND_SOC_DAIFMT_NB_IF actually got SND_SOC_DAIFMT_NB_NF, an adaptation is necessary to retain the old behavior.
--- sound/soc/cirrus/edb93xx.c | 2 +- sound/soc/cirrus/ep93xx-i2s.c | 8 ++++---- sound/soc/cirrus/snappercl15.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
sound/soc/cirrus/edb93xx.c +1 -1
@@ -67,7 +67,7 @@ static struct snd_soc_dai_link edb93xx_dai = { .cpu_dai_name = "ep93xx-i2s", .codec_name = "spi0.0", .codec_dai_name = "cs4271-hifi", - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .ops = &edb93xx_ops, };
sound/soc/cirrus/ep93xx-i2s.c +4 -4
@@ -213,24 +213,24 @@ static int ep93xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,switch (fmt &SND_SOC_DAIFMT_INV_MASK ) {case SND_SOC_DAIFMT_NB_NF :/* Negative bit clock, lrclk low on left word */ - clk_cfg &= ~(EP93XX_I2S_CLKCFG_CKP |EP93XX_I2S_CLKCFG_REL ); + clk_cfg &= ~(EP93XX_I2S_CLKCFG_CKP |EP93XX_I2S_CLKCFG_LRS );break ;case SND_SOC_DAIFMT_NB_IF :/* Negative bit clock, lrclk low on right word */ clk_cfg &= ~EP93XX_I2S_CLKCFG_CKP ; - clk_cfg |=EP93XX_I2S_CLKCFG_REL ; + clk_cfg |=EP93XX_I2S_CLKCFG_LRS ;break ;case SND_SOC_DAIFMT_IB_NF :/* Positive bit clock, lrclk low on left word */ clk_cfg |=EP93XX_I2S_CLKCFG_CKP ; - clk_cfg &= ~EP93XX_I2S_CLKCFG_REL ; + clk_cfg &= ~EP93XX_I2S_CLKCFG_LRS ;break ;case SND_SOC_DAIFMT_IB_IF :/* Positive bit clock, lrclk low on right word */ - clk_cfg |=EP93XX_I2S_CLKCFG_CKP |EP93XX_I2S_CLKCFG_REL ; + clk_cfg |=EP93XX_I2S_CLKCFG_CKP |EP93XX_I2S_CLKCFG_LRS ;break ; }
sound/soc/cirrus/snappercl15.c +1 -1
@@ -72,7 +72,7 @@ static struct snd_soc_dai_link snappercl15_dai = { .codec_dai_name = "tlv320aic23-hifi", .codec_name = "tlv320aic23-codec.0-001a", .platform_name = "ep93xx-i2s", - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .ops = &snappercl15_ops, };
Signature · 1 line
2.17.0
Alexander Sverdlin
maintainerPATCH 2/5 ASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup
In reply to Alexander SverdlinAccording to "EP93xx User’s Guide", I2STXLinCtrlData and I2SRXLinCtrlData registers actually have different format. The only currently used bit (Left_Right_Justify) has different position. Fix this and simplify the whole setup taking into account the fact that both registers have zero default value.
The practical effect of the above is repaired SND_SOC_DAIFMT_RIGHT_J support (currently unused).
--- sound/soc/cirrus/ep93xx-i2s.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
sound/soc/cirrus/ep93xx-i2s.c +10 -8
@@ -51,7 +51,9 @@#define EP93XX_I2S_WRDLEN_24 (1 << 0)#define EP93XX_I2S_WRDLEN_32 (2 << 0) -#define EP93XX_I2S_LINCTRLDATA_R_JUST (1 << 2)/* Right justify */ +#define EP93XX_I2S_RXLINCTRLDATA_R_JUST BIT(1)/* Right justify */ + +#define EP93XX_I2S_TXLINCTRLDATA_R_JUST BIT(2)/* Right justify */ #define EP93XX_I2S_CLKCFG_LRS (1 << 0)/* lrclk polarity */ #define EP93XX_I2S_CLKCFG_CKP (1 << 1)/* Bit clock polarity */
@@ -170,25 +172,25 @@ static int ep93xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) {struct ep93xx_i2s_info *info =snd_soc_dai_get_drvdata (cpu_dai); -unsigned int clk_cfg, lin_ctrl; +unsigned int clk_cfg; +unsigned int txlin_ctrl =0 ; +unsigned int rxlin_ctrl =0 ; clk_cfg =ep93xx_i2s_read_reg (info,EP93XX_I2S_RXCLKCFG ); - lin_ctrl =ep93xx_i2s_read_reg (info,EP93XX_I2S_RXLINCTRLDATA );switch (fmt &SND_SOC_DAIFMT_FORMAT_MASK ) {case SND_SOC_DAIFMT_I2S : clk_cfg |=EP93XX_I2S_CLKCFG_REL ; - lin_ctrl &= ~EP93XX_I2S_LINCTRLDATA_R_JUST ;break ;case SND_SOC_DAIFMT_LEFT_J : clk_cfg &= ~EP93XX_I2S_CLKCFG_REL ; - lin_ctrl &= ~EP93XX_I2S_LINCTRLDATA_R_JUST ;break ;case SND_SOC_DAIFMT_RIGHT_J : clk_cfg &= ~EP93XX_I2S_CLKCFG_REL ; - lin_ctrl |=EP93XX_I2S_LINCTRLDATA_R_JUST ; + rxlin_ctrl |=EP93XX_I2S_RXLINCTRLDATA_R_JUST ; + txlin_ctrl |=EP93XX_I2S_TXLINCTRLDATA_R_JUST ;break ;default :
@@ -237,8 +239,8 @@ static int ep93xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,/* Write new register values */ ep93xx_i2s_write_reg (info,EP93XX_I2S_RXCLKCFG , clk_cfg);ep93xx_i2s_write_reg (info,EP93XX_I2S_TXCLKCFG , clk_cfg); -ep93xx_i2s_write_reg (info,EP93XX_I2S_RXLINCTRLDATA , lin_ctrl); -ep93xx_i2s_write_reg (info,EP93XX_I2S_TXLINCTRLDATA , lin_ctrl); +ep93xx_i2s_write_reg (info,EP93XX_I2S_RXLINCTRLDATA , rxlin_ctrl); +ep93xx_i2s_write_reg (info,EP93XX_I2S_TXLINCTRLDATA , txlin_ctrl);return 0 ; }
Signature · 7 lines
2.16.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown
maintainerApplied "ASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup" to the asoc tree
The patch
ASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
5d302ed3cc80564fb835bed5fdba1e1250ecc9e5Mon Sep 17 00:00:00 2001
From: Alexander Sverdlin <[email protected]>
Date: Sat, 28 Apr 2018 22:51:39 +0200
Subject: [PATCH] ASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
According to "EP93xx User???s Guide", I2STXLinCtrlData and I2SRXLinCtrlData registers actually have different format. The only currently used bit (Left_Right_Justify) has different position. Fix this and simplify the whole setup taking into account the fact that both registers have zero default value.
The practical effect of the above is repaired SND_SOC_DAIFMT_RIGHT_J support (currently unused).
--- sound/soc/cirrus/ep93xx-i2s.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
sound/soc/cirrus/ep93xx-i2s.c +10 -8
@@ -51,7 +51,9 @@#define EP93XX_I2S_WRDLEN_24 (1 << 0)#define EP93XX_I2S_WRDLEN_32 (2 << 0) -#define EP93XX_I2S_LINCTRLDATA_R_JUST (1 << 2)/* Right justify */ +#define EP93XX_I2S_RXLINCTRLDATA_R_JUST BIT(1)/* Right justify */ + +#define EP93XX_I2S_TXLINCTRLDATA_R_JUST BIT(2)/* Right justify */ #define EP93XX_I2S_CLKCFG_LRS (1 << 0)/* lrclk polarity */ #define EP93XX_I2S_CLKCFG_CKP (1 << 1)/* Bit clock polarity */
@@ -170,25 +172,25 @@ static int ep93xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) {struct ep93xx_i2s_info *info =snd_soc_dai_get_drvdata (cpu_dai); -unsigned int clk_cfg, lin_ctrl; +unsigned int clk_cfg; +unsigned int txlin_ctrl =0 ; +unsigned int rxlin_ctrl =0 ; clk_cfg =ep93xx_i2s_read_reg (info,EP93XX_I2S_RXCLKCFG ); - lin_ctrl =ep93xx_i2s_read_reg (info,EP93XX_I2S_RXLINCTRLDATA );switch (fmt &SND_SOC_DAIFMT_FORMAT_MASK ) {case SND_SOC_DAIFMT_I2S : clk_cfg |=EP93XX_I2S_CLKCFG_REL ; - lin_ctrl &= ~EP93XX_I2S_LINCTRLDATA_R_JUST ;break ;case SND_SOC_DAIFMT_LEFT_J : clk_cfg &= ~EP93XX_I2S_CLKCFG_REL ; - lin_ctrl &= ~EP93XX_I2S_LINCTRLDATA_R_JUST ;break ;case SND_SOC_DAIFMT_RIGHT_J : clk_cfg &= ~EP93XX_I2S_CLKCFG_REL ; - lin_ctrl |=EP93XX_I2S_LINCTRLDATA_R_JUST ; + rxlin_ctrl |=EP93XX_I2S_RXLINCTRLDATA_R_JUST ; + txlin_ctrl |=EP93XX_I2S_TXLINCTRLDATA_R_JUST ;break ;default :
@@ -237,8 +239,8 @@ static int ep93xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,/* Write new register values */ ep93xx_i2s_write_reg (info,EP93XX_I2S_RXCLKCFG , clk_cfg);ep93xx_i2s_write_reg (info,EP93XX_I2S_TXCLKCFG , clk_cfg); -ep93xx_i2s_write_reg (info,EP93XX_I2S_RXLINCTRLDATA , lin_ctrl); -ep93xx_i2s_write_reg (info,EP93XX_I2S_TXLINCTRLDATA , lin_ctrl); +ep93xx_i2s_write_reg (info,EP93XX_I2S_RXLINCTRLDATA , rxlin_ctrl); +ep93xx_i2s_write_reg (info,EP93XX_I2S_TXLINCTRLDATA , txlin_ctrl);return 0 ; }
Signature · 1 line
2.17.0
Alexander Sverdlin
maintainerPATCH 3/5 ASoC: cirrus: i2s: Stop enabling I2S2 and I2S3 FIFOs
In reply to Alexander SverdlinThe driver never supported more than 2 channels because of ep93xx_i2s_dma_data[] supporting only 1 DMA channel in each direction.
Stop enabling two unused I2S controller FIFOs, this will simplify future interrupt support.
--- sound/soc/cirrus/ep93xx-i2s.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
sound/soc/cirrus/ep93xx-i2s.c +4 -8
@@ -98,7 +98,6 @@ static inline unsigned ep93xx_i2s_read_reg(struct ep93xx_i2s_info *info,static void ep93xx_i2s_enable (struct ep93xx_i2s_info *info,int stream) {unsigned base_reg; -int i;if ((ep93xx_i2s_read_reg (info,EP93XX_I2S_TX0EN ) &0x1 ) ==0 && (ep93xx_i2s_read_reg (info,EP93XX_I2S_RX0EN ) &0x1 ) ==0 ) {
@@ -111,27 +110,24 @@ static void ep93xx_i2s_enable(struct ep93xx_i2s_info *info, int stream)ep93xx_i2s_write_reg (info,EP93XX_I2S_GLCTRL ,1 ); } -/* Enable fifos */ +/* Enable fifo */ if (stream ==SNDRV_PCM_STREAM_PLAYBACK ) base_reg =EP93XX_I2S_TX0EN ;else base_reg =EP93XX_I2S_RX0EN ; -for (i =0 ; i <3 ; i++) -ep93xx_i2s_write_reg (info, base_reg + (i *4 ),1 ); +ep93xx_i2s_write_reg (info, base_reg,1 ); }static void ep93xx_i2s_disable (struct ep93xx_i2s_info *info,int stream) {unsigned base_reg; -int i; -/* Disable fifos */ +/* Disable fifo */ if (stream ==SNDRV_PCM_STREAM_PLAYBACK ) base_reg =EP93XX_I2S_TX0EN ;else base_reg =EP93XX_I2S_RX0EN ; -for (i =0 ; i <3 ; i++) -ep93xx_i2s_write_reg (info, base_reg + (i *4 ),0 ); +ep93xx_i2s_write_reg (info, base_reg,0 );if ((ep93xx_i2s_read_reg (info,EP93XX_I2S_TX0EN ) &0x1 ) ==0 && (ep93xx_i2s_read_reg (info,EP93XX_I2S_RX0EN ) &0x1 ) ==0 ) {
Signature · 1 line
2.16.2
Mark Brown
maintainerApplied "ASoC: cirrus: i2s: Stop enabling I2S2 and I2S3 FIFOs" to the asoc tree
The patch
ASoC: cirrus: i2s: Stop enabling I2S2 and I2S3 FIFOs
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
cc27062b3eee3beb2e3830641b23ba9a52a8a04aMon Sep 17 00:00:00 2001
From: Alexander Sverdlin <[email protected]>
Date: Sat, 28 Apr 2018 22:51:40 +0200
Subject: [PATCH] ASoC: cirrus: i2s: Stop enabling I2S2 and I2S3 FIFOs
The driver never supported more than 2 channels because of ep93xx_i2s_dma_data[] supporting only 1 DMA channel in each direction.
Stop enabling two unused I2S controller FIFOs, this will simplify future interrupt support.
--- sound/soc/cirrus/ep93xx-i2s.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
sound/soc/cirrus/ep93xx-i2s.c +4 -8
@@ -98,7 +98,6 @@ static inline unsigned ep93xx_i2s_read_reg(struct ep93xx_i2s_info *info,static void ep93xx_i2s_enable (struct ep93xx_i2s_info *info,int stream) {unsigned base_reg; -int i;if ((ep93xx_i2s_read_reg (info,EP93XX_I2S_TX0EN ) &0x1 ) ==0 && (ep93xx_i2s_read_reg (info,EP93XX_I2S_RX0EN ) &0x1 ) ==0 ) {
@@ -111,27 +110,24 @@ static void ep93xx_i2s_enable(struct ep93xx_i2s_info *info, int stream)ep93xx_i2s_write_reg (info,EP93XX_I2S_GLCTRL ,1 ); } -/* Enable fifos */ +/* Enable fifo */ if (stream ==SNDRV_PCM_STREAM_PLAYBACK ) base_reg =EP93XX_I2S_TX0EN ;else base_reg =EP93XX_I2S_RX0EN ; -for (i =0 ; i <3 ; i++) -ep93xx_i2s_write_reg (info, base_reg + (i *4 ),1 ); +ep93xx_i2s_write_reg (info, base_reg,1 ); }static void ep93xx_i2s_disable (struct ep93xx_i2s_info *info,int stream) {unsigned base_reg; -int i; -/* Disable fifos */ +/* Disable fifo */ if (stream ==SNDRV_PCM_STREAM_PLAYBACK ) base_reg =EP93XX_I2S_TX0EN ;else base_reg =EP93XX_I2S_RX0EN ; -for (i =0 ; i <3 ; i++) -ep93xx_i2s_write_reg (info, base_reg + (i *4 ),0 ); +ep93xx_i2s_write_reg (info, base_reg,0 );if ((ep93xx_i2s_read_reg (info,EP93XX_I2S_TX0EN ) &0x1 ) ==0 && (ep93xx_i2s_read_reg (info,EP93XX_I2S_RX0EN ) &0x1 ) ==0 ) {
Signature · 1 line
2.17.0
Alexander Sverdlin
maintainerPATCH 4/5 ARM: ep93xx: i2s: Add IRQ to platform device resources
In reply to Alexander SverdlinAccording to "EP93xx User’s Guide" it's called I2SINTR and has number 60.
--- arch/arm/mach-ep93xx/core.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-ep93xx/core.c +1 -0
@@ -635,6 +635,7 @@ EXPORT_SYMBOL(ep93xx_keypad_release_gpio);*************************************************************************/ static struct resource ep93xx_i2s_resource[] = {DEFINE_RES_MEM (EP93XX_I2S_PHYS_BASE ,0x100 ), +DEFINE_RES_IRQ (IRQ_EP93XX_SAI ), };static struct platform_device ep93xx_i2s_device = {
Signature · 7 lines
2.16.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown
maintainerApplied "ARM: ep93xx: i2s: Add IRQ to platform device resources" to the asoc tree
The patch
ARM: ep93xx: i2s: Add IRQ to platform device resources
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
6ea8a84806ac91809e1759a200bf3c272b12aeb9Mon Sep 17 00:00:00 2001
From: Alexander Sverdlin <[email protected]>
Date: Sat, 28 Apr 2018 22:51:41 +0200
Subject: [PATCH] ARM: ep93xx: i2s: Add IRQ to platform device resources
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
According to "EP93xx User???s Guide" it's called I2SINTR and has number 60.
--- arch/arm/mach-ep93xx/core.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-ep93xx/core.c +1 -0
@@ -635,6 +635,7 @@ EXPORT_SYMBOL(ep93xx_keypad_release_gpio);*************************************************************************/ static struct resource ep93xx_i2s_resource[] = {DEFINE_RES_MEM (EP93XX_I2S_PHYS_BASE ,0x100 ), +DEFINE_RES_IRQ (IRQ_EP93XX_SAI ), };static struct platform_device ep93xx_i2s_device = {
Signature · 1 line
2.17.0
Alexander Sverdlin
maintainerPATCH 5/5 ASoC: cirrus: i2s: IRQ-based stream watchdog
In reply to Alexander SverdlinI2S controller on EP93xx seems to have undocumented HW issue. According to "EP93xx User’s Guide", controller can handle underflow and either transmit last sample or zeroes in such case until FIFO is filled again. In reality undeflow conditions seem to confuse internal state machine from time to time and the whole stream gets shifted by one byte (as captured by logic analyser on the I2S outputs). One could only hear noise instead of original stream and this continues until the FIFO is disabled and enabled again.
Work this around by watching underflow interrupt and resetting I2S TX channel + fill FIFO with zero samples until DMA catches up again. This is a nasty workaround, but it works. Hence, Kconfig option to disable it in case of problems.
--- sound/soc/cirrus/Kconfig | 17 +++++++++++ sound/soc/cirrus/ep93xx-i2s.c | 68 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+)
sound/soc/cirrus/Kconfig +17 -0
@@ -9,6 +9,23 @@ config SND_EP93XX_SOC config SND_EP93XX_SOC_I2S tristate +if SND_EP93XX_SOC_I2S + +config SND_EP93XX_SOC_I2S_WATCHDOG + bool "IRQ based underflow watchdog workaround" + default y + help + I2S controller on EP93xx seems to have undocumented HW issue. + Underflow of internal I2S controller FIFO could confuse the + state machine and the whole stream can be shifted by one byte + until I2S is disabled. This option enables IRQ based watchdog + which disables and re-enables I2S in case of underflow and + fills FIFO with zeroes. + + If you are unsure how to answer this question, answer Y. + +endif # if SND_EP93XX_SOC_I2S + config SND_EP93XX_SOC_AC97 tristate select AC97_BUS
sound/soc/cirrus/ep93xx-i2s.c +68 -0
112 lines not on this page · raw message
Signature · 7 lines
2.16.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown
maintainerApplied "ASoC: cirrus: i2s: IRQ-based stream watchdog" to the asoc tree
The patch
ASoC: cirrus: i2s: IRQ-based stream watchdog
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
98e1241c357b82e070294f486cef91a1263874faMon Sep 17 00:00:00 2001
From: Alexander Sverdlin <[email protected]>
Date: Sat, 28 Apr 2018 22:51:42 +0200
Subject: [PATCH] ASoC: cirrus: i2s: IRQ-based stream watchdog
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
I2S controller on EP93xx seems to have undocumented HW issue. According to "EP93xx User???s Guide", controller can handle underflow and either transmit last sample or zeroes in such case until FIFO is filled again. In reality undeflow conditions seem to confuse internal state machine from time to time and the whole stream gets shifted by one byte (as captured by logic analyser on the I2S outputs). One could only hear noise instead of original stream and this continues until the FIFO is disabled and enabled again.
Work this around by watching underflow interrupt and resetting I2S TX channel + fill FIFO with zero samples until DMA catches up again. This is a nasty workaround, but it works. Hence, Kconfig option to disable it in case of problems.
--- sound/soc/cirrus/Kconfig | 17 +++++++++ sound/soc/cirrus/ep93xx-i2s.c | 68 +++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+)
sound/soc/cirrus/Kconfig +17 -0
@@ -9,6 +9,23 @@ config SND_EP93XX_SOC config SND_EP93XX_SOC_I2S tristate +if SND_EP93XX_SOC_I2S + +config SND_EP93XX_SOC_I2S_WATCHDOG + bool "IRQ based underflow watchdog workaround" + default y + help + I2S controller on EP93xx seems to have undocumented HW issue. + Underflow of internal I2S controller FIFO could confuse the + state machine and the whole stream can be shifted by one byte + until I2S is disabled. This option enables IRQ based watchdog + which disables and re-enables I2S in case of underflow and + fills FIFO with zeroes. + + If you are unsure how to answer this question, answer Y. + +endif # if SND_EP93XX_SOC_I2S + config SND_EP93XX_SOC_AC97 tristate select AC97_BUS
sound/soc/cirrus/ep93xx-i2s.c +68 -0
112 lines not on this page · raw message
Signature · 1 line
2.17.0