| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: uaudio.c,v 1.140.2.13 2016/03/13 07:11:01 skrll Exp $ */ | | 1 | /* $NetBSD: uaudio.c,v 1.140.2.14 2016/03/23 22:04:18 skrll Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1999, 2012 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1999, 2012 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Lennart Augustsson (lennart@augustsson.net) at | | 8 | * by Lennart Augustsson (lennart@augustsson.net) at |
9 | * Carlstedt Research & Technology, and Matthew R. Green (mrg@eterna.com.au). | | 9 | * Carlstedt Research & Technology, and Matthew R. Green (mrg@eterna.com.au). |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -27,27 +27,27 @@ | | | @@ -27,27 +27,27 @@ |
27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
30 | * POSSIBILITY OF SUCH DAMAGE. | | 30 | * POSSIBILITY OF SUCH DAMAGE. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | /* | | 33 | /* |
34 | * USB audio specs: http://www.usb.org/developers/docs/devclass_docs/audio10.pdf | | 34 | * USB audio specs: http://www.usb.org/developers/docs/devclass_docs/audio10.pdf |
35 | * http://www.usb.org/developers/docs/devclass_docs/frmts10.pdf | | 35 | * http://www.usb.org/developers/docs/devclass_docs/frmts10.pdf |
36 | * http://www.usb.org/developers/docs/devclass_docs/termt10.pdf | | 36 | * http://www.usb.org/developers/docs/devclass_docs/termt10.pdf |
37 | */ | | 37 | */ |
38 | | | 38 | |
39 | #include <sys/cdefs.h> | | 39 | #include <sys/cdefs.h> |
40 | __KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.140.2.13 2016/03/13 07:11:01 skrll Exp $"); | | 40 | __KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.140.2.14 2016/03/23 22:04:18 skrll Exp $"); |
41 | | | 41 | |
42 | #ifdef _KERNEL_OPT | | 42 | #ifdef _KERNEL_OPT |
43 | #include "opt_usb.h" | | 43 | #include "opt_usb.h" |
44 | #endif | | 44 | #endif |
45 | | | 45 | |
46 | #include <sys/param.h> | | 46 | #include <sys/param.h> |
47 | #include <sys/systm.h> | | 47 | #include <sys/systm.h> |
48 | #include <sys/kernel.h> | | 48 | #include <sys/kernel.h> |
49 | #include <sys/malloc.h> | | 49 | #include <sys/malloc.h> |
50 | #include <sys/device.h> | | 50 | #include <sys/device.h> |
51 | #include <sys/ioctl.h> | | 51 | #include <sys/ioctl.h> |
52 | #include <sys/file.h> | | 52 | #include <sys/file.h> |
53 | #include <sys/reboot.h> /* for bootverbose */ | | 53 | #include <sys/reboot.h> /* for bootverbose */ |
| @@ -2614,27 +2614,27 @@ uaudio_trigger_input(void *addr, void *s | | | @@ -2614,27 +2614,27 @@ uaudio_trigger_input(void *addr, void *s |
2614 | | | 2614 | |
2615 | err = uaudio_chan_alloc_buffers(sc, ch); | | 2615 | err = uaudio_chan_alloc_buffers(sc, ch); |
2616 | if (err) { | | 2616 | if (err) { |
2617 | uaudio_chan_close(sc, ch); | | 2617 | uaudio_chan_close(sc, ch); |
2618 | mutex_spin_enter(&sc->sc_intr_lock); | | 2618 | mutex_spin_enter(&sc->sc_intr_lock); |
2619 | return EIO; | | 2619 | return EIO; |
2620 | } | | 2620 | } |
2621 | | | 2621 | |
2622 | | | 2622 | |
2623 | ch->intr = intr; | | 2623 | ch->intr = intr; |
2624 | ch->arg = arg; | | 2624 | ch->arg = arg; |
2625 | | | 2625 | |
2626 | /* XXX -1 shouldn't be needed */ | | 2626 | /* XXX -1 shouldn't be needed */ |
2627 | for (i = 0; i < UAUDIO_NCHANBUFS-1; i++) { | | 2627 | for (i = 0; i < UAUDIO_NCHANBUFS - 1; i++) { |
2628 | uaudio_chan_rtransfer(ch); | | 2628 | uaudio_chan_rtransfer(ch); |
2629 | } | | 2629 | } |
2630 | | | 2630 | |
2631 | mutex_spin_enter(&sc->sc_intr_lock); | | 2631 | mutex_spin_enter(&sc->sc_intr_lock); |
2632 | | | 2632 | |
2633 | return 0; | | 2633 | return 0; |
2634 | } | | 2634 | } |
2635 | | | 2635 | |
2636 | Static int | | 2636 | Static int |
2637 | uaudio_trigger_output(void *addr, void *start, void *end, int blksize, | | 2637 | uaudio_trigger_output(void *addr, void *start, void *end, int blksize, |
2638 | void (*intr)(void *), void *arg, | | 2638 | void (*intr)(void *), void *arg, |
2639 | const audio_params_t *param) | | 2639 | const audio_params_t *param) |
2640 | { | | 2640 | { |