0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From e27e038a64e9a3499f76e9581ea67b4b81a33555 Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Thu, 21 Apr 2016 15:44:14 +0100
  4. Subject: [PATCH] bcm2835-i2s: Reduce the TX DREQ threshold
  5. TX FIFO overrun is thought to be the cause of channel swapping, so
  6. reducing the DREQ threshold seems reasonable and appears to be
  7. effective.
  8. See: https://github.com/raspberrypi/linux/issues/1417
  9. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  10. ---
  11. sound/soc/bcm/bcm2835-i2s.c | 21 ++++++++++++++-------
  12. 1 file changed, 14 insertions(+), 7 deletions(-)
  13. --- a/sound/soc/bcm/bcm2835-i2s.c
  14. +++ b/sound/soc/bcm/bcm2835-i2s.c
  15. @@ -555,15 +555,22 @@ static int bcm2835_i2s_hw_params(struct
  16. /* Setup the DMA parameters */
  17. regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_CS_A_REG,
  18. - BCM2835_I2S_RXTHR(1)
  19. - | BCM2835_I2S_TXTHR(1)
  20. - | BCM2835_I2S_DMAEN, 0xffffffff);
  21. + BCM2835_I2S_RXTHR(3)
  22. + | BCM2835_I2S_TXTHR(3)
  23. + | BCM2835_I2S_DMAEN,
  24. + BCM2835_I2S_RXTHR(1)
  25. + | BCM2835_I2S_TXTHR(1)
  26. + | BCM2835_I2S_DMAEN);
  27. regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_DREQ_A_REG,
  28. - BCM2835_I2S_TX_PANIC(0x10)
  29. - | BCM2835_I2S_RX_PANIC(0x30)
  30. - | BCM2835_I2S_TX(0x30)
  31. - | BCM2835_I2S_RX(0x20), 0xffffffff);
  32. + BCM2835_I2S_TX_PANIC(0x7f)
  33. + | BCM2835_I2S_RX_PANIC(0x7f)
  34. + | BCM2835_I2S_TX(0x7f)
  35. + | BCM2835_I2S_RX(0x7f),
  36. + BCM2835_I2S_TX_PANIC(0x10)
  37. + | BCM2835_I2S_RX_PANIC(0x30)
  38. + | BCM2835_I2S_TX(0x20)
  39. + | BCM2835_I2S_RX(0x20));
  40. /* Clear FIFOs */
  41. bcm2835_i2s_clear_fifos(dev, true, true);