diff options
Diffstat (limited to 'sound/soc/blackfin/bf5xx-tdm-pcm.c')
| -rw-r--r-- | sound/soc/blackfin/bf5xx-tdm-pcm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.c b/sound/soc/blackfin/bf5xx-tdm-pcm.c index ccb5e823bd18..a8c73cbbd685 100644 --- a/sound/soc/blackfin/bf5xx-tdm-pcm.c +++ b/sound/soc/blackfin/bf5xx-tdm-pcm.c | |||
| @@ -43,7 +43,7 @@ | |||
| 43 | #include "bf5xx-tdm.h" | 43 | #include "bf5xx-tdm.h" |
| 44 | #include "bf5xx-sport.h" | 44 | #include "bf5xx-sport.h" |
| 45 | 45 | ||
| 46 | #define PCM_BUFFER_MAX 0x10000 | 46 | #define PCM_BUFFER_MAX 0x8000 |
| 47 | #define FRAGMENT_SIZE_MIN (4*1024) | 47 | #define FRAGMENT_SIZE_MIN (4*1024) |
| 48 | #define FRAGMENTS_MIN 2 | 48 | #define FRAGMENTS_MIN 2 |
| 49 | #define FRAGMENTS_MAX 32 | 49 | #define FRAGMENTS_MAX 32 |
| @@ -177,6 +177,9 @@ out: | |||
| 177 | static int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel, | 177 | static int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel, |
| 178 | snd_pcm_uframes_t pos, void *buf, snd_pcm_uframes_t count) | 178 | snd_pcm_uframes_t pos, void *buf, snd_pcm_uframes_t count) |
| 179 | { | 179 | { |
| 180 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
| 181 | struct sport_device *sport = runtime->private_data; | ||
| 182 | struct bf5xx_tdm_port *tdm_port = sport->private_data; | ||
| 180 | unsigned int *src; | 183 | unsigned int *src; |
| 181 | unsigned int *dst; | 184 | unsigned int *dst; |
| 182 | int i; | 185 | int i; |
| @@ -188,7 +191,7 @@ static int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel, | |||
| 188 | dst += pos * 8; | 191 | dst += pos * 8; |
| 189 | while (count--) { | 192 | while (count--) { |
| 190 | for (i = 0; i < substream->runtime->channels; i++) | 193 | for (i = 0; i < substream->runtime->channels; i++) |
| 191 | *(dst + i) = *src++; | 194 | *(dst + tdm_port->tx_map[i]) = *src++; |
| 192 | dst += 8; | 195 | dst += 8; |
| 193 | } | 196 | } |
| 194 | } else { | 197 | } else { |
| @@ -198,7 +201,7 @@ static int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel, | |||
| 198 | src += pos * 8; | 201 | src += pos * 8; |
| 199 | while (count--) { | 202 | while (count--) { |
| 200 | for (i = 0; i < substream->runtime->channels; i++) | 203 | for (i = 0; i < substream->runtime->channels; i++) |
| 201 | *dst++ = *(src+i); | 204 | *dst++ = *(src + tdm_port->rx_map[i]); |
| 202 | src += 8; | 205 | src += 8; |
| 203 | } | 206 | } |
| 204 | } | 207 | } |
