diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2017-02-07 21:07:54 +0100 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2017-02-07 23:00:16 +0100 |
commit | 96aa0c6b0b179518e0c228362ea55f1c7793bb3a (patch) | |
tree | 3244114239a7bbf380ee9fa76680b55e459e06c0 /target/linux/brcm2708/patches-4.9/0132-Revert-bcm2835-i2s-Changes-for-allowing-asymmetric-s.patch | |
parent | 6b5c3fd055f64ce0f9d111820123caf33632a51f (diff) | |
download | upstream-96aa0c6b0b179518e0c228362ea55f1c7793bb3a.tar.gz upstream-96aa0c6b0b179518e0c228362ea55f1c7793bb3a.tar.bz2 upstream-96aa0c6b0b179518e0c228362ea55f1c7793bb3a.zip |
brcm2708: add linux 4.9 support
Patches from Raspberry Pi repo:
https://github.com/raspberrypi/linux/commits/rpi-4.9.y
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.9/0132-Revert-bcm2835-i2s-Changes-for-allowing-asymmetric-s.patch')
-rw-r--r-- | target/linux/brcm2708/patches-4.9/0132-Revert-bcm2835-i2s-Changes-for-allowing-asymmetric-s.patch | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.9/0132-Revert-bcm2835-i2s-Changes-for-allowing-asymmetric-s.patch b/target/linux/brcm2708/patches-4.9/0132-Revert-bcm2835-i2s-Changes-for-allowing-asymmetric-s.patch new file mode 100644 index 0000000000..189b288898 --- /dev/null +++ b/target/linux/brcm2708/patches-4.9/0132-Revert-bcm2835-i2s-Changes-for-allowing-asymmetric-s.patch @@ -0,0 +1,90 @@ +From db51b292d97ecb021831ed380ce4e1152b1bd235 Mon Sep 17 00:00:00 2001 +From: Phil Elwell <phil@raspberrypi.org> +Date: Mon, 16 Jan 2017 21:02:26 +0000 +Subject: [PATCH] Revert "bcm2835-i2s: Changes for allowing asymmetric sample + formats." + +This reverts commit f5a6236a32e82068122301d246a94ca755d61704. + +See: https://github.com/raspberrypi/linux/issues/1799 + +Signed-off-by: Phil Elwell <phil@raspberrypi.org> +--- + sound/soc/bcm/bcm2835-i2s.c | 54 ++++++++++++++------------------------------- + 1 file changed, 16 insertions(+), 38 deletions(-) + +--- a/sound/soc/bcm/bcm2835-i2s.c ++++ b/sound/soc/bcm/bcm2835-i2s.c +@@ -237,9 +237,7 @@ static int bcm2835_i2s_hw_params(struct + unsigned int sampling_rate = params_rate(params); + unsigned int data_length, data_delay, bclk_ratio; + unsigned int ch1pos, ch2pos, mode, format; +- unsigned int previous_ftxp, previous_frxp; + uint32_t csreg; +- bool packed; + + /* + * If a stream is already enabled, +@@ -322,46 +320,26 @@ static int bcm2835_i2s_hw_params(struct + return -EINVAL; + } + +- /* Set the format for the matching stream direction. */ +- switch (substream->stream) { +- case SNDRV_PCM_STREAM_PLAYBACK: +- regmap_write(dev->i2s_regmap, BCM2835_I2S_TXC_A_REG, format); +- break; +- case SNDRV_PCM_STREAM_CAPTURE: +- regmap_write(dev->i2s_regmap, BCM2835_I2S_RXC_A_REG, format); +- break; +- default: +- return -EINVAL; +- } ++ /* ++ * Set format for both streams. ++ * We cannot set another frame length ++ * (and therefore word length) anyway, ++ * so the format will be the same. ++ */ ++ regmap_write(dev->i2s_regmap, BCM2835_I2S_RXC_A_REG, format); ++ regmap_write(dev->i2s_regmap, BCM2835_I2S_TXC_A_REG, format); + + /* Setup the I2S mode */ +- /* Keep existing FTXP and FRXP values. */ +- regmap_read(dev->i2s_regmap, BCM2835_I2S_MODE_A_REG, &mode); +- +- previous_ftxp = mode & BCM2835_I2S_FTXP; +- previous_frxp = mode & BCM2835_I2S_FRXP; +- + mode = 0; + +- /* +- * Retain the frame packed mode (2 channels per 32 bit word) +- * of the other direction stream intact. The formats of each +- * direction can be different as long as the frame length is +- * shared for both. +- */ +- packed = data_length <= 16; +- +- switch (substream->stream) { +- case SNDRV_PCM_STREAM_PLAYBACK: +- mode |= previous_frxp; +- mode |= packed ? BCM2835_I2S_FTXP : 0; +- break; +- case SNDRV_PCM_STREAM_CAPTURE: +- mode |= previous_ftxp; +- mode |= packed ? BCM2835_I2S_FRXP : 0; +- break; +- default: +- return -EINVAL; ++ if (data_length <= 16) { ++ /* ++ * Use frame packed mode (2 channels per 32 bit word) ++ * We cannot set another frame length in the second stream ++ * (and therefore word length) anyway, ++ * so the format will be the same. ++ */ ++ mode |= BCM2835_I2S_FTXP | BCM2835_I2S_FRXP; + } + + mode |= BCM2835_I2S_FLEN(bclk_ratio - 1); |