diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-03 12:10:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-03 12:10:23 -0400 |
commit | 9992ba72327fa0d8bdc9fb624e80f5cce338a711 (patch) | |
tree | e0bf31ae53cb19c44674df7e0d0343a26037ad34 /sound/core | |
parent | 00fdffb5131125dce0702bf61e24a806ec3aed80 (diff) | |
parent | 4ca231b2e6ed171107c5b21f9e92d1965fd6fd9e (diff) |
Merge tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai:
"Mostly many small changes spread as seen in diffstat in sound/*
directory by this update. A significant change in the subsystem level
is the introduction of snd_soc_component, which will help more generic
handling of SoC and off-SoC components.
Also, snd_BUG_ON() macro is enabled unconditionally now due to its
misuses, so people might hit kernel warnings (it's a good thing for
us).
- compress-offload: support for capture by Charles Keepax
- HD-audio: codec delay support by Dylan Reid
- HD-audio: improvements/fixes in generic parser: better headphone
mic and headset mic support, jack_modes hint consolidation, proper
beep attach/detachment, generalized power filter controls by David
Henningsson, et al
- HD-audio: Improved management of HDMI codec pins/converters
- HD-audio: Better pin/DAC assignment for VIA codecs
- HD-audio: Haswell HDMI workarounds
- HD-audio: ALC268 codec support, a few new quirks for Chromebooks
- USB: regression fixes: USB-MIDI autopm fix, the recent ISO latency
fix by Clemens Ladisch
- USB: support for DSD formats by Daniel Mack
- USB: A few UAC2 device endian/cock fixes by Eldad Zack
- USB: quirks for Emu 192kHz support, Novation Twitch DJ controller,
Yamaha THRxx devices
- HDSPM: updates for TCO controls by Adrian Knoth
- ASoC: Add a snd_soc_component object type for generic handling of
SoC and off-SoC components by Kuninori Morimoto,
- dmaengine: a large set of cleanups and conversions by Lars-Peter
Clausen
- ASoC DAPM: performance optimizations from Ryo Tsutsui
- ASoC DAPM: support for mixer control sharing by Stephen Warren
- ASoC: multiplatform ARM cleanups from Arnd Bergmann
- ASoC: new codec drivers for AK5385 and TAS5086 from Daniel Mack"
* tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (315 commits)
ALSA: usb-audio: caiaq: fix endianness bug in snd_usb_caiaq_maschine_dispatch
ALSA: asihpi: add format support check in snd_card_asihpi_capture_formats
ALSA: pcm_format_to_bits strong-typed conversion
ALSA: compress: fix the states to check for allowing read
ALSA: hda - Move Thinkpad X220 to use auto parser
ALSA: USB: adjust for changed 3.8 USB API
ALSA: usb - Avoid unnecessary sample rate changes on USB 2.0 clock sources
sound: oss/dmabuf: use dma_map_single
ALSA: ali5451: use mdelay instead of large udelay constants
ALSA: hda - Add the support for ALC286 codec
ALSA: usb-audio: USB quirk for Yamaha THR10C
ALSA: usb-audio: USB quirk for Yamaha THR5A
ALSA: usb-audio: USB quirk for Yamaha THR10
ALSA: usb-audio: Fix autopm error during probing
ALSA: snd-usb: try harder to find USB_DT_CS_ENDPOINT
ALSA: sound kconfig typo
ALSA: emu10k1: Fix dock firmware loading
ASoC: ux500: forward declare msp_i2s_platform_data
ASoC: davinci-mcasp: Add Support BCLK-to-LRCLK ratio for TDM modes
ASoC: davinci-pcm, davinci-mcasp: Clean up active_serializers
...
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/compress_offload.c | 128 | ||||
-rw-r--r-- | sound/core/control.c | 41 | ||||
-rw-r--r-- | sound/core/device.c | 8 | ||||
-rw-r--r-- | sound/core/hwdep.c | 2 | ||||
-rw-r--r-- | sound/core/info.c | 41 | ||||
-rw-r--r-- | sound/core/init.c | 16 | ||||
-rw-r--r-- | sound/core/isadma.c | 2 | ||||
-rw-r--r-- | sound/core/jack.c | 6 | ||||
-rw-r--r-- | sound/core/memalloc.c | 20 | ||||
-rw-r--r-- | sound/core/memory.c | 4 | ||||
-rw-r--r-- | sound/core/pcm.c | 8 | ||||
-rw-r--r-- | sound/core/pcm_lib.c | 54 | ||||
-rw-r--r-- | sound/core/pcm_memory.c | 19 | ||||
-rw-r--r-- | sound/core/pcm_misc.c | 36 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 13 | ||||
-rw-r--r-- | sound/core/rawmidi.c | 14 | ||||
-rw-r--r-- | sound/core/sound.c | 7 | ||||
-rw-r--r-- | sound/core/vmaster.c | 7 |
18 files changed, 271 insertions, 155 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index c84abc886e90..99db892d7299 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c | |||
@@ -28,11 +28,13 @@ | |||
28 | #include <linux/file.h> | 28 | #include <linux/file.h> |
29 | #include <linux/fs.h> | 29 | #include <linux/fs.h> |
30 | #include <linux/list.h> | 30 | #include <linux/list.h> |
31 | #include <linux/math64.h> | ||
31 | #include <linux/mm.h> | 32 | #include <linux/mm.h> |
32 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
33 | #include <linux/poll.h> | 34 | #include <linux/poll.h> |
34 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
35 | #include <linux/sched.h> | 36 | #include <linux/sched.h> |
37 | #include <linux/types.h> | ||
36 | #include <linux/uio.h> | 38 | #include <linux/uio.h> |
37 | #include <linux/uaccess.h> | 39 | #include <linux/uaccess.h> |
38 | #include <linux/module.h> | 40 | #include <linux/module.h> |
@@ -152,26 +154,23 @@ static int snd_compr_update_tstamp(struct snd_compr_stream *stream, | |||
152 | stream->ops->pointer(stream, tstamp); | 154 | stream->ops->pointer(stream, tstamp); |
153 | pr_debug("dsp consumed till %d total %d bytes\n", | 155 | pr_debug("dsp consumed till %d total %d bytes\n", |
154 | tstamp->byte_offset, tstamp->copied_total); | 156 | tstamp->byte_offset, tstamp->copied_total); |
155 | stream->runtime->hw_pointer = tstamp->byte_offset; | 157 | if (stream->direction == SND_COMPRESS_PLAYBACK) |
156 | stream->runtime->total_bytes_transferred = tstamp->copied_total; | 158 | stream->runtime->total_bytes_transferred = tstamp->copied_total; |
159 | else | ||
160 | stream->runtime->total_bytes_available = tstamp->copied_total; | ||
157 | return 0; | 161 | return 0; |
158 | } | 162 | } |
159 | 163 | ||
160 | static size_t snd_compr_calc_avail(struct snd_compr_stream *stream, | 164 | static size_t snd_compr_calc_avail(struct snd_compr_stream *stream, |
161 | struct snd_compr_avail *avail) | 165 | struct snd_compr_avail *avail) |
162 | { | 166 | { |
163 | long avail_calc; /*this needs to be signed variable */ | ||
164 | |||
165 | memset(avail, 0, sizeof(*avail)); | 167 | memset(avail, 0, sizeof(*avail)); |
166 | snd_compr_update_tstamp(stream, &avail->tstamp); | 168 | snd_compr_update_tstamp(stream, &avail->tstamp); |
167 | /* Still need to return avail even if tstamp can't be filled in */ | 169 | /* Still need to return avail even if tstamp can't be filled in */ |
168 | 170 | ||
169 | /* FIXME: This needs to be different for capture stream, | ||
170 | available is # of compressed data, for playback it's | ||
171 | remainder of buffer */ | ||
172 | |||
173 | if (stream->runtime->total_bytes_available == 0 && | 171 | if (stream->runtime->total_bytes_available == 0 && |
174 | stream->runtime->state == SNDRV_PCM_STATE_SETUP) { | 172 | stream->runtime->state == SNDRV_PCM_STATE_SETUP && |
173 | stream->direction == SND_COMPRESS_PLAYBACK) { | ||
175 | pr_debug("detected init and someone forgot to do a write\n"); | 174 | pr_debug("detected init and someone forgot to do a write\n"); |
176 | return stream->runtime->buffer_size; | 175 | return stream->runtime->buffer_size; |
177 | } | 176 | } |
@@ -180,26 +179,22 @@ static size_t snd_compr_calc_avail(struct snd_compr_stream *stream, | |||
180 | stream->runtime->total_bytes_transferred); | 179 | stream->runtime->total_bytes_transferred); |
181 | if (stream->runtime->total_bytes_available == | 180 | if (stream->runtime->total_bytes_available == |
182 | stream->runtime->total_bytes_transferred) { | 181 | stream->runtime->total_bytes_transferred) { |
183 | pr_debug("both pointers are same, returning full avail\n"); | 182 | if (stream->direction == SND_COMPRESS_PLAYBACK) { |
184 | return stream->runtime->buffer_size; | 183 | pr_debug("both pointers are same, returning full avail\n"); |
184 | return stream->runtime->buffer_size; | ||
185 | } else { | ||
186 | pr_debug("both pointers are same, returning no avail\n"); | ||
187 | return 0; | ||
188 | } | ||
185 | } | 189 | } |
186 | 190 | ||
187 | /* FIXME: this routine isn't consistent, in one test we use | 191 | avail->avail = stream->runtime->total_bytes_available - |
188 | * cumulative values and in the other byte offsets. Do we | 192 | stream->runtime->total_bytes_transferred; |
189 | * really need the byte offsets if the cumulative values have | 193 | if (stream->direction == SND_COMPRESS_PLAYBACK) |
190 | * been updated? In the PCM interface app_ptr and hw_ptr are | 194 | avail->avail = stream->runtime->buffer_size - avail->avail; |
191 | * already cumulative */ | ||
192 | 195 | ||
193 | avail_calc = stream->runtime->buffer_size - | 196 | pr_debug("ret avail as %lld\n", avail->avail); |
194 | (stream->runtime->app_pointer - stream->runtime->hw_pointer); | 197 | return avail->avail; |
195 | pr_debug("calc avail as %ld, app_ptr %lld, hw+ptr %lld\n", avail_calc, | ||
196 | stream->runtime->app_pointer, | ||
197 | stream->runtime->hw_pointer); | ||
198 | if (avail_calc >= stream->runtime->buffer_size) | ||
199 | avail_calc -= stream->runtime->buffer_size; | ||
200 | pr_debug("ret avail as %ld\n", avail_calc); | ||
201 | avail->avail = avail_calc; | ||
202 | return avail_calc; | ||
203 | } | 198 | } |
204 | 199 | ||
205 | static inline size_t snd_compr_get_avail(struct snd_compr_stream *stream) | 200 | static inline size_t snd_compr_get_avail(struct snd_compr_stream *stream) |
@@ -230,21 +225,24 @@ static int snd_compr_write_data(struct snd_compr_stream *stream, | |||
230 | void *dstn; | 225 | void *dstn; |
231 | size_t copy; | 226 | size_t copy; |
232 | struct snd_compr_runtime *runtime = stream->runtime; | 227 | struct snd_compr_runtime *runtime = stream->runtime; |
228 | /* 64-bit Modulus */ | ||
229 | u64 app_pointer = div64_u64(runtime->total_bytes_available, | ||
230 | runtime->buffer_size); | ||
231 | app_pointer = runtime->total_bytes_available - | ||
232 | (app_pointer * runtime->buffer_size); | ||
233 | 233 | ||
234 | dstn = runtime->buffer + runtime->app_pointer; | 234 | dstn = runtime->buffer + app_pointer; |
235 | pr_debug("copying %ld at %lld\n", | 235 | pr_debug("copying %ld at %lld\n", |
236 | (unsigned long)count, runtime->app_pointer); | 236 | (unsigned long)count, app_pointer); |
237 | if (count < runtime->buffer_size - runtime->app_pointer) { | 237 | if (count < runtime->buffer_size - app_pointer) { |
238 | if (copy_from_user(dstn, buf, count)) | 238 | if (copy_from_user(dstn, buf, count)) |
239 | return -EFAULT; | 239 | return -EFAULT; |
240 | runtime->app_pointer += count; | ||
241 | } else { | 240 | } else { |
242 | copy = runtime->buffer_size - runtime->app_pointer; | 241 | copy = runtime->buffer_size - app_pointer; |
243 | if (copy_from_user(dstn, buf, copy)) | 242 | if (copy_from_user(dstn, buf, copy)) |
244 | return -EFAULT; | 243 | return -EFAULT; |
245 | if (copy_from_user(runtime->buffer, buf + copy, count - copy)) | 244 | if (copy_from_user(runtime->buffer, buf + copy, count - copy)) |
246 | return -EFAULT; | 245 | return -EFAULT; |
247 | runtime->app_pointer = count - copy; | ||
248 | } | 246 | } |
249 | /* if DSP cares, let it know data has been written */ | 247 | /* if DSP cares, let it know data has been written */ |
250 | if (stream->ops->ack) | 248 | if (stream->ops->ack) |
@@ -278,10 +276,12 @@ static ssize_t snd_compr_write(struct file *f, const char __user *buf, | |||
278 | if (avail > count) | 276 | if (avail > count) |
279 | avail = count; | 277 | avail = count; |
280 | 278 | ||
281 | if (stream->ops->copy) | 279 | if (stream->ops->copy) { |
282 | retval = stream->ops->copy(stream, buf, avail); | 280 | char __user* cbuf = (char __user*)buf; |
283 | else | 281 | retval = stream->ops->copy(stream, cbuf, avail); |
282 | } else { | ||
284 | retval = snd_compr_write_data(stream, buf, avail); | 283 | retval = snd_compr_write_data(stream, buf, avail); |
284 | } | ||
285 | if (retval > 0) | 285 | if (retval > 0) |
286 | stream->runtime->total_bytes_available += retval; | 286 | stream->runtime->total_bytes_available += retval; |
287 | 287 | ||
@@ -300,7 +300,49 @@ static ssize_t snd_compr_write(struct file *f, const char __user *buf, | |||
300 | static ssize_t snd_compr_read(struct file *f, char __user *buf, | 300 | static ssize_t snd_compr_read(struct file *f, char __user *buf, |
301 | size_t count, loff_t *offset) | 301 | size_t count, loff_t *offset) |
302 | { | 302 | { |
303 | return -ENXIO; | 303 | struct snd_compr_file *data = f->private_data; |
304 | struct snd_compr_stream *stream; | ||
305 | size_t avail; | ||
306 | int retval; | ||
307 | |||
308 | if (snd_BUG_ON(!data)) | ||
309 | return -EFAULT; | ||
310 | |||
311 | stream = &data->stream; | ||
312 | mutex_lock(&stream->device->lock); | ||
313 | |||
314 | /* read is allowed when stream is running, paused, draining and setup | ||
315 | * (yes setup is state which we transition to after stop, so if user | ||
316 | * wants to read data after stop we allow that) | ||
317 | */ | ||
318 | switch (stream->runtime->state) { | ||
319 | case SNDRV_PCM_STATE_OPEN: | ||
320 | case SNDRV_PCM_STATE_PREPARED: | ||
321 | case SNDRV_PCM_STATE_XRUN: | ||
322 | case SNDRV_PCM_STATE_SUSPENDED: | ||
323 | case SNDRV_PCM_STATE_DISCONNECTED: | ||
324 | retval = -EBADFD; | ||
325 | goto out; | ||
326 | } | ||
327 | |||
328 | avail = snd_compr_get_avail(stream); | ||
329 | pr_debug("avail returned %ld\n", (unsigned long)avail); | ||
330 | /* calculate how much we can read from buffer */ | ||
331 | if (avail > count) | ||
332 | avail = count; | ||
333 | |||
334 | if (stream->ops->copy) { | ||
335 | retval = stream->ops->copy(stream, buf, avail); | ||
336 | } else { | ||
337 | retval = -ENXIO; | ||
338 | goto out; | ||
339 | } | ||
340 | if (retval > 0) | ||
341 | stream->runtime->total_bytes_transferred += retval; | ||
342 | |||
343 | out: | ||
344 | mutex_unlock(&stream->device->lock); | ||
345 | return retval; | ||
304 | } | 346 | } |
305 | 347 | ||
306 | static int snd_compr_mmap(struct file *f, struct vm_area_struct *vma) | 348 | static int snd_compr_mmap(struct file *f, struct vm_area_struct *vma) |
@@ -375,6 +417,7 @@ snd_compr_get_caps(struct snd_compr_stream *stream, unsigned long arg) | |||
375 | if (!stream->ops->get_caps) | 417 | if (!stream->ops->get_caps) |
376 | return -ENXIO; | 418 | return -ENXIO; |
377 | 419 | ||
420 | memset(&caps, 0, sizeof(caps)); | ||
378 | retval = stream->ops->get_caps(stream, &caps); | 421 | retval = stream->ops->get_caps(stream, &caps); |
379 | if (retval) | 422 | if (retval) |
380 | goto out; | 423 | goto out; |
@@ -393,7 +436,7 @@ snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg) | |||
393 | if (!stream->ops->get_codec_caps) | 436 | if (!stream->ops->get_codec_caps) |
394 | return -ENXIO; | 437 | return -ENXIO; |
395 | 438 | ||
396 | caps = kmalloc(sizeof(*caps), GFP_KERNEL); | 439 | caps = kzalloc(sizeof(*caps), GFP_KERNEL); |
397 | if (!caps) | 440 | if (!caps) |
398 | return -ENOMEM; | 441 | return -ENOMEM; |
399 | 442 | ||
@@ -485,9 +528,14 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg) | |||
485 | retval = stream->ops->set_params(stream, params); | 528 | retval = stream->ops->set_params(stream, params); |
486 | if (retval) | 529 | if (retval) |
487 | goto out; | 530 | goto out; |
488 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | 531 | |
489 | stream->metadata_set = false; | 532 | stream->metadata_set = false; |
490 | stream->next_track = false; | 533 | stream->next_track = false; |
534 | |||
535 | if (stream->direction == SND_COMPRESS_PLAYBACK) | ||
536 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | ||
537 | else | ||
538 | stream->runtime->state = SNDRV_PCM_STATE_PREPARED; | ||
491 | } else { | 539 | } else { |
492 | return -EPERM; | 540 | return -EPERM; |
493 | } | 541 | } |
@@ -505,7 +553,7 @@ snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg) | |||
505 | if (!stream->ops->get_params) | 553 | if (!stream->ops->get_params) |
506 | return -EBADFD; | 554 | return -EBADFD; |
507 | 555 | ||
508 | params = kmalloc(sizeof(*params), GFP_KERNEL); | 556 | params = kzalloc(sizeof(*params), GFP_KERNEL); |
509 | if (!params) | 557 | if (!params) |
510 | return -ENOMEM; | 558 | return -ENOMEM; |
511 | retval = stream->ops->get_params(stream, params); | 559 | retval = stream->ops->get_params(stream, params); |
@@ -622,8 +670,6 @@ static int snd_compr_stop(struct snd_compr_stream *stream) | |||
622 | if (!retval) { | 670 | if (!retval) { |
623 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | 671 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; |
624 | wake_up(&stream->runtime->sleep); | 672 | wake_up(&stream->runtime->sleep); |
625 | stream->runtime->hw_pointer = 0; | ||
626 | stream->runtime->app_pointer = 0; | ||
627 | stream->runtime->total_bytes_available = 0; | 673 | stream->runtime->total_bytes_available = 0; |
628 | stream->runtime->total_bytes_transferred = 0; | 674 | stream->runtime->total_bytes_transferred = 0; |
629 | } | 675 | } |
diff --git a/sound/core/control.c b/sound/core/control.c index 8c7c2c9bba61..d8aa206e8bde 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -190,7 +190,7 @@ EXPORT_SYMBOL(snd_ctl_notify); | |||
190 | * Allocates a new struct snd_kcontrol instance and copies the given template | 190 | * Allocates a new struct snd_kcontrol instance and copies the given template |
191 | * to the new instance. It does not copy volatile data (access). | 191 | * to the new instance. It does not copy volatile data (access). |
192 | * | 192 | * |
193 | * Returns the pointer of the new instance, or NULL on failure. | 193 | * Return: The pointer of the new instance, or %NULL on failure. |
194 | */ | 194 | */ |
195 | static struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, | 195 | static struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, |
196 | unsigned int access) | 196 | unsigned int access) |
@@ -224,7 +224,7 @@ static struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, | |||
224 | * template. When the access field of ncontrol is 0, it's assumed as | 224 | * template. When the access field of ncontrol is 0, it's assumed as |
225 | * READWRITE access. When the count field is 0, it's assumes as one. | 225 | * READWRITE access. When the count field is 0, it's assumes as one. |
226 | * | 226 | * |
227 | * Returns the pointer of the newly generated instance, or NULL on failure. | 227 | * Return: The pointer of the newly generated instance, or %NULL on failure. |
228 | */ | 228 | */ |
229 | struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol, | 229 | struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol, |
230 | void *private_data) | 230 | void *private_data) |
@@ -322,9 +322,10 @@ static int snd_ctl_find_hole(struct snd_card *card, unsigned int count) | |||
322 | * snd_ctl_new1() to the given card. Assigns also an unique | 322 | * snd_ctl_new1() to the given card. Assigns also an unique |
323 | * numid used for fast search. | 323 | * numid used for fast search. |
324 | * | 324 | * |
325 | * Returns zero if successful, or a negative error code on failure. | ||
326 | * | ||
327 | * It frees automatically the control which cannot be added. | 325 | * It frees automatically the control which cannot be added. |
326 | * | ||
327 | * Return: Zero if successful, or a negative error code on failure. | ||
328 | * | ||
328 | */ | 329 | */ |
329 | int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) | 330 | int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) |
330 | { | 331 | { |
@@ -380,9 +381,9 @@ EXPORT_SYMBOL(snd_ctl_add); | |||
380 | * and the add_on_replace flag is set, the control is added. If the | 381 | * and the add_on_replace flag is set, the control is added. If the |
381 | * control exists, it is destroyed first. | 382 | * control exists, it is destroyed first. |
382 | * | 383 | * |
383 | * Returns zero if successful, or a negative error code on failure. | ||
384 | * | ||
385 | * It frees automatically the control which cannot be added or replaced. | 384 | * It frees automatically the control which cannot be added or replaced. |
385 | * | ||
386 | * Return: Zero if successful, or a negative error code on failure. | ||
386 | */ | 387 | */ |
387 | int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol, | 388 | int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol, |
388 | bool add_on_replace) | 389 | bool add_on_replace) |
@@ -442,8 +443,8 @@ EXPORT_SYMBOL(snd_ctl_replace); | |||
442 | * Removes the control from the card and then releases the instance. | 443 | * Removes the control from the card and then releases the instance. |
443 | * You don't need to call snd_ctl_free_one(). You must be in | 444 | * You don't need to call snd_ctl_free_one(). You must be in |
444 | * the write lock - down_write(&card->controls_rwsem). | 445 | * the write lock - down_write(&card->controls_rwsem). |
445 | * | 446 | * |
446 | * Returns 0 if successful, or a negative error code on failure. | 447 | * Return: 0 if successful, or a negative error code on failure. |
447 | */ | 448 | */ |
448 | int snd_ctl_remove(struct snd_card *card, struct snd_kcontrol *kcontrol) | 449 | int snd_ctl_remove(struct snd_card *card, struct snd_kcontrol *kcontrol) |
449 | { | 450 | { |
@@ -470,8 +471,8 @@ EXPORT_SYMBOL(snd_ctl_remove); | |||
470 | * | 471 | * |
471 | * Finds the control instance with the given id, removes it from the | 472 | * Finds the control instance with the given id, removes it from the |
472 | * card list and releases it. | 473 | * card list and releases it. |
473 | * | 474 | * |
474 | * Returns 0 if successful, or a negative error code on failure. | 475 | * Return: 0 if successful, or a negative error code on failure. |
475 | */ | 476 | */ |
476 | int snd_ctl_remove_id(struct snd_card *card, struct snd_ctl_elem_id *id) | 477 | int snd_ctl_remove_id(struct snd_card *card, struct snd_ctl_elem_id *id) |
477 | { | 478 | { |
@@ -498,8 +499,8 @@ EXPORT_SYMBOL(snd_ctl_remove_id); | |||
498 | * | 499 | * |
499 | * Finds the control instance with the given id, removes it from the | 500 | * Finds the control instance with the given id, removes it from the |
500 | * card list and releases it. | 501 | * card list and releases it. |
501 | * | 502 | * |
502 | * Returns 0 if successful, or a negative error code on failure. | 503 | * Return: 0 if successful, or a negative error code on failure. |
503 | */ | 504 | */ |
504 | static int snd_ctl_remove_user_ctl(struct snd_ctl_file * file, | 505 | static int snd_ctl_remove_user_ctl(struct snd_ctl_file * file, |
505 | struct snd_ctl_elem_id *id) | 506 | struct snd_ctl_elem_id *id) |
@@ -541,7 +542,7 @@ error: | |||
541 | * Finds the control instance with the given id, and activate or | 542 | * Finds the control instance with the given id, and activate or |
542 | * inactivate the control together with notification, if changed. | 543 | * inactivate the control together with notification, if changed. |
543 | * | 544 | * |
544 | * Returns 0 if unchanged, 1 if changed, or a negative error code on failure. | 545 | * Return: 0 if unchanged, 1 if changed, or a negative error code on failure. |
545 | */ | 546 | */ |
546 | int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id, | 547 | int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id, |
547 | int active) | 548 | int active) |
@@ -587,7 +588,7 @@ EXPORT_SYMBOL_GPL(snd_ctl_activate_id); | |||
587 | * Finds the control with the old id from the card, and replaces the | 588 | * Finds the control with the old id from the card, and replaces the |
588 | * id with the new one. | 589 | * id with the new one. |
589 | * | 590 | * |
590 | * Returns zero if successful, or a negative error code on failure. | 591 | * Return: Zero if successful, or a negative error code on failure. |
591 | */ | 592 | */ |
592 | int snd_ctl_rename_id(struct snd_card *card, struct snd_ctl_elem_id *src_id, | 593 | int snd_ctl_rename_id(struct snd_card *card, struct snd_ctl_elem_id *src_id, |
593 | struct snd_ctl_elem_id *dst_id) | 594 | struct snd_ctl_elem_id *dst_id) |
@@ -616,10 +617,11 @@ EXPORT_SYMBOL(snd_ctl_rename_id); | |||
616 | * | 617 | * |
617 | * Finds the control instance with the given number-id from the card. | 618 | * Finds the control instance with the given number-id from the card. |
618 | * | 619 | * |
619 | * Returns the pointer of the instance if found, or NULL if not. | ||
620 | * | ||
621 | * The caller must down card->controls_rwsem before calling this function | 620 | * The caller must down card->controls_rwsem before calling this function |
622 | * (if the race condition can happen). | 621 | * (if the race condition can happen). |
622 | * | ||
623 | * Return: The pointer of the instance if found, or %NULL if not. | ||
624 | * | ||
623 | */ | 625 | */ |
624 | struct snd_kcontrol *snd_ctl_find_numid(struct snd_card *card, unsigned int numid) | 626 | struct snd_kcontrol *snd_ctl_find_numid(struct snd_card *card, unsigned int numid) |
625 | { | 627 | { |
@@ -643,10 +645,11 @@ EXPORT_SYMBOL(snd_ctl_find_numid); | |||
643 | * | 645 | * |
644 | * Finds the control instance with the given id from the card. | 646 | * Finds the control instance with the given id from the card. |
645 | * | 647 | * |
646 | * Returns the pointer of the instance if found, or NULL if not. | ||
647 | * | ||
648 | * The caller must down card->controls_rwsem before calling this function | 648 | * The caller must down card->controls_rwsem before calling this function |
649 | * (if the race condition can happen). | 649 | * (if the race condition can happen). |
650 | * | ||
651 | * Return: The pointer of the instance if found, or %NULL if not. | ||
652 | * | ||
650 | */ | 653 | */ |
651 | struct snd_kcontrol *snd_ctl_find_id(struct snd_card *card, | 654 | struct snd_kcontrol *snd_ctl_find_id(struct snd_card *card, |
652 | struct snd_ctl_elem_id *id) | 655 | struct snd_ctl_elem_id *id) |
@@ -1710,6 +1713,8 @@ EXPORT_SYMBOL(snd_ctl_boolean_stereo_info); | |||
1710 | * Sets all required fields in @info to their appropriate values. | 1713 | * Sets all required fields in @info to their appropriate values. |
1711 | * If the control's accessibility is not the default (readable and writable), | 1714 | * If the control's accessibility is not the default (readable and writable), |
1712 | * the caller has to fill @info->access. | 1715 | * the caller has to fill @info->access. |
1716 | * | ||
1717 | * Return: Zero. | ||
1713 | */ | 1718 | */ |
1714 | int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels, | 1719 | int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels, |
1715 | unsigned int items, const char *const names[]) | 1720 | unsigned int items, const char *const names[]) |
diff --git a/sound/core/device.c b/sound/core/device.c index f03cb5444a5a..df88defed176 100644 --- a/sound/core/device.c +++ b/sound/core/device.c | |||
@@ -39,7 +39,7 @@ | |||
39 | * The data pointer plays a role as the identifier, too, so the | 39 | * The data pointer plays a role as the identifier, too, so the |
40 | * pointer address must be unique and unchanged. | 40 | * pointer address must be unique and unchanged. |
41 | * | 41 | * |
42 | * Returns zero if successful, or a negative error code on failure. | 42 | * Return: Zero if successful, or a negative error code on failure. |
43 | */ | 43 | */ |
44 | int snd_device_new(struct snd_card *card, snd_device_type_t type, | 44 | int snd_device_new(struct snd_card *card, snd_device_type_t type, |
45 | void *device_data, struct snd_device_ops *ops) | 45 | void *device_data, struct snd_device_ops *ops) |
@@ -73,7 +73,7 @@ EXPORT_SYMBOL(snd_device_new); | |||
73 | * callbacks, dev_disconnect and dev_free, corresponding to the state. | 73 | * callbacks, dev_disconnect and dev_free, corresponding to the state. |
74 | * Then release the device. | 74 | * Then release the device. |
75 | * | 75 | * |
76 | * Returns zero if successful, or a negative error code on failure or if the | 76 | * Return: Zero if successful, or a negative error code on failure or if the |
77 | * device not found. | 77 | * device not found. |
78 | */ | 78 | */ |
79 | int snd_device_free(struct snd_card *card, void *device_data) | 79 | int snd_device_free(struct snd_card *card, void *device_data) |
@@ -116,7 +116,7 @@ EXPORT_SYMBOL(snd_device_free); | |||
116 | * | 116 | * |
117 | * Usually called from snd_card_disconnect(). | 117 | * Usually called from snd_card_disconnect(). |
118 | * | 118 | * |
119 | * Returns zero if successful, or a negative error code on failure or if the | 119 | * Return: Zero if successful, or a negative error code on failure or if the |
120 | * device not found. | 120 | * device not found. |
121 | */ | 121 | */ |
122 | int snd_device_disconnect(struct snd_card *card, void *device_data) | 122 | int snd_device_disconnect(struct snd_card *card, void *device_data) |
@@ -151,7 +151,7 @@ int snd_device_disconnect(struct snd_card *card, void *device_data) | |||
151 | * but it can be called later if any new devices are created after | 151 | * but it can be called later if any new devices are created after |
152 | * invocation of snd_card_register(). | 152 | * invocation of snd_card_register(). |
153 | * | 153 | * |
154 | * Returns zero if successful, or a negative error code on failure or if the | 154 | * Return: Zero if successful, or a negative error code on failure or if the |
155 | * device not found. | 155 | * device not found. |
156 | */ | 156 | */ |
157 | int snd_device_register(struct snd_card *card, void *device_data) | 157 | int snd_device_register(struct snd_card *card, void *device_data) |
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index 3f7f6628cf7b..d105073298cb 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c | |||
@@ -356,7 +356,7 @@ static const struct file_operations snd_hwdep_f_ops = | |||
356 | * The callbacks (hwdep->ops) must be set on the returned instance | 356 | * The callbacks (hwdep->ops) must be set on the returned instance |
357 | * after this call manually by the caller. | 357 | * after this call manually by the caller. |
358 | * | 358 | * |
359 | * Returns zero if successful, or a negative error code on failure. | 359 | * Return: Zero if successful, or a negative error code on failure. |
360 | */ | 360 | */ |
361 | int snd_hwdep_new(struct snd_card *card, char *id, int device, | 361 | int snd_hwdep_new(struct snd_card *card, char *id, int device, |
362 | struct snd_hwdep **rhwdep) | 362 | struct snd_hwdep **rhwdep) |
diff --git a/sound/core/info.c b/sound/core/info.c index 3c9bd6b10a96..e79baa11b60e 100644 --- a/sound/core/info.c +++ b/sound/core/info.c | |||
@@ -89,7 +89,7 @@ static int resize_info_buffer(struct snd_info_buffer *buffer, | |||
89 | char *nbuf; | 89 | char *nbuf; |
90 | 90 | ||
91 | nsize = PAGE_ALIGN(nsize); | 91 | nsize = PAGE_ALIGN(nsize); |
92 | nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL); | 92 | nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL | __GFP_ZERO); |
93 | if (! nbuf) | 93 | if (! nbuf) |
94 | return -ENOMEM; | 94 | return -ENOMEM; |
95 | 95 | ||
@@ -105,7 +105,7 @@ static int resize_info_buffer(struct snd_info_buffer *buffer, | |||
105 | * | 105 | * |
106 | * Outputs the string on the procfs buffer just like printf(). | 106 | * Outputs the string on the procfs buffer just like printf(). |
107 | * | 107 | * |
108 | * Returns the size of output string. | 108 | * Return: The size of output string, or a negative error code. |
109 | */ | 109 | */ |
110 | int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) | 110 | int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) |
111 | { | 111 | { |
@@ -344,7 +344,7 @@ static int snd_info_entry_open(struct inode *inode, struct file *file) | |||
344 | goto __nomem; | 344 | goto __nomem; |
345 | data->rbuffer = buffer; | 345 | data->rbuffer = buffer; |
346 | buffer->len = PAGE_SIZE; | 346 | buffer->len = PAGE_SIZE; |
347 | buffer->buffer = kmalloc(buffer->len, GFP_KERNEL); | 347 | buffer->buffer = kzalloc(buffer->len, GFP_KERNEL); |
348 | if (buffer->buffer == NULL) | 348 | if (buffer->buffer == NULL) |
349 | goto __nomem; | 349 | goto __nomem; |
350 | } | 350 | } |
@@ -683,32 +683,27 @@ int snd_info_card_free(struct snd_card *card) | |||
683 | * | 683 | * |
684 | * Reads one line from the buffer and stores the string. | 684 | * Reads one line from the buffer and stores the string. |
685 | * | 685 | * |
686 | * Returns zero if successful, or 1 if error or EOF. | 686 | * Return: Zero if successful, or 1 if error or EOF. |
687 | */ | 687 | */ |
688 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len) | 688 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len) |
689 | { | 689 | { |
690 | int c = -1; | 690 | int c = -1; |
691 | 691 | ||
692 | if (snd_BUG_ON(!buffer || !buffer->buffer)) | ||
693 | return 1; | ||
692 | if (len <= 0 || buffer->stop || buffer->error) | 694 | if (len <= 0 || buffer->stop || buffer->error) |
693 | return 1; | 695 | return 1; |
694 | while (--len > 0) { | 696 | while (!buffer->stop) { |
695 | c = buffer->buffer[buffer->curr++]; | 697 | c = buffer->buffer[buffer->curr++]; |
696 | if (c == '\n') { | 698 | if (buffer->curr >= buffer->size) |
697 | if (buffer->curr >= buffer->size) | ||
698 | buffer->stop = 1; | ||
699 | break; | ||
700 | } | ||
701 | *line++ = c; | ||
702 | if (buffer->curr >= buffer->size) { | ||
703 | buffer->stop = 1; | 699 | buffer->stop = 1; |
700 | if (c == '\n') | ||
704 | break; | 701 | break; |
702 | if (len) { | ||
703 | len--; | ||
704 | *line++ = c; | ||
705 | } | 705 | } |
706 | } | 706 | } |
707 | while (c != '\n' && !buffer->stop) { | ||
708 | c = buffer->buffer[buffer->curr++]; | ||
709 | if (buffer->curr >= buffer->size) | ||
710 | buffer->stop = 1; | ||
711 | } | ||
712 | *line = '\0'; | 707 | *line = '\0'; |
713 | return 0; | 708 | return 0; |
714 | } | 709 | } |
@@ -724,7 +719,7 @@ EXPORT_SYMBOL(snd_info_get_line); | |||
724 | * Parses the original string and copy a token to the given | 719 | * Parses the original string and copy a token to the given |
725 | * string buffer. | 720 | * string buffer. |
726 | * | 721 | * |
727 | * Returns the updated pointer of the original string so that | 722 | * Return: The updated pointer of the original string so that |
728 | * it can be used for the next call. | 723 | * it can be used for the next call. |
729 | */ | 724 | */ |
730 | const char *snd_info_get_str(char *dest, const char *src, int len) | 725 | const char *snd_info_get_str(char *dest, const char *src, int len) |
@@ -763,7 +758,7 @@ EXPORT_SYMBOL(snd_info_get_str); | |||
763 | * Usually called from other functions such as | 758 | * Usually called from other functions such as |
764 | * snd_info_create_card_entry(). | 759 | * snd_info_create_card_entry(). |
765 | * | 760 | * |
766 | * Returns the pointer of the new instance, or NULL on failure. | 761 | * Return: The pointer of the new instance, or %NULL on failure. |
767 | */ | 762 | */ |
768 | static struct snd_info_entry *snd_info_create_entry(const char *name) | 763 | static struct snd_info_entry *snd_info_create_entry(const char *name) |
769 | { | 764 | { |
@@ -792,7 +787,7 @@ static struct snd_info_entry *snd_info_create_entry(const char *name) | |||
792 | * | 787 | * |
793 | * Creates a new info entry and assigns it to the given module. | 788 | * Creates a new info entry and assigns it to the given module. |
794 | * | 789 | * |
795 | * Returns the pointer of the new instance, or NULL on failure. | 790 | * Return: The pointer of the new instance, or %NULL on failure. |
796 | */ | 791 | */ |
797 | struct snd_info_entry *snd_info_create_module_entry(struct module * module, | 792 | struct snd_info_entry *snd_info_create_module_entry(struct module * module, |
798 | const char *name, | 793 | const char *name, |
@@ -816,7 +811,7 @@ EXPORT_SYMBOL(snd_info_create_module_entry); | |||
816 | * | 811 | * |
817 | * Creates a new info entry and assigns it to the given card. | 812 | * Creates a new info entry and assigns it to the given card. |
818 | * | 813 | * |
819 | * Returns the pointer of the new instance, or NULL on failure. | 814 | * Return: The pointer of the new instance, or %NULL on failure. |
820 | */ | 815 | */ |
821 | struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card, | 816 | struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card, |
822 | const char *name, | 817 | const char *name, |
@@ -882,7 +877,7 @@ static int snd_info_dev_register_entry(struct snd_device *device) | |||
882 | * For releasing this entry, use snd_device_free() instead of | 877 | * For releasing this entry, use snd_device_free() instead of |
883 | * snd_info_free_entry(). | 878 | * snd_info_free_entry(). |
884 | * | 879 | * |
885 | * Returns zero if successful, or a negative error code on failure. | 880 | * Return: Zero if successful, or a negative error code on failure. |
886 | */ | 881 | */ |
887 | int snd_card_proc_new(struct snd_card *card, const char *name, | 882 | int snd_card_proc_new(struct snd_card *card, const char *name, |
888 | struct snd_info_entry **entryp) | 883 | struct snd_info_entry **entryp) |
@@ -938,7 +933,7 @@ EXPORT_SYMBOL(snd_info_free_entry); | |||
938 | * | 933 | * |
939 | * Registers the proc info entry. | 934 | * Registers the proc info entry. |
940 | * | 935 | * |
941 | * Returns zero if successful, or a negative error code on failure. | 936 | * Return: Zero if successful, or a negative error code on failure. |
942 | */ | 937 | */ |
943 | int snd_info_register(struct snd_info_entry * entry) | 938 | int snd_info_register(struct snd_info_entry * entry) |
944 | { | 939 | { |
diff --git a/sound/core/init.c b/sound/core/init.c index 7b012d15c2cf..6ef06400dfc8 100644 --- a/sound/core/init.c +++ b/sound/core/init.c | |||
@@ -144,7 +144,7 @@ static inline int init_info_for_card(struct snd_card *card) | |||
144 | * space for the driver to use freely. The allocated struct is stored | 144 | * space for the driver to use freely. The allocated struct is stored |
145 | * in the given card_ret pointer. | 145 | * in the given card_ret pointer. |
146 | * | 146 | * |
147 | * Returns zero if successful or a negative error code. | 147 | * Return: Zero if successful or a negative error code. |
148 | */ | 148 | */ |
149 | int snd_card_create(int idx, const char *xid, | 149 | int snd_card_create(int idx, const char *xid, |
150 | struct module *module, int extra_size, | 150 | struct module *module, int extra_size, |
@@ -337,7 +337,7 @@ static const struct file_operations snd_shutdown_f_ops = | |||
337 | * | 337 | * |
338 | * Disconnects all APIs from the file-operations (user space). | 338 | * Disconnects all APIs from the file-operations (user space). |
339 | * | 339 | * |
340 | * Returns zero, otherwise a negative error code. | 340 | * Return: Zero, otherwise a negative error code. |
341 | * | 341 | * |
342 | * Note: The current implementation replaces all active file->f_op with special | 342 | * Note: The current implementation replaces all active file->f_op with special |
343 | * dummy file operations (they do nothing except release). | 343 | * dummy file operations (they do nothing except release). |
@@ -415,7 +415,7 @@ EXPORT_SYMBOL(snd_card_disconnect); | |||
415 | * devices automatically. That is, you don't have to release the devices | 415 | * devices automatically. That is, you don't have to release the devices |
416 | * by yourself. | 416 | * by yourself. |
417 | * | 417 | * |
418 | * Returns zero. Frees all associated devices and frees the control | 418 | * Return: Zero. Frees all associated devices and frees the control |
419 | * interface associated to given soundcard. | 419 | * interface associated to given soundcard. |
420 | */ | 420 | */ |
421 | static int snd_card_do_free(struct snd_card *card) | 421 | static int snd_card_do_free(struct snd_card *card) |
@@ -677,7 +677,7 @@ static struct device_attribute card_number_attrs = | |||
677 | * external accesses. Thus, you should call this function at the end | 677 | * external accesses. Thus, you should call this function at the end |
678 | * of the initialization of the card. | 678 | * of the initialization of the card. |
679 | * | 679 | * |
680 | * Returns zero otherwise a negative error code if the registration failed. | 680 | * Return: Zero otherwise a negative error code if the registration failed. |
681 | */ | 681 | */ |
682 | int snd_card_register(struct snd_card *card) | 682 | int snd_card_register(struct snd_card *card) |
683 | { | 683 | { |
@@ -849,7 +849,7 @@ int __exit snd_card_info_done(void) | |||
849 | * This function adds the component id string to the supported list. | 849 | * This function adds the component id string to the supported list. |
850 | * The component can be referred from the alsa-lib. | 850 | * The component can be referred from the alsa-lib. |
851 | * | 851 | * |
852 | * Returns zero otherwise a negative error code. | 852 | * Return: Zero otherwise a negative error code. |
853 | */ | 853 | */ |
854 | 854 | ||
855 | int snd_component_add(struct snd_card *card, const char *component) | 855 | int snd_component_add(struct snd_card *card, const char *component) |
@@ -883,7 +883,7 @@ EXPORT_SYMBOL(snd_component_add); | |||
883 | * This linked-list is used to keep tracking the connection state, | 883 | * This linked-list is used to keep tracking the connection state, |
884 | * and to avoid the release of busy resources by hotplug. | 884 | * and to avoid the release of busy resources by hotplug. |
885 | * | 885 | * |
886 | * Returns zero or a negative error code. | 886 | * Return: zero or a negative error code. |
887 | */ | 887 | */ |
888 | int snd_card_file_add(struct snd_card *card, struct file *file) | 888 | int snd_card_file_add(struct snd_card *card, struct file *file) |
889 | { | 889 | { |
@@ -920,7 +920,7 @@ EXPORT_SYMBOL(snd_card_file_add); | |||
920 | * called beforehand, it processes the pending release of | 920 | * called beforehand, it processes the pending release of |
921 | * resources. | 921 | * resources. |
922 | * | 922 | * |
923 | * Returns zero or a negative error code. | 923 | * Return: Zero or a negative error code. |
924 | */ | 924 | */ |
925 | int snd_card_file_remove(struct snd_card *card, struct file *file) | 925 | int snd_card_file_remove(struct snd_card *card, struct file *file) |
926 | { | 926 | { |
@@ -959,6 +959,8 @@ EXPORT_SYMBOL(snd_card_file_remove); | |||
959 | * | 959 | * |
960 | * Waits until the power-state is changed. | 960 | * Waits until the power-state is changed. |
961 | * | 961 | * |
962 | * Return: Zero if successful, or a negative error code. | ||
963 | * | ||
962 | * Note: the power lock must be active before call. | 964 | * Note: the power lock must be active before call. |
963 | */ | 965 | */ |
964 | int snd_power_wait(struct snd_card *card, unsigned int power_state) | 966 | int snd_power_wait(struct snd_card *card, unsigned int power_state) |
diff --git a/sound/core/isadma.c b/sound/core/isadma.c index c0f1208bb7df..e2b386156a4c 100644 --- a/sound/core/isadma.c +++ b/sound/core/isadma.c | |||
@@ -81,7 +81,7 @@ EXPORT_SYMBOL(snd_dma_disable); | |||
81 | * @dma: the dma number | 81 | * @dma: the dma number |
82 | * @size: the dma transfer size | 82 | * @size: the dma transfer size |
83 | * | 83 | * |
84 | * Returns the current pointer in DMA tranfer buffer in bytes | 84 | * Return: The current pointer in DMA transfer buffer in bytes. |
85 | */ | 85 | */ |
86 | unsigned int snd_dma_pointer(unsigned long dma, unsigned int size) | 86 | unsigned int snd_dma_pointer(unsigned long dma, unsigned int size) |
87 | { | 87 | { |
diff --git a/sound/core/jack.c b/sound/core/jack.c index a06b1651fcba..b35fe7345c20 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c | |||
@@ -98,8 +98,8 @@ static int snd_jack_dev_register(struct snd_device *device) | |||
98 | * | 98 | * |
99 | * Creates a new jack object. | 99 | * Creates a new jack object. |
100 | * | 100 | * |
101 | * Returns zero if successful, or a negative error code on failure. | 101 | * Return: Zero if successful, or a negative error code on failure. |
102 | * On success jjack will be initialised. | 102 | * On success @jjack will be initialised. |
103 | */ | 103 | */ |
104 | int snd_jack_new(struct snd_card *card, const char *id, int type, | 104 | int snd_jack_new(struct snd_card *card, const char *id, int type, |
105 | struct snd_jack **jjack) | 105 | struct snd_jack **jjack) |
@@ -189,6 +189,8 @@ EXPORT_SYMBOL(snd_jack_set_parent); | |||
189 | * using this abstraction. | 189 | * using this abstraction. |
190 | * | 190 | * |
191 | * This function may only be called prior to registration of the jack. | 191 | * This function may only be called prior to registration of the jack. |
192 | * | ||
193 | * Return: Zero if successful, or a negative error code on failure. | ||
192 | */ | 194 | */ |
193 | int snd_jack_set_key(struct snd_jack *jack, enum snd_jack_types type, | 195 | int snd_jack_set_key(struct snd_jack *jack, enum snd_jack_types type, |
194 | int keytype) | 196 | int keytype) |
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 691569238435..bdf826f4fe0c 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c | |||
@@ -81,7 +81,7 @@ static inline void dec_snd_pages(int order) | |||
81 | * | 81 | * |
82 | * Allocates the physically contiguous pages with the given size. | 82 | * Allocates the physically contiguous pages with the given size. |
83 | * | 83 | * |
84 | * Returns the pointer of the buffer, or NULL if no enoguh memory. | 84 | * Return: The pointer of the buffer, or %NULL if no enough memory. |
85 | */ | 85 | */ |
86 | void *snd_malloc_pages(size_t size, gfp_t gfp_flags) | 86 | void *snd_malloc_pages(size_t size, gfp_t gfp_flags) |
87 | { | 87 | { |
@@ -175,9 +175,9 @@ static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr, | |||
175 | * | 175 | * |
176 | * Calls the memory-allocator function for the corresponding | 176 | * Calls the memory-allocator function for the corresponding |
177 | * buffer type. | 177 | * buffer type. |
178 | * | 178 | * |
179 | * Returns zero if the buffer with the given size is allocated successfully, | 179 | * Return: Zero if the buffer with the given size is allocated successfully, |
180 | * other a negative value at error. | 180 | * otherwise a negative value on error. |
181 | */ | 181 | */ |
182 | int snd_dma_alloc_pages(int type, struct device *device, size_t size, | 182 | int snd_dma_alloc_pages(int type, struct device *device, size_t size, |
183 | struct snd_dma_buffer *dmab) | 183 | struct snd_dma_buffer *dmab) |
@@ -229,9 +229,9 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size, | |||
229 | * buffer type. When no space is left, this function reduces the size and | 229 | * buffer type. When no space is left, this function reduces the size and |
230 | * tries to allocate again. The size actually allocated is stored in | 230 | * tries to allocate again. The size actually allocated is stored in |
231 | * res_size argument. | 231 | * res_size argument. |
232 | * | 232 | * |
233 | * Returns zero if the buffer with the given size is allocated successfully, | 233 | * Return: Zero if the buffer with the given size is allocated successfully, |
234 | * other a negative value at error. | 234 | * otherwise a negative value on error. |
235 | */ | 235 | */ |
236 | int snd_dma_alloc_pages_fallback(int type, struct device *device, size_t size, | 236 | int snd_dma_alloc_pages_fallback(int type, struct device *device, size_t size, |
237 | struct snd_dma_buffer *dmab) | 237 | struct snd_dma_buffer *dmab) |
@@ -292,7 +292,7 @@ void snd_dma_free_pages(struct snd_dma_buffer *dmab) | |||
292 | * Looks for the reserved-buffer list and re-uses if the same buffer | 292 | * Looks for the reserved-buffer list and re-uses if the same buffer |
293 | * is found in the list. When the buffer is found, it's removed from the free list. | 293 | * is found in the list. When the buffer is found, it's removed from the free list. |
294 | * | 294 | * |
295 | * Returns the size of buffer if the buffer is found, or zero if not found. | 295 | * Return: The size of buffer if the buffer is found, or zero if not found. |
296 | */ | 296 | */ |
297 | size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id) | 297 | size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id) |
298 | { | 298 | { |
@@ -326,8 +326,8 @@ size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id) | |||
326 | * @id: the buffer id | 326 | * @id: the buffer id |
327 | * | 327 | * |
328 | * Reserves the given buffer as a reserved buffer. | 328 | * Reserves the given buffer as a reserved buffer. |
329 | * | 329 | * |
330 | * Returns zero if successful, or a negative code at error. | 330 | * Return: Zero if successful, or a negative code on error. |
331 | */ | 331 | */ |
332 | int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id) | 332 | int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id) |
333 | { | 333 | { |
diff --git a/sound/core/memory.c b/sound/core/memory.c index 66a278d0b04e..36c0f1a2e189 100644 --- a/sound/core/memory.c +++ b/sound/core/memory.c | |||
@@ -33,7 +33,7 @@ | |||
33 | * | 33 | * |
34 | * Copies the data from mmio-space to user-space. | 34 | * Copies the data from mmio-space to user-space. |
35 | * | 35 | * |
36 | * Returns zero if successful, or non-zero on failure. | 36 | * Return: Zero if successful, or non-zero on failure. |
37 | */ | 37 | */ |
38 | int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count) | 38 | int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count) |
39 | { | 39 | { |
@@ -66,7 +66,7 @@ EXPORT_SYMBOL(copy_to_user_fromio); | |||
66 | * | 66 | * |
67 | * Copies the data from user-space to mmio-space. | 67 | * Copies the data from user-space to mmio-space. |
68 | * | 68 | * |
69 | * Returns zero if successful, or non-zero on failure. | 69 | * Return: Zero if successful, or non-zero on failure. |
70 | */ | 70 | */ |
71 | int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count) | 71 | int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count) |
72 | { | 72 | { |
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 61798f85d030..17f45e8aa89c 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -209,6 +209,8 @@ static char *snd_pcm_format_names[] = { | |||
209 | FORMAT(G723_24_1B), | 209 | FORMAT(G723_24_1B), |
210 | FORMAT(G723_40), | 210 | FORMAT(G723_40), |
211 | FORMAT(G723_40_1B), | 211 | FORMAT(G723_40_1B), |
212 | FORMAT(DSD_U8), | ||
213 | FORMAT(DSD_U16_LE), | ||
212 | }; | 214 | }; |
213 | 215 | ||
214 | const char *snd_pcm_format_name(snd_pcm_format_t format) | 216 | const char *snd_pcm_format_name(snd_pcm_format_t format) |
@@ -637,7 +639,7 @@ static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substrea | |||
637 | * calling this, i.e. zero must be given to the argument of | 639 | * calling this, i.e. zero must be given to the argument of |
638 | * snd_pcm_new(). | 640 | * snd_pcm_new(). |
639 | * | 641 | * |
640 | * Returns zero if successful, or a negative error code on failure. | 642 | * Return: Zero if successful, or a negative error code on failure. |
641 | */ | 643 | */ |
642 | int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) | 644 | int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) |
643 | { | 645 | { |
@@ -759,7 +761,7 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device, | |||
759 | * The pcm operators have to be set afterwards to the new instance | 761 | * The pcm operators have to be set afterwards to the new instance |
760 | * via snd_pcm_set_ops(). | 762 | * via snd_pcm_set_ops(). |
761 | * | 763 | * |
762 | * Returns zero if successful, or a negative error code on failure. | 764 | * Return: Zero if successful, or a negative error code on failure. |
763 | */ | 765 | */ |
764 | int snd_pcm_new(struct snd_card *card, const char *id, int device, | 766 | int snd_pcm_new(struct snd_card *card, const char *id, int device, |
765 | int playback_count, int capture_count, struct snd_pcm **rpcm) | 767 | int playback_count, int capture_count, struct snd_pcm **rpcm) |
@@ -787,7 +789,7 @@ EXPORT_SYMBOL(snd_pcm_new); | |||
787 | * The pcm operators have to be set afterwards to the new instance | 789 | * The pcm operators have to be set afterwards to the new instance |
788 | * via snd_pcm_set_ops(). | 790 | * via snd_pcm_set_ops(). |
789 | * | 791 | * |
790 | * Returns zero if successful, or a negative error code on failure. | 792 | * Return: Zero if successful, or a negative error code on failure. |
791 | */ | 793 | */ |
792 | int snd_pcm_new_internal(struct snd_card *card, const char *id, int device, | 794 | int snd_pcm_new_internal(struct snd_card *card, const char *id, int device, |
793 | int playback_count, int capture_count, | 795 | int playback_count, int capture_count, |
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index c4840ff75d00..41b3dfe68698 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -666,7 +666,8 @@ static inline unsigned int muldiv32(unsigned int a, unsigned int b, | |||
666 | * The interval is changed to the range satisfying both intervals. | 666 | * The interval is changed to the range satisfying both intervals. |
667 | * The interval status (min, max, integer, etc.) are evaluated. | 667 | * The interval status (min, max, integer, etc.) are evaluated. |
668 | * | 668 | * |
669 | * Returns non-zero if the value is changed, zero if not changed. | 669 | * Return: Positive if the value is changed, zero if it's not changed, or a |
670 | * negative error code. | ||
670 | */ | 671 | */ |
671 | int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v) | 672 | int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v) |
672 | { | 673 | { |
@@ -865,7 +866,8 @@ void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, | |||
865 | * @nump: pointer to store the resultant numerator | 866 | * @nump: pointer to store the resultant numerator |
866 | * @denp: pointer to store the resultant denominator | 867 | * @denp: pointer to store the resultant denominator |
867 | * | 868 | * |
868 | * Returns non-zero if the value is changed, zero if not changed. | 869 | * Return: Positive if the value is changed, zero if it's not changed, or a |
870 | * negative error code. | ||
869 | */ | 871 | */ |
870 | int snd_interval_ratnum(struct snd_interval *i, | 872 | int snd_interval_ratnum(struct snd_interval *i, |
871 | unsigned int rats_count, struct snd_ratnum *rats, | 873 | unsigned int rats_count, struct snd_ratnum *rats, |
@@ -983,7 +985,8 @@ EXPORT_SYMBOL(snd_interval_ratnum); | |||
983 | * @nump: pointer to store the resultant numerator | 985 | * @nump: pointer to store the resultant numerator |
984 | * @denp: pointer to store the resultant denominator | 986 | * @denp: pointer to store the resultant denominator |
985 | * | 987 | * |
986 | * Returns non-zero if the value is changed, zero if not changed. | 988 | * Return: Positive if the value is changed, zero if it's not changed, or a |
989 | * negative error code. | ||
987 | */ | 990 | */ |
988 | static int snd_interval_ratden(struct snd_interval *i, | 991 | static int snd_interval_ratden(struct snd_interval *i, |
989 | unsigned int rats_count, struct snd_ratden *rats, | 992 | unsigned int rats_count, struct snd_ratden *rats, |
@@ -1082,7 +1085,8 @@ static int snd_interval_ratden(struct snd_interval *i, | |||
1082 | * When mask is non-zero, only the elements corresponding to bit 1 are | 1085 | * When mask is non-zero, only the elements corresponding to bit 1 are |
1083 | * evaluated. | 1086 | * evaluated. |
1084 | * | 1087 | * |
1085 | * Returns non-zero if the value is changed, zero if not changed. | 1088 | * Return: Positive if the value is changed, zero if it's not changed, or a |
1089 | * negative error code. | ||
1086 | */ | 1090 | */ |
1087 | int snd_interval_list(struct snd_interval *i, unsigned int count, | 1091 | int snd_interval_list(struct snd_interval *i, unsigned int count, |
1088 | const unsigned int *list, unsigned int mask) | 1092 | const unsigned int *list, unsigned int mask) |
@@ -1142,7 +1146,7 @@ static int snd_interval_step(struct snd_interval *i, unsigned int min, unsigned | |||
1142 | * @private: the private data pointer passed to function | 1146 | * @private: the private data pointer passed to function |
1143 | * @dep: the dependent variables | 1147 | * @dep: the dependent variables |
1144 | * | 1148 | * |
1145 | * Returns zero if successful, or a negative error code on failure. | 1149 | * Return: Zero if successful, or a negative error code on failure. |
1146 | */ | 1150 | */ |
1147 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, | 1151 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, |
1148 | int var, | 1152 | int var, |
@@ -1200,6 +1204,8 @@ EXPORT_SYMBOL(snd_pcm_hw_rule_add); | |||
1200 | * @mask: the bitmap mask | 1204 | * @mask: the bitmap mask |
1201 | * | 1205 | * |
1202 | * Apply the constraint of the given bitmap mask to a 32-bit mask parameter. | 1206 | * Apply the constraint of the given bitmap mask to a 32-bit mask parameter. |
1207 | * | ||
1208 | * Return: Zero if successful, or a negative error code on failure. | ||
1203 | */ | 1209 | */ |
1204 | int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, | 1210 | int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
1205 | u_int32_t mask) | 1211 | u_int32_t mask) |
@@ -1220,6 +1226,8 @@ int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param | |||
1220 | * @mask: the 64bit bitmap mask | 1226 | * @mask: the 64bit bitmap mask |
1221 | * | 1227 | * |
1222 | * Apply the constraint of the given bitmap mask to a 64-bit mask parameter. | 1228 | * Apply the constraint of the given bitmap mask to a 64-bit mask parameter. |
1229 | * | ||
1230 | * Return: Zero if successful, or a negative error code on failure. | ||
1223 | */ | 1231 | */ |
1224 | int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, | 1232 | int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
1225 | u_int64_t mask) | 1233 | u_int64_t mask) |
@@ -1240,6 +1248,9 @@ int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_par | |||
1240 | * @var: hw_params variable to apply the integer constraint | 1248 | * @var: hw_params variable to apply the integer constraint |
1241 | * | 1249 | * |
1242 | * Apply the constraint of integer to an interval parameter. | 1250 | * Apply the constraint of integer to an interval parameter. |
1251 | * | ||
1252 | * Return: Positive if the value is changed, zero if it's not changed, or a | ||
1253 | * negative error code. | ||
1243 | */ | 1254 | */ |
1244 | int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var) | 1255 | int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var) |
1245 | { | 1256 | { |
@@ -1257,6 +1268,9 @@ EXPORT_SYMBOL(snd_pcm_hw_constraint_integer); | |||
1257 | * @max: the maximal value | 1268 | * @max: the maximal value |
1258 | * | 1269 | * |
1259 | * Apply the min/max range constraint to an interval parameter. | 1270 | * Apply the min/max range constraint to an interval parameter. |
1271 | * | ||
1272 | * Return: Positive if the value is changed, zero if it's not changed, or a | ||
1273 | * negative error code. | ||
1260 | */ | 1274 | */ |
1261 | int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, | 1275 | int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
1262 | unsigned int min, unsigned int max) | 1276 | unsigned int min, unsigned int max) |
@@ -1288,6 +1302,8 @@ static int snd_pcm_hw_rule_list(struct snd_pcm_hw_params *params, | |||
1288 | * @l: list | 1302 | * @l: list |
1289 | * | 1303 | * |
1290 | * Apply the list of constraints to an interval parameter. | 1304 | * Apply the list of constraints to an interval parameter. |
1305 | * | ||
1306 | * Return: Zero if successful, or a negative error code on failure. | ||
1291 | */ | 1307 | */ |
1292 | int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, | 1308 | int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, |
1293 | unsigned int cond, | 1309 | unsigned int cond, |
@@ -1322,6 +1338,8 @@ static int snd_pcm_hw_rule_ratnums(struct snd_pcm_hw_params *params, | |||
1322 | * @cond: condition bits | 1338 | * @cond: condition bits |
1323 | * @var: hw_params variable to apply the ratnums constraint | 1339 | * @var: hw_params variable to apply the ratnums constraint |
1324 | * @r: struct snd_ratnums constriants | 1340 | * @r: struct snd_ratnums constriants |
1341 | * | ||
1342 | * Return: Zero if successful, or a negative error code on failure. | ||
1325 | */ | 1343 | */ |
1326 | int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, | 1344 | int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, |
1327 | unsigned int cond, | 1345 | unsigned int cond, |
@@ -1355,6 +1373,8 @@ static int snd_pcm_hw_rule_ratdens(struct snd_pcm_hw_params *params, | |||
1355 | * @cond: condition bits | 1373 | * @cond: condition bits |
1356 | * @var: hw_params variable to apply the ratdens constraint | 1374 | * @var: hw_params variable to apply the ratdens constraint |
1357 | * @r: struct snd_ratdens constriants | 1375 | * @r: struct snd_ratdens constriants |
1376 | * | ||
1377 | * Return: Zero if successful, or a negative error code on failure. | ||
1358 | */ | 1378 | */ |
1359 | int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, | 1379 | int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, |
1360 | unsigned int cond, | 1380 | unsigned int cond, |
@@ -1386,6 +1406,8 @@ static int snd_pcm_hw_rule_msbits(struct snd_pcm_hw_params *params, | |||
1386 | * @cond: condition bits | 1406 | * @cond: condition bits |
1387 | * @width: sample bits width | 1407 | * @width: sample bits width |
1388 | * @msbits: msbits width | 1408 | * @msbits: msbits width |
1409 | * | ||
1410 | * Return: Zero if successful, or a negative error code on failure. | ||
1389 | */ | 1411 | */ |
1390 | int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, | 1412 | int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, |
1391 | unsigned int cond, | 1413 | unsigned int cond, |
@@ -1414,6 +1436,8 @@ static int snd_pcm_hw_rule_step(struct snd_pcm_hw_params *params, | |||
1414 | * @cond: condition bits | 1436 | * @cond: condition bits |
1415 | * @var: hw_params variable to apply the step constraint | 1437 | * @var: hw_params variable to apply the step constraint |
1416 | * @step: step size | 1438 | * @step: step size |
1439 | * | ||
1440 | * Return: Zero if successful, or a negative error code on failure. | ||
1417 | */ | 1441 | */ |
1418 | int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, | 1442 | int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, |
1419 | unsigned int cond, | 1443 | unsigned int cond, |
@@ -1444,6 +1468,8 @@ static int snd_pcm_hw_rule_pow2(struct snd_pcm_hw_params *params, struct snd_pcm | |||
1444 | * @runtime: PCM runtime instance | 1468 | * @runtime: PCM runtime instance |
1445 | * @cond: condition bits | 1469 | * @cond: condition bits |
1446 | * @var: hw_params variable to apply the power-of-2 constraint | 1470 | * @var: hw_params variable to apply the power-of-2 constraint |
1471 | * | ||
1472 | * Return: Zero if successful, or a negative error code on failure. | ||
1447 | */ | 1473 | */ |
1448 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, | 1474 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, |
1449 | unsigned int cond, | 1475 | unsigned int cond, |
@@ -1470,6 +1496,8 @@ static int snd_pcm_hw_rule_noresample_func(struct snd_pcm_hw_params *params, | |||
1470 | * snd_pcm_hw_rule_noresample - add a rule to allow disabling hw resampling | 1496 | * snd_pcm_hw_rule_noresample - add a rule to allow disabling hw resampling |
1471 | * @runtime: PCM runtime instance | 1497 | * @runtime: PCM runtime instance |
1472 | * @base_rate: the rate at which the hardware does not resample | 1498 | * @base_rate: the rate at which the hardware does not resample |
1499 | * | ||
1500 | * Return: Zero if successful, or a negative error code on failure. | ||
1473 | */ | 1501 | */ |
1474 | int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime, | 1502 | int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime, |
1475 | unsigned int base_rate) | 1503 | unsigned int base_rate) |
@@ -1519,8 +1547,8 @@ EXPORT_SYMBOL(_snd_pcm_hw_params_any); | |||
1519 | * @var: parameter to retrieve | 1547 | * @var: parameter to retrieve |
1520 | * @dir: pointer to the direction (-1,0,1) or %NULL | 1548 | * @dir: pointer to the direction (-1,0,1) or %NULL |
1521 | * | 1549 | * |
1522 | * Return the value for field @var if it's fixed in configuration space | 1550 | * Return: The value for field @var if it's fixed in configuration space |
1523 | * defined by @params. Return -%EINVAL otherwise. | 1551 | * defined by @params. -%EINVAL otherwise. |
1524 | */ | 1552 | */ |
1525 | int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params, | 1553 | int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params, |
1526 | snd_pcm_hw_param_t var, int *dir) | 1554 | snd_pcm_hw_param_t var, int *dir) |
@@ -1591,7 +1619,8 @@ static int _snd_pcm_hw_param_first(struct snd_pcm_hw_params *params, | |||
1591 | * | 1619 | * |
1592 | * Inside configuration space defined by @params remove from @var all | 1620 | * Inside configuration space defined by @params remove from @var all |
1593 | * values > minimum. Reduce configuration space accordingly. | 1621 | * values > minimum. Reduce configuration space accordingly. |
1594 | * Return the minimum. | 1622 | * |
1623 | * Return: The minimum, or a negative error code on failure. | ||
1595 | */ | 1624 | */ |
1596 | int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, | 1625 | int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, |
1597 | struct snd_pcm_hw_params *params, | 1626 | struct snd_pcm_hw_params *params, |
@@ -1637,7 +1666,8 @@ static int _snd_pcm_hw_param_last(struct snd_pcm_hw_params *params, | |||
1637 | * | 1666 | * |
1638 | * Inside configuration space defined by @params remove from @var all | 1667 | * Inside configuration space defined by @params remove from @var all |
1639 | * values < maximum. Reduce configuration space accordingly. | 1668 | * values < maximum. Reduce configuration space accordingly. |
1640 | * Return the maximum. | 1669 | * |
1670 | * Return: The maximum, or a negative error code on failure. | ||
1641 | */ | 1671 | */ |
1642 | int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm, | 1672 | int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm, |
1643 | struct snd_pcm_hw_params *params, | 1673 | struct snd_pcm_hw_params *params, |
@@ -1665,6 +1695,8 @@ EXPORT_SYMBOL(snd_pcm_hw_param_last); | |||
1665 | * The configuration chosen is that obtained fixing in this order: | 1695 | * The configuration chosen is that obtained fixing in this order: |
1666 | * first access, first format, first subformat, min channels, | 1696 | * first access, first format, first subformat, min channels, |
1667 | * min rate, min period time, max buffer size, min tick time | 1697 | * min rate, min period time, max buffer size, min tick time |
1698 | * | ||
1699 | * Return: Zero if successful, or a negative error code on failure. | ||
1668 | */ | 1700 | */ |
1669 | int snd_pcm_hw_params_choose(struct snd_pcm_substream *pcm, | 1701 | int snd_pcm_hw_params_choose(struct snd_pcm_substream *pcm, |
1670 | struct snd_pcm_hw_params *params) | 1702 | struct snd_pcm_hw_params *params) |
@@ -1771,7 +1803,7 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream, | |||
1771 | * Processes the generic ioctl commands for PCM. | 1803 | * Processes the generic ioctl commands for PCM. |
1772 | * Can be passed as the ioctl callback for PCM ops. | 1804 | * Can be passed as the ioctl callback for PCM ops. |
1773 | * | 1805 | * |
1774 | * Returns zero if successful, or a negative error code on failure. | 1806 | * Return: Zero if successful, or a negative error code on failure. |
1775 | */ | 1807 | */ |
1776 | int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, | 1808 | int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, |
1777 | unsigned int cmd, void *arg) | 1809 | unsigned int cmd, void *arg) |
@@ -2510,7 +2542,7 @@ static void pcm_chmap_ctl_private_free(struct snd_kcontrol *kcontrol) | |||
2510 | * @info_ret: store struct snd_pcm_chmap instance if non-NULL | 2542 | * @info_ret: store struct snd_pcm_chmap instance if non-NULL |
2511 | * | 2543 | * |
2512 | * Create channel-mapping control elements assigned to the given PCM stream(s). | 2544 | * Create channel-mapping control elements assigned to the given PCM stream(s). |
2513 | * Returns zero if succeed, or a negative error value. | 2545 | * Return: Zero if successful, or a negative error value. |
2514 | */ | 2546 | */ |
2515 | int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream, | 2547 | int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream, |
2516 | const struct snd_pcm_chmap_elem *chmap, | 2548 | const struct snd_pcm_chmap_elem *chmap, |
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index 69e01c4fc32d..0af622c34e19 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c | |||
@@ -95,7 +95,7 @@ static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream | |||
95 | * | 95 | * |
96 | * Releases the pre-allocated buffer of the given substream. | 96 | * Releases the pre-allocated buffer of the given substream. |
97 | * | 97 | * |
98 | * Returns zero if successful, or a negative error code on failure. | 98 | * Return: Zero if successful, or a negative error code on failure. |
99 | */ | 99 | */ |
100 | int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) | 100 | int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) |
101 | { | 101 | { |
@@ -115,7 +115,7 @@ int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) | |||
115 | * | 115 | * |
116 | * Releases all the pre-allocated buffers on the given pcm. | 116 | * Releases all the pre-allocated buffers on the given pcm. |
117 | * | 117 | * |
118 | * Returns zero if successful, or a negative error code on failure. | 118 | * Return: Zero if successful, or a negative error code on failure. |
119 | */ | 119 | */ |
120 | int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm) | 120 | int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm) |
121 | { | 121 | { |
@@ -265,7 +265,7 @@ static int snd_pcm_lib_preallocate_pages1(struct snd_pcm_substream *substream, | |||
265 | * destruction time. The dma_buf_id must be unique for all systems | 265 | * destruction time. The dma_buf_id must be unique for all systems |
266 | * (in the same DMA buffer type) e.g. using snd_dma_pci_buf_id(). | 266 | * (in the same DMA buffer type) e.g. using snd_dma_pci_buf_id(). |
267 | * | 267 | * |
268 | * Returns zero if successful, or a negative error code on failure. | 268 | * Return: Zero if successful, or a negative error code on failure. |
269 | */ | 269 | */ |
270 | int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream, | 270 | int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream, |
271 | int type, struct device *data, | 271 | int type, struct device *data, |
@@ -289,7 +289,7 @@ EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages); | |||
289 | * Do pre-allocation to all substreams of the given pcm for the | 289 | * Do pre-allocation to all substreams of the given pcm for the |
290 | * specified DMA type. | 290 | * specified DMA type. |
291 | * | 291 | * |
292 | * Returns zero if successful, or a negative error code on failure. | 292 | * Return: Zero if successful, or a negative error code on failure. |
293 | */ | 293 | */ |
294 | int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, | 294 | int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, |
295 | int type, void *data, | 295 | int type, void *data, |
@@ -313,8 +313,9 @@ EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages_for_all); | |||
313 | * @substream: the pcm substream instance | 313 | * @substream: the pcm substream instance |
314 | * @offset: the buffer offset | 314 | * @offset: the buffer offset |
315 | * | 315 | * |
316 | * Returns the page struct at the given buffer offset. | ||
317 | * Used as the page callback of PCM ops. | 316 | * Used as the page callback of PCM ops. |
317 | * | ||
318 | * Return: The page struct at the given buffer offset. %NULL on failure. | ||
318 | */ | 319 | */ |
319 | struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset) | 320 | struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset) |
320 | { | 321 | { |
@@ -337,7 +338,7 @@ EXPORT_SYMBOL(snd_pcm_sgbuf_ops_page); | |||
337 | * Allocates the DMA buffer on the BUS type given earlier to | 338 | * Allocates the DMA buffer on the BUS type given earlier to |
338 | * snd_pcm_lib_preallocate_xxx_pages(). | 339 | * snd_pcm_lib_preallocate_xxx_pages(). |
339 | * | 340 | * |
340 | * Returns 1 if the buffer is changed, 0 if not changed, or a negative | 341 | * Return: 1 if the buffer is changed, 0 if not changed, or a negative |
341 | * code on failure. | 342 | * code on failure. |
342 | */ | 343 | */ |
343 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size) | 344 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size) |
@@ -390,7 +391,7 @@ EXPORT_SYMBOL(snd_pcm_lib_malloc_pages); | |||
390 | * | 391 | * |
391 | * Releases the DMA buffer allocated via snd_pcm_lib_malloc_pages(). | 392 | * Releases the DMA buffer allocated via snd_pcm_lib_malloc_pages(). |
392 | * | 393 | * |
393 | * Returns zero if successful, or a negative error code on failure. | 394 | * Return: Zero if successful, or a negative error code on failure. |
394 | */ | 395 | */ |
395 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream) | 396 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream) |
396 | { | 397 | { |
@@ -437,6 +438,8 @@ EXPORT_SYMBOL(_snd_pcm_lib_alloc_vmalloc_buffer); | |||
437 | * snd_pcm_lib_free_vmalloc_buffer - free vmalloc buffer | 438 | * snd_pcm_lib_free_vmalloc_buffer - free vmalloc buffer |
438 | * @substream: the substream with a buffer allocated by | 439 | * @substream: the substream with a buffer allocated by |
439 | * snd_pcm_lib_alloc_vmalloc_buffer() | 440 | * snd_pcm_lib_alloc_vmalloc_buffer() |
441 | * | ||
442 | * Return: Zero if successful, or a negative error code on failure. | ||
440 | */ | 443 | */ |
441 | int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream) | 444 | int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream) |
442 | { | 445 | { |
@@ -458,6 +461,8 @@ EXPORT_SYMBOL(snd_pcm_lib_free_vmalloc_buffer); | |||
458 | * @offset: offset in the buffer | 461 | * @offset: offset in the buffer |
459 | * | 462 | * |
460 | * This function is to be used as the page callback in the PCM ops. | 463 | * This function is to be used as the page callback in the PCM ops. |
464 | * | ||
465 | * Return: The page struct, or %NULL on failure. | ||
461 | */ | 466 | */ |
462 | struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, | 467 | struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, |
463 | unsigned long offset) | 468 | unsigned long offset) |
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c index d4fc1bfbe457..43f24cce3dec 100644 --- a/sound/core/pcm_misc.c +++ b/sound/core/pcm_misc.c | |||
@@ -140,6 +140,14 @@ static struct pcm_format_data pcm_formats[(INT)SNDRV_PCM_FORMAT_LAST+1] = { | |||
140 | .width = 5, .phys = 5, .le = -1, .signd = -1, | 140 | .width = 5, .phys = 5, .le = -1, .signd = -1, |
141 | .silence = {}, | 141 | .silence = {}, |
142 | }, | 142 | }, |
143 | [SNDRV_PCM_FORMAT_DSD_U8] = { | ||
144 | .width = 8, .phys = 8, .le = 1, .signd = 0, | ||
145 | .silence = {}, | ||
146 | }, | ||
147 | [SNDRV_PCM_FORMAT_DSD_U16_LE] = { | ||
148 | .width = 16, .phys = 16, .le = 1, .signd = 0, | ||
149 | .silence = {}, | ||
150 | }, | ||
143 | /* FIXME: the following three formats are not defined properly yet */ | 151 | /* FIXME: the following three formats are not defined properly yet */ |
144 | [SNDRV_PCM_FORMAT_MPEG] = { | 152 | [SNDRV_PCM_FORMAT_MPEG] = { |
145 | .le = -1, .signd = -1, | 153 | .le = -1, .signd = -1, |
@@ -213,7 +221,7 @@ static struct pcm_format_data pcm_formats[(INT)SNDRV_PCM_FORMAT_LAST+1] = { | |||
213 | * snd_pcm_format_signed - Check the PCM format is signed linear | 221 | * snd_pcm_format_signed - Check the PCM format is signed linear |
214 | * @format: the format to check | 222 | * @format: the format to check |
215 | * | 223 | * |
216 | * Returns 1 if the given PCM format is signed linear, 0 if unsigned | 224 | * Return: 1 if the given PCM format is signed linear, 0 if unsigned |
217 | * linear, and a negative error code for non-linear formats. | 225 | * linear, and a negative error code for non-linear formats. |
218 | */ | 226 | */ |
219 | int snd_pcm_format_signed(snd_pcm_format_t format) | 227 | int snd_pcm_format_signed(snd_pcm_format_t format) |
@@ -232,7 +240,7 @@ EXPORT_SYMBOL(snd_pcm_format_signed); | |||
232 | * snd_pcm_format_unsigned - Check the PCM format is unsigned linear | 240 | * snd_pcm_format_unsigned - Check the PCM format is unsigned linear |
233 | * @format: the format to check | 241 | * @format: the format to check |
234 | * | 242 | * |
235 | * Returns 1 if the given PCM format is unsigned linear, 0 if signed | 243 | * Return: 1 if the given PCM format is unsigned linear, 0 if signed |
236 | * linear, and a negative error code for non-linear formats. | 244 | * linear, and a negative error code for non-linear formats. |
237 | */ | 245 | */ |
238 | int snd_pcm_format_unsigned(snd_pcm_format_t format) | 246 | int snd_pcm_format_unsigned(snd_pcm_format_t format) |
@@ -251,7 +259,7 @@ EXPORT_SYMBOL(snd_pcm_format_unsigned); | |||
251 | * snd_pcm_format_linear - Check the PCM format is linear | 259 | * snd_pcm_format_linear - Check the PCM format is linear |
252 | * @format: the format to check | 260 | * @format: the format to check |
253 | * | 261 | * |
254 | * Returns 1 if the given PCM format is linear, 0 if not. | 262 | * Return: 1 if the given PCM format is linear, 0 if not. |
255 | */ | 263 | */ |
256 | int snd_pcm_format_linear(snd_pcm_format_t format) | 264 | int snd_pcm_format_linear(snd_pcm_format_t format) |
257 | { | 265 | { |
@@ -264,7 +272,7 @@ EXPORT_SYMBOL(snd_pcm_format_linear); | |||
264 | * snd_pcm_format_little_endian - Check the PCM format is little-endian | 272 | * snd_pcm_format_little_endian - Check the PCM format is little-endian |
265 | * @format: the format to check | 273 | * @format: the format to check |
266 | * | 274 | * |
267 | * Returns 1 if the given PCM format is little-endian, 0 if | 275 | * Return: 1 if the given PCM format is little-endian, 0 if |
268 | * big-endian, or a negative error code if endian not specified. | 276 | * big-endian, or a negative error code if endian not specified. |
269 | */ | 277 | */ |
270 | int snd_pcm_format_little_endian(snd_pcm_format_t format) | 278 | int snd_pcm_format_little_endian(snd_pcm_format_t format) |
@@ -283,7 +291,7 @@ EXPORT_SYMBOL(snd_pcm_format_little_endian); | |||
283 | * snd_pcm_format_big_endian - Check the PCM format is big-endian | 291 | * snd_pcm_format_big_endian - Check the PCM format is big-endian |
284 | * @format: the format to check | 292 | * @format: the format to check |
285 | * | 293 | * |
286 | * Returns 1 if the given PCM format is big-endian, 0 if | 294 | * Return: 1 if the given PCM format is big-endian, 0 if |
287 | * little-endian, or a negative error code if endian not specified. | 295 | * little-endian, or a negative error code if endian not specified. |
288 | */ | 296 | */ |
289 | int snd_pcm_format_big_endian(snd_pcm_format_t format) | 297 | int snd_pcm_format_big_endian(snd_pcm_format_t format) |
@@ -302,7 +310,7 @@ EXPORT_SYMBOL(snd_pcm_format_big_endian); | |||
302 | * snd_pcm_format_width - return the bit-width of the format | 310 | * snd_pcm_format_width - return the bit-width of the format |
303 | * @format: the format to check | 311 | * @format: the format to check |
304 | * | 312 | * |
305 | * Returns the bit-width of the format, or a negative error code | 313 | * Return: The bit-width of the format, or a negative error code |
306 | * if unknown format. | 314 | * if unknown format. |
307 | */ | 315 | */ |
308 | int snd_pcm_format_width(snd_pcm_format_t format) | 316 | int snd_pcm_format_width(snd_pcm_format_t format) |
@@ -321,7 +329,7 @@ EXPORT_SYMBOL(snd_pcm_format_width); | |||
321 | * snd_pcm_format_physical_width - return the physical bit-width of the format | 329 | * snd_pcm_format_physical_width - return the physical bit-width of the format |
322 | * @format: the format to check | 330 | * @format: the format to check |
323 | * | 331 | * |
324 | * Returns the physical bit-width of the format, or a negative error code | 332 | * Return: The physical bit-width of the format, or a negative error code |
325 | * if unknown format. | 333 | * if unknown format. |
326 | */ | 334 | */ |
327 | int snd_pcm_format_physical_width(snd_pcm_format_t format) | 335 | int snd_pcm_format_physical_width(snd_pcm_format_t format) |
@@ -341,7 +349,7 @@ EXPORT_SYMBOL(snd_pcm_format_physical_width); | |||
341 | * @format: the format to check | 349 | * @format: the format to check |
342 | * @samples: sampling rate | 350 | * @samples: sampling rate |
343 | * | 351 | * |
344 | * Returns the byte size of the given samples for the format, or a | 352 | * Return: The byte size of the given samples for the format, or a |
345 | * negative error code if unknown format. | 353 | * negative error code if unknown format. |
346 | */ | 354 | */ |
347 | ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples) | 355 | ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples) |
@@ -358,7 +366,7 @@ EXPORT_SYMBOL(snd_pcm_format_size); | |||
358 | * snd_pcm_format_silence_64 - return the silent data in 8 bytes array | 366 | * snd_pcm_format_silence_64 - return the silent data in 8 bytes array |
359 | * @format: the format to check | 367 | * @format: the format to check |
360 | * | 368 | * |
361 | * Returns the format pattern to fill or NULL if error. | 369 | * Return: The format pattern to fill or %NULL if error. |
362 | */ | 370 | */ |
363 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format) | 371 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format) |
364 | { | 372 | { |
@@ -379,7 +387,7 @@ EXPORT_SYMBOL(snd_pcm_format_silence_64); | |||
379 | * | 387 | * |
380 | * Sets the silence data on the buffer for the given samples. | 388 | * Sets the silence data on the buffer for the given samples. |
381 | * | 389 | * |
382 | * Returns zero if successful, or a negative error code on failure. | 390 | * Return: Zero if successful, or a negative error code on failure. |
383 | */ | 391 | */ |
384 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int samples) | 392 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int samples) |
385 | { | 393 | { |
@@ -449,7 +457,7 @@ EXPORT_SYMBOL(snd_pcm_format_set_silence); | |||
449 | * Determines the rate_min and rate_max fields from the rates bits of | 457 | * Determines the rate_min and rate_max fields from the rates bits of |
450 | * the given runtime->hw. | 458 | * the given runtime->hw. |
451 | * | 459 | * |
452 | * Returns zero if successful. | 460 | * Return: Zero if successful. |
453 | */ | 461 | */ |
454 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime) | 462 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime) |
455 | { | 463 | { |
@@ -475,7 +483,7 @@ EXPORT_SYMBOL(snd_pcm_limit_hw_rates); | |||
475 | * snd_pcm_rate_to_rate_bit - converts sample rate to SNDRV_PCM_RATE_xxx bit | 483 | * snd_pcm_rate_to_rate_bit - converts sample rate to SNDRV_PCM_RATE_xxx bit |
476 | * @rate: the sample rate to convert | 484 | * @rate: the sample rate to convert |
477 | * | 485 | * |
478 | * Returns the SNDRV_PCM_RATE_xxx flag that corresponds to the given rate, or | 486 | * Return: The SNDRV_PCM_RATE_xxx flag that corresponds to the given rate, or |
479 | * SNDRV_PCM_RATE_KNOT for an unknown rate. | 487 | * SNDRV_PCM_RATE_KNOT for an unknown rate. |
480 | */ | 488 | */ |
481 | unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate) | 489 | unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate) |
@@ -493,8 +501,8 @@ EXPORT_SYMBOL(snd_pcm_rate_to_rate_bit); | |||
493 | * snd_pcm_rate_bit_to_rate - converts SNDRV_PCM_RATE_xxx bit to sample rate | 501 | * snd_pcm_rate_bit_to_rate - converts SNDRV_PCM_RATE_xxx bit to sample rate |
494 | * @rate_bit: the rate bit to convert | 502 | * @rate_bit: the rate bit to convert |
495 | * | 503 | * |
496 | * Returns the sample rate that corresponds to the given SNDRV_PCM_RATE_xxx flag | 504 | * Return: The sample rate that corresponds to the given SNDRV_PCM_RATE_xxx flag |
497 | * or 0 for an unknown rate bit | 505 | * or 0 for an unknown rate bit. |
498 | */ | 506 | */ |
499 | unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit) | 507 | unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit) |
500 | { | 508 | { |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index eb560fa32321..23e3c46cd0a4 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -898,6 +898,8 @@ static struct action_ops snd_pcm_action_start = { | |||
898 | /** | 898 | /** |
899 | * snd_pcm_start - start all linked streams | 899 | * snd_pcm_start - start all linked streams |
900 | * @substream: the PCM substream instance | 900 | * @substream: the PCM substream instance |
901 | * | ||
902 | * Return: Zero if successful, or a negative error code. | ||
901 | */ | 903 | */ |
902 | int snd_pcm_start(struct snd_pcm_substream *substream) | 904 | int snd_pcm_start(struct snd_pcm_substream *substream) |
903 | { | 905 | { |
@@ -951,6 +953,8 @@ static struct action_ops snd_pcm_action_stop = { | |||
951 | * @state: PCM state after stopping the stream | 953 | * @state: PCM state after stopping the stream |
952 | * | 954 | * |
953 | * The state of each stream is then changed to the given state unconditionally. | 955 | * The state of each stream is then changed to the given state unconditionally. |
956 | * | ||
957 | * Return: Zero if succesful, or a negative error code. | ||
954 | */ | 958 | */ |
955 | int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t state) | 959 | int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t state) |
956 | { | 960 | { |
@@ -965,6 +969,8 @@ EXPORT_SYMBOL(snd_pcm_stop); | |||
965 | * | 969 | * |
966 | * After stopping, the state is changed to SETUP. | 970 | * After stopping, the state is changed to SETUP. |
967 | * Unlike snd_pcm_stop(), this affects only the given stream. | 971 | * Unlike snd_pcm_stop(), this affects only the given stream. |
972 | * | ||
973 | * Return: Zero if succesful, or a negative error code. | ||
968 | */ | 974 | */ |
969 | int snd_pcm_drain_done(struct snd_pcm_substream *substream) | 975 | int snd_pcm_drain_done(struct snd_pcm_substream *substream) |
970 | { | 976 | { |
@@ -1098,6 +1104,9 @@ static struct action_ops snd_pcm_action_suspend = { | |||
1098 | * @substream: the PCM substream | 1104 | * @substream: the PCM substream |
1099 | * | 1105 | * |
1100 | * After this call, all streams are changed to SUSPENDED state. | 1106 | * After this call, all streams are changed to SUSPENDED state. |
1107 | * | ||
1108 | * Return: Zero if successful (or @substream is %NULL), or a negative error | ||
1109 | * code. | ||
1101 | */ | 1110 | */ |
1102 | int snd_pcm_suspend(struct snd_pcm_substream *substream) | 1111 | int snd_pcm_suspend(struct snd_pcm_substream *substream) |
1103 | { | 1112 | { |
@@ -1120,6 +1129,8 @@ EXPORT_SYMBOL(snd_pcm_suspend); | |||
1120 | * @pcm: the PCM instance | 1129 | * @pcm: the PCM instance |
1121 | * | 1130 | * |
1122 | * After this call, all streams are changed to SUSPENDED state. | 1131 | * After this call, all streams are changed to SUSPENDED state. |
1132 | * | ||
1133 | * Return: Zero if successful (or @pcm is %NULL), or a negative error code. | ||
1123 | */ | 1134 | */ |
1124 | int snd_pcm_suspend_all(struct snd_pcm *pcm) | 1135 | int snd_pcm_suspend_all(struct snd_pcm *pcm) |
1125 | { | 1136 | { |
@@ -1343,6 +1354,8 @@ static struct action_ops snd_pcm_action_prepare = { | |||
1343 | * snd_pcm_prepare - prepare the PCM substream to be triggerable | 1354 | * snd_pcm_prepare - prepare the PCM substream to be triggerable |
1344 | * @substream: the PCM substream instance | 1355 | * @substream: the PCM substream instance |
1345 | * @file: file to refer f_flags | 1356 | * @file: file to refer f_flags |
1357 | * | ||
1358 | * Return: Zero if successful, or a negative error code. | ||
1346 | */ | 1359 | */ |
1347 | static int snd_pcm_prepare(struct snd_pcm_substream *substream, | 1360 | static int snd_pcm_prepare(struct snd_pcm_substream *substream, |
1348 | struct file *file) | 1361 | struct file *file) |
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 1bb95aeea084..7b596b5751db 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -863,7 +863,7 @@ static int snd_rawmidi_control_ioctl(struct snd_card *card, | |||
863 | * | 863 | * |
864 | * Reads the data from the internal buffer. | 864 | * Reads the data from the internal buffer. |
865 | * | 865 | * |
866 | * Returns the size of read data, or a negative error code on failure. | 866 | * Return: The size of read data, or a negative error code on failure. |
867 | */ | 867 | */ |
868 | int snd_rawmidi_receive(struct snd_rawmidi_substream *substream, | 868 | int snd_rawmidi_receive(struct snd_rawmidi_substream *substream, |
869 | const unsigned char *buffer, int count) | 869 | const unsigned char *buffer, int count) |
@@ -1024,8 +1024,8 @@ static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t coun | |||
1024 | /** | 1024 | /** |
1025 | * snd_rawmidi_transmit_empty - check whether the output buffer is empty | 1025 | * snd_rawmidi_transmit_empty - check whether the output buffer is empty |
1026 | * @substream: the rawmidi substream | 1026 | * @substream: the rawmidi substream |
1027 | * | 1027 | * |
1028 | * Returns 1 if the internal output buffer is empty, 0 if not. | 1028 | * Return: 1 if the internal output buffer is empty, 0 if not. |
1029 | */ | 1029 | */ |
1030 | int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream) | 1030 | int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream) |
1031 | { | 1031 | { |
@@ -1055,7 +1055,7 @@ int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream) | |||
1055 | * and call snd_rawmidi_transmit_ack() after the transmission is | 1055 | * and call snd_rawmidi_transmit_ack() after the transmission is |
1056 | * finished. | 1056 | * finished. |
1057 | * | 1057 | * |
1058 | * Returns the size of copied data, or a negative error code on failure. | 1058 | * Return: The size of copied data, or a negative error code on failure. |
1059 | */ | 1059 | */ |
1060 | int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream, | 1060 | int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream, |
1061 | unsigned char *buffer, int count) | 1061 | unsigned char *buffer, int count) |
@@ -1107,7 +1107,7 @@ int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream, | |||
1107 | * the given size and updates the condition. | 1107 | * the given size and updates the condition. |
1108 | * Call after the transmission is finished. | 1108 | * Call after the transmission is finished. |
1109 | * | 1109 | * |
1110 | * Returns the advanced size if successful, or a negative error code on failure. | 1110 | * Return: The advanced size if successful, or a negative error code on failure. |
1111 | */ | 1111 | */ |
1112 | int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) | 1112 | int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) |
1113 | { | 1113 | { |
@@ -1140,7 +1140,7 @@ int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) | |||
1140 | * | 1140 | * |
1141 | * Copies data from the buffer to the device and advances the pointer. | 1141 | * Copies data from the buffer to the device and advances the pointer. |
1142 | * | 1142 | * |
1143 | * Returns the copied size if successful, or a negative error code on failure. | 1143 | * Return: The copied size if successful, or a negative error code on failure. |
1144 | */ | 1144 | */ |
1145 | int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, | 1145 | int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, |
1146 | unsigned char *buffer, int count) | 1146 | unsigned char *buffer, int count) |
@@ -1438,7 +1438,7 @@ static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi, | |||
1438 | * Creates a new rawmidi instance. | 1438 | * Creates a new rawmidi instance. |
1439 | * Use snd_rawmidi_set_ops() to set the operators to the new instance. | 1439 | * Use snd_rawmidi_set_ops() to set the operators to the new instance. |
1440 | * | 1440 | * |
1441 | * Returns zero if successful, or a negative error code on failure. | 1441 | * Return: Zero if successful, or a negative error code on failure. |
1442 | */ | 1442 | */ |
1443 | int snd_rawmidi_new(struct snd_card *card, char *id, int device, | 1443 | int snd_rawmidi_new(struct snd_card *card, char *id, int device, |
1444 | int output_count, int input_count, | 1444 | int output_count, int input_count, |
diff --git a/sound/core/sound.c b/sound/core/sound.c index 70ccdab74153..f002bd911dae 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -102,6 +102,9 @@ static void snd_request_other(int minor) | |||
102 | * This function increments the reference counter of the card instance | 102 | * This function increments the reference counter of the card instance |
103 | * if an associated instance with the given minor number and type is found. | 103 | * if an associated instance with the given minor number and type is found. |
104 | * The caller must call snd_card_unref() appropriately later. | 104 | * The caller must call snd_card_unref() appropriately later. |
105 | * | ||
106 | * Return: The user data pointer if the specified device is found. %NULL | ||
107 | * otherwise. | ||
105 | */ | 108 | */ |
106 | void *snd_lookup_minor_data(unsigned int minor, int type) | 109 | void *snd_lookup_minor_data(unsigned int minor, int type) |
107 | { | 110 | { |
@@ -261,7 +264,7 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev) | |||
261 | * Registers an ALSA device file for the given card. | 264 | * Registers an ALSA device file for the given card. |
262 | * The operators have to be set in reg parameter. | 265 | * The operators have to be set in reg parameter. |
263 | * | 266 | * |
264 | * Returns zero if successful, or a negative error code on failure. | 267 | * Return: Zero if successful, or a negative error code on failure. |
265 | */ | 268 | */ |
266 | int snd_register_device_for_dev(int type, struct snd_card *card, int dev, | 269 | int snd_register_device_for_dev(int type, struct snd_card *card, int dev, |
267 | const struct file_operations *f_ops, | 270 | const struct file_operations *f_ops, |
@@ -339,7 +342,7 @@ static int find_snd_minor(int type, struct snd_card *card, int dev) | |||
339 | * Unregisters the device file already registered via | 342 | * Unregisters the device file already registered via |
340 | * snd_register_device(). | 343 | * snd_register_device(). |
341 | * | 344 | * |
342 | * Returns zero if sucecessful, or a negative error code on failure | 345 | * Return: Zero if successful, or a negative error code on failure. |
343 | */ | 346 | */ |
344 | int snd_unregister_device(int type, struct snd_card *card, int dev) | 347 | int snd_unregister_device(int type, struct snd_card *card, int dev) |
345 | { | 348 | { |
diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c index 0097f3619faa..02f90b4f8b86 100644 --- a/sound/core/vmaster.c +++ b/sound/core/vmaster.c | |||
@@ -365,8 +365,7 @@ static void master_free(struct snd_kcontrol *kcontrol) | |||
365 | * @name: name string of the control element to create | 365 | * @name: name string of the control element to create |
366 | * @tlv: optional TLV int array for dB information | 366 | * @tlv: optional TLV int array for dB information |
367 | * | 367 | * |
368 | * Creates a virtual matster control with the given name string. | 368 | * Creates a virtual master control with the given name string. |
369 | * Returns the created control element, or NULL for errors (ENOMEM). | ||
370 | * | 369 | * |
371 | * After creating a vmaster element, you can add the slave controls | 370 | * After creating a vmaster element, you can add the slave controls |
372 | * via snd_ctl_add_slave() or snd_ctl_add_slave_uncached(). | 371 | * via snd_ctl_add_slave() or snd_ctl_add_slave_uncached(). |
@@ -375,6 +374,8 @@ static void master_free(struct snd_kcontrol *kcontrol) | |||
375 | * for dB scale of the master control. It should be a single element | 374 | * for dB scale of the master control. It should be a single element |
376 | * with #SNDRV_CTL_TLVT_DB_SCALE, #SNDRV_CTL_TLV_DB_MINMAX or | 375 | * with #SNDRV_CTL_TLVT_DB_SCALE, #SNDRV_CTL_TLV_DB_MINMAX or |
377 | * #SNDRV_CTL_TLVT_DB_MINMAX_MUTE type, and should be the max 0dB. | 376 | * #SNDRV_CTL_TLVT_DB_MINMAX_MUTE type, and should be the max 0dB. |
377 | * | ||
378 | * Return: The created control element, or %NULL for errors (ENOMEM). | ||
378 | */ | 379 | */ |
379 | struct snd_kcontrol *snd_ctl_make_virtual_master(char *name, | 380 | struct snd_kcontrol *snd_ctl_make_virtual_master(char *name, |
380 | const unsigned int *tlv) | 381 | const unsigned int *tlv) |
@@ -426,6 +427,8 @@ EXPORT_SYMBOL(snd_ctl_make_virtual_master); | |||
426 | * | 427 | * |
427 | * Adds the given hook to the vmaster control element so that it's called | 428 | * Adds the given hook to the vmaster control element so that it's called |
428 | * at each time when the value is changed. | 429 | * at each time when the value is changed. |
430 | * | ||
431 | * Return: Zero. | ||
429 | */ | 432 | */ |
430 | int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kcontrol, | 433 | int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kcontrol, |
431 | void (*hook)(void *private_data, int), | 434 | void (*hook)(void *private_data, int), |