1 From db51b292d97ecb021831ed380ce4e1152b1bd235 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 16 Jan 2017 21:02:26 +0000
4 Subject: [PATCH] Revert "bcm2835-i2s: Changes for allowing asymmetric sample
7 This reverts commit f5a6236a32e82068122301d246a94ca755d61704.
9 See: https://github.com/raspberrypi/linux/issues/1799
11 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
13 sound/soc/bcm/bcm2835-i2s.c | 54 ++++++++++++++-------------------------------
14 1 file changed, 16 insertions(+), 38 deletions(-)
16 --- a/sound/soc/bcm/bcm2835-i2s.c
17 +++ b/sound/soc/bcm/bcm2835-i2s.c
18 @@ -237,9 +237,7 @@ static int bcm2835_i2s_hw_params(struct
19 unsigned int sampling_rate = params_rate(params);
20 unsigned int data_length, data_delay, bclk_ratio;
21 unsigned int ch1pos, ch2pos, mode, format;
22 - unsigned int previous_ftxp, previous_frxp;
27 * If a stream is already enabled,
28 @@ -322,46 +320,26 @@ static int bcm2835_i2s_hw_params(struct
32 - /* Set the format for the matching stream direction. */
33 - switch (substream->stream) {
34 - case SNDRV_PCM_STREAM_PLAYBACK:
35 - regmap_write(dev->i2s_regmap, BCM2835_I2S_TXC_A_REG, format);
37 - case SNDRV_PCM_STREAM_CAPTURE:
38 - regmap_write(dev->i2s_regmap, BCM2835_I2S_RXC_A_REG, format);
44 + * Set format for both streams.
45 + * We cannot set another frame length
46 + * (and therefore word length) anyway,
47 + * so the format will be the same.
49 + regmap_write(dev->i2s_regmap, BCM2835_I2S_RXC_A_REG, format);
50 + regmap_write(dev->i2s_regmap, BCM2835_I2S_TXC_A_REG, format);
52 /* Setup the I2S mode */
53 - /* Keep existing FTXP and FRXP values. */
54 - regmap_read(dev->i2s_regmap, BCM2835_I2S_MODE_A_REG, &mode);
56 - previous_ftxp = mode & BCM2835_I2S_FTXP;
57 - previous_frxp = mode & BCM2835_I2S_FRXP;
62 - * Retain the frame packed mode (2 channels per 32 bit word)
63 - * of the other direction stream intact. The formats of each
64 - * direction can be different as long as the frame length is
67 - packed = data_length <= 16;
69 - switch (substream->stream) {
70 - case SNDRV_PCM_STREAM_PLAYBACK:
71 - mode |= previous_frxp;
72 - mode |= packed ? BCM2835_I2S_FTXP : 0;
74 - case SNDRV_PCM_STREAM_CAPTURE:
75 - mode |= previous_ftxp;
76 - mode |= packed ? BCM2835_I2S_FRXP : 0;
80 + if (data_length <= 16) {
82 + * Use frame packed mode (2 channels per 32 bit word)
83 + * We cannot set another frame length in the second stream
84 + * (and therefore word length) anyway,
85 + * so the format will be the same.
87 + mode |= BCM2835_I2S_FTXP | BCM2835_I2S_FRXP;
90 mode |= BCM2835_I2S_FLEN(bclk_ratio - 1);