Skip to content

Commit

Permalink
bcm2835-i2s: Reduce the TX DREQ threshold
Browse files Browse the repository at this point in the history
TX FIFO overrun is thought to be the cause of channel swapping, so
reducing the DREQ threshold seems reasonable and appears to be
effective.

See: raspberrypi#1417

Signed-off-by: Phil Elwell <[email protected]>
  • Loading branch information
Phil Elwell authored and popcornmix committed Aug 23, 2016
1 parent 224a465 commit 846ee11
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions sound/soc/bcm/bcm2835-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,22 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream,

/* Setup the DMA parameters */
regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_CS_A_REG,
BCM2835_I2S_RXTHR(1)
| BCM2835_I2S_TXTHR(1)
| BCM2835_I2S_DMAEN, 0xffffffff);
BCM2835_I2S_RXTHR(3)
| BCM2835_I2S_TXTHR(3)
| BCM2835_I2S_DMAEN,
BCM2835_I2S_RXTHR(1)
| BCM2835_I2S_TXTHR(1)
| BCM2835_I2S_DMAEN);

regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_DREQ_A_REG,
BCM2835_I2S_TX_PANIC(0x10)
| BCM2835_I2S_RX_PANIC(0x30)
| BCM2835_I2S_TX(0x30)
| BCM2835_I2S_RX(0x20), 0xffffffff);
BCM2835_I2S_TX_PANIC(0x7f)
| BCM2835_I2S_RX_PANIC(0x7f)
| BCM2835_I2S_TX(0x7f)
| BCM2835_I2S_RX(0x7f),
BCM2835_I2S_TX_PANIC(0x10)
| BCM2835_I2S_RX_PANIC(0x30)
| BCM2835_I2S_TX(0x20)
| BCM2835_I2S_RX(0x20));

/* Clear FIFOs */
bcm2835_i2s_clear_fifos(dev, true, true);
Expand Down

0 comments on commit 846ee11

Please sign in to comment.