diff options
Diffstat (limited to 'sound/soc/nuc900')
-rw-r--r-- | sound/soc/nuc900/nuc900-ac97.c | 15 | ||||
-rw-r--r-- | sound/soc/nuc900/nuc900-audio.h | 2 | ||||
-rw-r--r-- | sound/soc/nuc900/nuc900-pcm.c | 11 |
3 files changed, 15 insertions, 13 deletions
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index e00e39dd6576..dac6732da969 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c | |||
@@ -49,7 +49,7 @@ static unsigned short nuc900_ac97_read(struct snd_ac97 *ac97, | |||
49 | mutex_lock(&ac97_mutex); | 49 | mutex_lock(&ac97_mutex); |
50 | 50 | ||
51 | val = nuc900_checkready(); | 51 | val = nuc900_checkready(); |
52 | if (!!val) { | 52 | if (val) { |
53 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); | 53 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); |
54 | goto out; | 54 | goto out; |
55 | } | 55 | } |
@@ -102,7 +102,7 @@ static void nuc900_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
102 | mutex_lock(&ac97_mutex); | 102 | mutex_lock(&ac97_mutex); |
103 | 103 | ||
104 | tmp = nuc900_checkready(); | 104 | tmp = nuc900_checkready(); |
105 | if (!!tmp) | 105 | if (tmp) |
106 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); | 106 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); |
107 | 107 | ||
108 | /* clear the R_WB bit and write register index */ | 108 | /* clear the R_WB bit and write register index */ |
@@ -149,7 +149,7 @@ static void nuc900_ac97_warm_reset(struct snd_ac97 *ac97) | |||
149 | udelay(100); | 149 | udelay(100); |
150 | 150 | ||
151 | val = nuc900_checkready(); | 151 | val = nuc900_checkready(); |
152 | if (!!val) | 152 | if (val) |
153 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); | 153 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); |
154 | 154 | ||
155 | mutex_unlock(&ac97_mutex); | 155 | mutex_unlock(&ac97_mutex); |
@@ -263,8 +263,7 @@ static int nuc900_ac97_trigger(struct snd_pcm_substream *substream, | |||
263 | return ret; | 263 | return ret; |
264 | } | 264 | } |
265 | 265 | ||
266 | static int nuc900_ac97_probe(struct platform_device *pdev, | 266 | static int nuc900_ac97_probe(struct snd_soc_dai *dai) |
267 | struct snd_soc_dai *dai) | ||
268 | { | 267 | { |
269 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; | 268 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; |
270 | unsigned long val; | 269 | unsigned long val; |
@@ -284,12 +283,12 @@ static int nuc900_ac97_probe(struct platform_device *pdev, | |||
284 | return 0; | 283 | return 0; |
285 | } | 284 | } |
286 | 285 | ||
287 | static void nuc900_ac97_remove(struct platform_device *pdev, | 286 | static int nuc900_ac97_remove(struct snd_soc_dai *dai) |
288 | struct snd_soc_dai *dai) | ||
289 | { | 287 | { |
290 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; | 288 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; |
291 | 289 | ||
292 | clk_disable(nuc900_audio->clk); | 290 | clk_disable(nuc900_audio->clk); |
291 | return 0; | ||
293 | } | 292 | } |
294 | 293 | ||
295 | static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { | 294 | static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { |
@@ -313,7 +312,7 @@ static struct snd_soc_dai_driver nuc900_ac97_dai = { | |||
313 | .channels_max = 2, | 312 | .channels_max = 2, |
314 | }, | 313 | }, |
315 | .ops = &nuc900_ac97_dai_ops, | 314 | .ops = &nuc900_ac97_dai_ops, |
316 | } | 315 | }; |
317 | 316 | ||
318 | static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) | 317 | static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) |
319 | { | 318 | { |
diff --git a/sound/soc/nuc900/nuc900-audio.h b/sound/soc/nuc900/nuc900-audio.h index aeed8ead2b2b..59f7e8ed1a68 100644 --- a/sound/soc/nuc900/nuc900-audio.h +++ b/sound/soc/nuc900/nuc900-audio.h | |||
@@ -110,4 +110,6 @@ struct nuc900_audio { | |||
110 | 110 | ||
111 | }; | 111 | }; |
112 | 112 | ||
113 | extern struct nuc900_audio *nuc900_ac97_data; | ||
114 | |||
113 | #endif /*end _NUC900_AUDIO_H */ | 115 | #endif /*end _NUC900_AUDIO_H */ |
diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index 195d1ac94771..8263f56dc665 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c | |||
@@ -50,12 +50,12 @@ static int nuc900_dma_hw_params(struct snd_pcm_substream *substream, | |||
50 | unsigned long flags; | 50 | unsigned long flags; |
51 | int ret = 0; | 51 | int ret = 0; |
52 | 52 | ||
53 | spin_lock_irqsave(&nuc900_audio->lock, flags); | ||
54 | |||
55 | ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); | 53 | ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); |
56 | if (ret < 0) | 54 | if (ret < 0) |
57 | return ret; | 55 | return ret; |
58 | 56 | ||
57 | spin_lock_irqsave(&nuc900_audio->lock, flags); | ||
58 | |||
59 | nuc900_audio->substream = substream; | 59 | nuc900_audio->substream = substream; |
60 | nuc900_audio->dma_addr[substream->stream] = runtime->dma_addr; | 60 | nuc900_audio->dma_addr[substream->stream] = runtime->dma_addr; |
61 | nuc900_audio->buffersize[substream->stream] = | 61 | nuc900_audio->buffersize[substream->stream] = |
@@ -169,6 +169,7 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) | |||
169 | struct snd_pcm_runtime *runtime = substream->runtime; | 169 | struct snd_pcm_runtime *runtime = substream->runtime; |
170 | struct nuc900_audio *nuc900_audio = runtime->private_data; | 170 | struct nuc900_audio *nuc900_audio = runtime->private_data; |
171 | unsigned long flags, val; | 171 | unsigned long flags, val; |
172 | int ret = 0; | ||
172 | 173 | ||
173 | spin_lock_irqsave(&nuc900_audio->lock, flags); | 174 | spin_lock_irqsave(&nuc900_audio->lock, flags); |
174 | 175 | ||
@@ -197,10 +198,10 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) | |||
197 | AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val); | 198 | AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val); |
198 | break; | 199 | break; |
199 | default: | 200 | default: |
200 | return -EINVAL; | 201 | ret = -EINVAL; |
201 | } | 202 | } |
202 | spin_unlock_irqrestore(&nuc900_audio->lock, flags); | 203 | spin_unlock_irqrestore(&nuc900_audio->lock, flags); |
203 | return 0; | 204 | return ret; |
204 | } | 205 | } |
205 | 206 | ||
206 | static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd) | 207 | static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd) |
@@ -332,7 +333,7 @@ static struct snd_soc_platform_driver nuc900_soc_platform = { | |||
332 | .ops = &nuc900_dma_ops, | 333 | .ops = &nuc900_dma_ops, |
333 | .pcm_new = nuc900_dma_new, | 334 | .pcm_new = nuc900_dma_new, |
334 | .pcm_free = nuc900_dma_free_dma_buffers, | 335 | .pcm_free = nuc900_dma_free_dma_buffers, |
335 | } | 336 | }; |
336 | 337 | ||
337 | static int __devinit nuc900_soc_platform_probe(struct platform_device *pdev) | 338 | static int __devinit nuc900_soc_platform_probe(struct platform_device *pdev) |
338 | { | 339 | { |