brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch
1 From 5178a5d56cff7e0db126a456355a710782d51ba8 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
6 TX FIFO overrun is thought to be the cause of channel swapping, so
7 reducing the DREQ threshold seems reasonable and appears to be
8 effective.
9
10 See: https://github.com/raspberrypi/linux/issues/1417
11
12 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
13 ---
14 sound/soc/bcm/bcm2835-i2s.c | 21 ++++++++++++++-------
15 1 file changed, 14 insertions(+), 7 deletions(-)
16
17 --- a/sound/soc/bcm/bcm2835-i2s.c
18 +++ b/sound/soc/bcm/bcm2835-i2s.c
19 @@ -555,15 +555,22 @@ static int bcm2835_i2s_hw_params(struct
20
21 /* Setup the DMA parameters */
22 regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_CS_A_REG,
23 - BCM2835_I2S_RXTHR(1)
24 - | BCM2835_I2S_TXTHR(1)
25 - | BCM2835_I2S_DMAEN, 0xffffffff);
26 + BCM2835_I2S_RXTHR(3)
27 + | BCM2835_I2S_TXTHR(3)
28 + | BCM2835_I2S_DMAEN,
29 + BCM2835_I2S_RXTHR(1)
30 + | BCM2835_I2S_TXTHR(1)
31 + | BCM2835_I2S_DMAEN);
32
33 regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_DREQ_A_REG,
34 - BCM2835_I2S_TX_PANIC(0x10)
35 - | BCM2835_I2S_RX_PANIC(0x30)
36 - | BCM2835_I2S_TX(0x30)
37 - | BCM2835_I2S_RX(0x20), 0xffffffff);
38 + BCM2835_I2S_TX_PANIC(0x7f)
39 + | BCM2835_I2S_RX_PANIC(0x7f)
40 + | BCM2835_I2S_TX(0x7f)
41 + | BCM2835_I2S_RX(0x7f),
42 + BCM2835_I2S_TX_PANIC(0x10)
43 + | BCM2835_I2S_RX_PANIC(0x30)
44 + | BCM2835_I2S_TX(0x20)
45 + | BCM2835_I2S_RX(0x20));
46
47 /* Clear FIFOs */
48 bcm2835_i2s_clear_fifos(dev, true, true);