diff options
Diffstat (limited to 'sound/soc/nuc900/nuc900-pcm.c')
-rw-r--r-- | sound/soc/nuc900/nuc900-pcm.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index 32a503c1c4be..445a18011d8e 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c | |||
@@ -47,7 +47,7 @@ static int nuc900_dma_hw_params(struct snd_pcm_substream *substream, | |||
47 | { | 47 | { |
48 | struct snd_pcm_runtime *runtime = substream->runtime; | 48 | struct snd_pcm_runtime *runtime = substream->runtime; |
49 | struct nuc900_audio *nuc900_audio = runtime->private_data; | 49 | struct nuc900_audio *nuc900_audio = runtime->private_data; |
50 | unsigned long flags, stype = SUBSTREAM_TYPE(substream); | 50 | unsigned long flags; |
51 | int ret = 0; | 51 | int ret = 0; |
52 | 52 | ||
53 | spin_lock_irqsave(&nuc900_audio->lock, flags); | 53 | spin_lock_irqsave(&nuc900_audio->lock, flags); |
@@ -57,8 +57,9 @@ static int nuc900_dma_hw_params(struct snd_pcm_substream *substream, | |||
57 | return ret; | 57 | return ret; |
58 | 58 | ||
59 | nuc900_audio->substream = substream; | 59 | nuc900_audio->substream = substream; |
60 | nuc900_audio->dma_addr[stype] = runtime->dma_addr; | 60 | nuc900_audio->dma_addr[substream->stream] = runtime->dma_addr; |
61 | nuc900_audio->buffersize[stype] = params_buffer_bytes(params); | 61 | nuc900_audio->buffersize[substream->stream] = |
62 | params_buffer_bytes(params); | ||
62 | 63 | ||
63 | spin_unlock_irqrestore(&nuc900_audio->lock, flags); | 64 | spin_unlock_irqrestore(&nuc900_audio->lock, flags); |
64 | 65 | ||
@@ -72,7 +73,7 @@ static void nuc900_update_dma_register(struct snd_pcm_substream *substream, | |||
72 | struct nuc900_audio *nuc900_audio = runtime->private_data; | 73 | struct nuc900_audio *nuc900_audio = runtime->private_data; |
73 | void __iomem *mmio_addr, *mmio_len; | 74 | void __iomem *mmio_addr, *mmio_len; |
74 | 75 | ||
75 | if (SUBSTREAM_TYPE(substream) == PCM_TX) { | 76 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
76 | mmio_addr = nuc900_audio->mmio + ACTL_PDSTB; | 77 | mmio_addr = nuc900_audio->mmio + ACTL_PDSTB; |
77 | mmio_len = nuc900_audio->mmio + ACTL_PDST_LENGTH; | 78 | mmio_len = nuc900_audio->mmio + ACTL_PDST_LENGTH; |
78 | } else { | 79 | } else { |
@@ -167,18 +168,19 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) | |||
167 | { | 168 | { |
168 | struct snd_pcm_runtime *runtime = substream->runtime; | 169 | struct snd_pcm_runtime *runtime = substream->runtime; |
169 | struct nuc900_audio *nuc900_audio = runtime->private_data; | 170 | struct nuc900_audio *nuc900_audio = runtime->private_data; |
170 | unsigned long flags, val, stype = SUBSTREAM_TYPE(substream);; | 171 | unsigned long flags, val; |
171 | 172 | ||
172 | spin_lock_irqsave(&nuc900_audio->lock, flags); | 173 | spin_lock_irqsave(&nuc900_audio->lock, flags); |
173 | 174 | ||
174 | nuc900_update_dma_register(substream, | 175 | nuc900_update_dma_register(substream, |
175 | nuc900_audio->dma_addr[stype], nuc900_audio->buffersize[stype]); | 176 | nuc900_audio->dma_addr[substream->stream], |
177 | nuc900_audio->buffersize[substream->stream]); | ||
176 | 178 | ||
177 | val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET); | 179 | val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET); |
178 | 180 | ||
179 | switch (runtime->channels) { | 181 | switch (runtime->channels) { |
180 | case 1: | 182 | case 1: |
181 | if (PCM_TX == stype) { | 183 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
182 | val &= ~(PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL); | 184 | val &= ~(PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL); |
183 | val |= PLAY_RIGHT_CHNNEL; | 185 | val |= PLAY_RIGHT_CHNNEL; |
184 | } else { | 186 | } else { |
@@ -188,7 +190,7 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) | |||
188 | AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val); | 190 | AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val); |
189 | break; | 191 | break; |
190 | case 2: | 192 | case 2: |
191 | if (PCM_TX == stype) | 193 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
192 | val |= (PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL); | 194 | val |= (PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL); |
193 | else | 195 | else |
194 | val |= (RECORD_LEFT_CHNNEL | RECORD_RIGHT_CHNNEL); | 196 | val |= (RECORD_LEFT_CHNNEL | RECORD_RIGHT_CHNNEL); |