diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-08-23 08:12:22 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-08-23 08:12:22 -0400 |
commit | 68538bf2bce557c3b5fe8c59b034d45352500db1 (patch) | |
tree | a84b68990cadcbfc277acc7b7f2b75716750e203 /sound/usb | |
parent | a8cc20999799a94929a56393ff39b32245e33d64 (diff) | |
parent | 43bcb402f84fe459102120b4e2d28d7117f16cd0 (diff) |
Merge tag 'asoc-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v3.12
- DAPM is now mandatory for CODEC drivers in order to avoid the repeated
regressions in the special cases for non-DAPM CODECs and make it
easier to integrate with other components on boards. All existing
drivers have had some level of DAPM support added.
- A lot of cleanups in DAPM plus support for maintaining controls in a
specific state while a DAPM widget all contributed by Lars-Peter Clausen.
- Core helpers for bitbanged AC'97 reset from Markus Pargmann.
- New drivers and support for Analog Devices ADAU1702 and ADAU1401(a),
Asahi Kasei Microdevices AK4554, Atmel AT91ASM9x5 and WM8904 based
machines, Freescale S/PDIF and SSI AC'97, Renesas R-Car SoCs, Samsung
Exynos5420 SoCs, Texas Instruments PCM1681 and PCM1792A and Wolfson
Microelectronics WM8997.
- Support for building drivers that can support it cross-platform for
compile test.
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/6fire/comm.c | 38 | ||||
-rw-r--r-- | sound/usb/6fire/comm.h | 2 | ||||
-rw-r--r-- | sound/usb/6fire/midi.c | 16 | ||||
-rw-r--r-- | sound/usb/6fire/midi.h | 6 | ||||
-rw-r--r-- | sound/usb/6fire/pcm.c | 55 | ||||
-rw-r--r-- | sound/usb/6fire/pcm.h | 2 | ||||
-rw-r--r-- | sound/usb/endpoint.c | 13 | ||||
-rw-r--r-- | sound/usb/hiface/pcm.c | 2 | ||||
-rw-r--r-- | sound/usb/misc/ua101.c | 14 | ||||
-rw-r--r-- | sound/usb/mixer.c | 1 | ||||
-rw-r--r-- | sound/usb/quirks.c | 6 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2yaudio.c | 4 |
12 files changed, 129 insertions, 30 deletions
diff --git a/sound/usb/6fire/comm.c b/sound/usb/6fire/comm.c index 9e6e3ffd86bb..23452ee617e1 100644 --- a/sound/usb/6fire/comm.c +++ b/sound/usb/6fire/comm.c | |||
@@ -110,19 +110,37 @@ static int usb6fire_comm_send_buffer(u8 *buffer, struct usb_device *dev) | |||
110 | static int usb6fire_comm_write8(struct comm_runtime *rt, u8 request, | 110 | static int usb6fire_comm_write8(struct comm_runtime *rt, u8 request, |
111 | u8 reg, u8 value) | 111 | u8 reg, u8 value) |
112 | { | 112 | { |
113 | u8 buffer[13]; /* 13: maximum length of message */ | 113 | u8 *buffer; |
114 | int ret; | ||
115 | |||
116 | /* 13: maximum length of message */ | ||
117 | buffer = kmalloc(13, GFP_KERNEL); | ||
118 | if (!buffer) | ||
119 | return -ENOMEM; | ||
114 | 120 | ||
115 | usb6fire_comm_init_buffer(buffer, 0x00, request, reg, value, 0x00); | 121 | usb6fire_comm_init_buffer(buffer, 0x00, request, reg, value, 0x00); |
116 | return usb6fire_comm_send_buffer(buffer, rt->chip->dev); | 122 | ret = usb6fire_comm_send_buffer(buffer, rt->chip->dev); |
123 | |||
124 | kfree(buffer); | ||
125 | return ret; | ||
117 | } | 126 | } |
118 | 127 | ||
119 | static int usb6fire_comm_write16(struct comm_runtime *rt, u8 request, | 128 | static int usb6fire_comm_write16(struct comm_runtime *rt, u8 request, |
120 | u8 reg, u8 vl, u8 vh) | 129 | u8 reg, u8 vl, u8 vh) |
121 | { | 130 | { |
122 | u8 buffer[13]; /* 13: maximum length of message */ | 131 | u8 *buffer; |
132 | int ret; | ||
133 | |||
134 | /* 13: maximum length of message */ | ||
135 | buffer = kmalloc(13, GFP_KERNEL); | ||
136 | if (!buffer) | ||
137 | return -ENOMEM; | ||
123 | 138 | ||
124 | usb6fire_comm_init_buffer(buffer, 0x00, request, reg, vl, vh); | 139 | usb6fire_comm_init_buffer(buffer, 0x00, request, reg, vl, vh); |
125 | return usb6fire_comm_send_buffer(buffer, rt->chip->dev); | 140 | ret = usb6fire_comm_send_buffer(buffer, rt->chip->dev); |
141 | |||
142 | kfree(buffer); | ||
143 | return ret; | ||
126 | } | 144 | } |
127 | 145 | ||
128 | int usb6fire_comm_init(struct sfire_chip *chip) | 146 | int usb6fire_comm_init(struct sfire_chip *chip) |
@@ -135,6 +153,12 @@ int usb6fire_comm_init(struct sfire_chip *chip) | |||
135 | if (!rt) | 153 | if (!rt) |
136 | return -ENOMEM; | 154 | return -ENOMEM; |
137 | 155 | ||
156 | rt->receiver_buffer = kzalloc(COMM_RECEIVER_BUFSIZE, GFP_KERNEL); | ||
157 | if (!rt->receiver_buffer) { | ||
158 | kfree(rt); | ||
159 | return -ENOMEM; | ||
160 | } | ||
161 | |||
138 | urb = &rt->receiver; | 162 | urb = &rt->receiver; |
139 | rt->serial = 1; | 163 | rt->serial = 1; |
140 | rt->chip = chip; | 164 | rt->chip = chip; |
@@ -153,6 +177,7 @@ int usb6fire_comm_init(struct sfire_chip *chip) | |||
153 | urb->interval = 1; | 177 | urb->interval = 1; |
154 | ret = usb_submit_urb(urb, GFP_KERNEL); | 178 | ret = usb_submit_urb(urb, GFP_KERNEL); |
155 | if (ret < 0) { | 179 | if (ret < 0) { |
180 | kfree(rt->receiver_buffer); | ||
156 | kfree(rt); | 181 | kfree(rt); |
157 | snd_printk(KERN_ERR PREFIX "cannot create comm data receiver."); | 182 | snd_printk(KERN_ERR PREFIX "cannot create comm data receiver."); |
158 | return ret; | 183 | return ret; |
@@ -171,6 +196,9 @@ void usb6fire_comm_abort(struct sfire_chip *chip) | |||
171 | 196 | ||
172 | void usb6fire_comm_destroy(struct sfire_chip *chip) | 197 | void usb6fire_comm_destroy(struct sfire_chip *chip) |
173 | { | 198 | { |
174 | kfree(chip->comm); | 199 | struct comm_runtime *rt = chip->comm; |
200 | |||
201 | kfree(rt->receiver_buffer); | ||
202 | kfree(rt); | ||
175 | chip->comm = NULL; | 203 | chip->comm = NULL; |
176 | } | 204 | } |
diff --git a/sound/usb/6fire/comm.h b/sound/usb/6fire/comm.h index 6a0840b0dcff..780d5ed8e5d8 100644 --- a/sound/usb/6fire/comm.h +++ b/sound/usb/6fire/comm.h | |||
@@ -24,7 +24,7 @@ struct comm_runtime { | |||
24 | struct sfire_chip *chip; | 24 | struct sfire_chip *chip; |
25 | 25 | ||
26 | struct urb receiver; | 26 | struct urb receiver; |
27 | u8 receiver_buffer[COMM_RECEIVER_BUFSIZE]; | 27 | u8 *receiver_buffer; |
28 | 28 | ||
29 | u8 serial; /* urb serial */ | 29 | u8 serial; /* urb serial */ |
30 | 30 | ||
diff --git a/sound/usb/6fire/midi.c b/sound/usb/6fire/midi.c index 26722423330d..f3dd7266c391 100644 --- a/sound/usb/6fire/midi.c +++ b/sound/usb/6fire/midi.c | |||
@@ -19,6 +19,10 @@ | |||
19 | #include "chip.h" | 19 | #include "chip.h" |
20 | #include "comm.h" | 20 | #include "comm.h" |
21 | 21 | ||
22 | enum { | ||
23 | MIDI_BUFSIZE = 64 | ||
24 | }; | ||
25 | |||
22 | static void usb6fire_midi_out_handler(struct urb *urb) | 26 | static void usb6fire_midi_out_handler(struct urb *urb) |
23 | { | 27 | { |
24 | struct midi_runtime *rt = urb->context; | 28 | struct midi_runtime *rt = urb->context; |
@@ -156,6 +160,12 @@ int usb6fire_midi_init(struct sfire_chip *chip) | |||
156 | if (!rt) | 160 | if (!rt) |
157 | return -ENOMEM; | 161 | return -ENOMEM; |
158 | 162 | ||
163 | rt->out_buffer = kzalloc(MIDI_BUFSIZE, GFP_KERNEL); | ||
164 | if (!rt->out_buffer) { | ||
165 | kfree(rt); | ||
166 | return -ENOMEM; | ||
167 | } | ||
168 | |||
159 | rt->chip = chip; | 169 | rt->chip = chip; |
160 | rt->in_received = usb6fire_midi_in_received; | 170 | rt->in_received = usb6fire_midi_in_received; |
161 | rt->out_buffer[0] = 0x80; /* 'send midi' command */ | 171 | rt->out_buffer[0] = 0x80; /* 'send midi' command */ |
@@ -169,6 +179,7 @@ int usb6fire_midi_init(struct sfire_chip *chip) | |||
169 | 179 | ||
170 | ret = snd_rawmidi_new(chip->card, "6FireUSB", 0, 1, 1, &rt->instance); | 180 | ret = snd_rawmidi_new(chip->card, "6FireUSB", 0, 1, 1, &rt->instance); |
171 | if (ret < 0) { | 181 | if (ret < 0) { |
182 | kfree(rt->out_buffer); | ||
172 | kfree(rt); | 183 | kfree(rt); |
173 | snd_printk(KERN_ERR PREFIX "unable to create midi.\n"); | 184 | snd_printk(KERN_ERR PREFIX "unable to create midi.\n"); |
174 | return ret; | 185 | return ret; |
@@ -197,6 +208,9 @@ void usb6fire_midi_abort(struct sfire_chip *chip) | |||
197 | 208 | ||
198 | void usb6fire_midi_destroy(struct sfire_chip *chip) | 209 | void usb6fire_midi_destroy(struct sfire_chip *chip) |
199 | { | 210 | { |
200 | kfree(chip->midi); | 211 | struct midi_runtime *rt = chip->midi; |
212 | |||
213 | kfree(rt->out_buffer); | ||
214 | kfree(rt); | ||
201 | chip->midi = NULL; | 215 | chip->midi = NULL; |
202 | } | 216 | } |
diff --git a/sound/usb/6fire/midi.h b/sound/usb/6fire/midi.h index c321006e5430..84851b9f5559 100644 --- a/sound/usb/6fire/midi.h +++ b/sound/usb/6fire/midi.h | |||
@@ -16,10 +16,6 @@ | |||
16 | 16 | ||
17 | #include "common.h" | 17 | #include "common.h" |
18 | 18 | ||
19 | enum { | ||
20 | MIDI_BUFSIZE = 64 | ||
21 | }; | ||
22 | |||
23 | struct midi_runtime { | 19 | struct midi_runtime { |
24 | struct sfire_chip *chip; | 20 | struct sfire_chip *chip; |
25 | struct snd_rawmidi *instance; | 21 | struct snd_rawmidi *instance; |
@@ -32,7 +28,7 @@ struct midi_runtime { | |||
32 | struct snd_rawmidi_substream *out; | 28 | struct snd_rawmidi_substream *out; |
33 | struct urb out_urb; | 29 | struct urb out_urb; |
34 | u8 out_serial; /* serial number of out packet */ | 30 | u8 out_serial; /* serial number of out packet */ |
35 | u8 out_buffer[MIDI_BUFSIZE]; | 31 | u8 *out_buffer; |
36 | int buffer_offset; | 32 | int buffer_offset; |
37 | 33 | ||
38 | void (*in_received)(struct midi_runtime *rt, u8 *data, int length); | 34 | void (*in_received)(struct midi_runtime *rt, u8 *data, int length); |
diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c index c5b9cac37dc4..b5eb97fdc842 100644 --- a/sound/usb/6fire/pcm.c +++ b/sound/usb/6fire/pcm.c | |||
@@ -543,7 +543,7 @@ static snd_pcm_uframes_t usb6fire_pcm_pointer( | |||
543 | snd_pcm_uframes_t ret; | 543 | snd_pcm_uframes_t ret; |
544 | 544 | ||
545 | if (rt->panic || !sub) | 545 | if (rt->panic || !sub) |
546 | return SNDRV_PCM_STATE_XRUN; | 546 | return SNDRV_PCM_POS_XRUN; |
547 | 547 | ||
548 | spin_lock_irqsave(&sub->lock, flags); | 548 | spin_lock_irqsave(&sub->lock, flags); |
549 | ret = sub->dma_off; | 549 | ret = sub->dma_off; |
@@ -582,6 +582,33 @@ static void usb6fire_pcm_init_urb(struct pcm_urb *urb, | |||
582 | urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB; | 582 | urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB; |
583 | } | 583 | } |
584 | 584 | ||
585 | static int usb6fire_pcm_buffers_init(struct pcm_runtime *rt) | ||
586 | { | ||
587 | int i; | ||
588 | |||
589 | for (i = 0; i < PCM_N_URBS; i++) { | ||
590 | rt->out_urbs[i].buffer = kzalloc(PCM_N_PACKETS_PER_URB | ||
591 | * PCM_MAX_PACKET_SIZE, GFP_KERNEL); | ||
592 | if (!rt->out_urbs[i].buffer) | ||
593 | return -ENOMEM; | ||
594 | rt->in_urbs[i].buffer = kzalloc(PCM_N_PACKETS_PER_URB | ||
595 | * PCM_MAX_PACKET_SIZE, GFP_KERNEL); | ||
596 | if (!rt->in_urbs[i].buffer) | ||
597 | return -ENOMEM; | ||
598 | } | ||
599 | return 0; | ||
600 | } | ||
601 | |||
602 | static void usb6fire_pcm_buffers_destroy(struct pcm_runtime *rt) | ||
603 | { | ||
604 | int i; | ||
605 | |||
606 | for (i = 0; i < PCM_N_URBS; i++) { | ||
607 | kfree(rt->out_urbs[i].buffer); | ||
608 | kfree(rt->in_urbs[i].buffer); | ||
609 | } | ||
610 | } | ||
611 | |||
585 | int usb6fire_pcm_init(struct sfire_chip *chip) | 612 | int usb6fire_pcm_init(struct sfire_chip *chip) |
586 | { | 613 | { |
587 | int i; | 614 | int i; |
@@ -593,6 +620,13 @@ int usb6fire_pcm_init(struct sfire_chip *chip) | |||
593 | if (!rt) | 620 | if (!rt) |
594 | return -ENOMEM; | 621 | return -ENOMEM; |
595 | 622 | ||
623 | ret = usb6fire_pcm_buffers_init(rt); | ||
624 | if (ret) { | ||
625 | usb6fire_pcm_buffers_destroy(rt); | ||
626 | kfree(rt); | ||
627 | return ret; | ||
628 | } | ||
629 | |||
596 | rt->chip = chip; | 630 | rt->chip = chip; |
597 | rt->stream_state = STREAM_DISABLED; | 631 | rt->stream_state = STREAM_DISABLED; |
598 | rt->rate = ARRAY_SIZE(rates); | 632 | rt->rate = ARRAY_SIZE(rates); |
@@ -614,6 +648,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip) | |||
614 | 648 | ||
615 | ret = snd_pcm_new(chip->card, "DMX6FireUSB", 0, 1, 1, &pcm); | 649 | ret = snd_pcm_new(chip->card, "DMX6FireUSB", 0, 1, 1, &pcm); |
616 | if (ret < 0) { | 650 | if (ret < 0) { |
651 | usb6fire_pcm_buffers_destroy(rt); | ||
617 | kfree(rt); | 652 | kfree(rt); |
618 | snd_printk(KERN_ERR PREFIX "cannot create pcm instance.\n"); | 653 | snd_printk(KERN_ERR PREFIX "cannot create pcm instance.\n"); |
619 | return ret; | 654 | return ret; |
@@ -625,6 +660,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip) | |||
625 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_ops); | 660 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_ops); |
626 | 661 | ||
627 | if (ret) { | 662 | if (ret) { |
663 | usb6fire_pcm_buffers_destroy(rt); | ||
628 | kfree(rt); | 664 | kfree(rt); |
629 | snd_printk(KERN_ERR PREFIX | 665 | snd_printk(KERN_ERR PREFIX |
630 | "error preallocating pcm buffers.\n"); | 666 | "error preallocating pcm buffers.\n"); |
@@ -639,17 +675,25 @@ int usb6fire_pcm_init(struct sfire_chip *chip) | |||
639 | void usb6fire_pcm_abort(struct sfire_chip *chip) | 675 | void usb6fire_pcm_abort(struct sfire_chip *chip) |
640 | { | 676 | { |
641 | struct pcm_runtime *rt = chip->pcm; | 677 | struct pcm_runtime *rt = chip->pcm; |
678 | unsigned long flags; | ||
642 | int i; | 679 | int i; |
643 | 680 | ||
644 | if (rt) { | 681 | if (rt) { |
645 | rt->panic = true; | 682 | rt->panic = true; |
646 | 683 | ||
647 | if (rt->playback.instance) | 684 | if (rt->playback.instance) { |
685 | snd_pcm_stream_lock_irqsave(rt->playback.instance, flags); | ||
648 | snd_pcm_stop(rt->playback.instance, | 686 | snd_pcm_stop(rt->playback.instance, |
649 | SNDRV_PCM_STATE_XRUN); | 687 | SNDRV_PCM_STATE_XRUN); |
650 | if (rt->capture.instance) | 688 | snd_pcm_stream_unlock_irqrestore(rt->playback.instance, flags); |
689 | } | ||
690 | |||
691 | if (rt->capture.instance) { | ||
692 | snd_pcm_stream_lock_irqsave(rt->capture.instance, flags); | ||
651 | snd_pcm_stop(rt->capture.instance, | 693 | snd_pcm_stop(rt->capture.instance, |
652 | SNDRV_PCM_STATE_XRUN); | 694 | SNDRV_PCM_STATE_XRUN); |
695 | snd_pcm_stream_unlock_irqrestore(rt->capture.instance, flags); | ||
696 | } | ||
653 | 697 | ||
654 | for (i = 0; i < PCM_N_URBS; i++) { | 698 | for (i = 0; i < PCM_N_URBS; i++) { |
655 | usb_poison_urb(&rt->in_urbs[i].instance); | 699 | usb_poison_urb(&rt->in_urbs[i].instance); |
@@ -661,6 +705,9 @@ void usb6fire_pcm_abort(struct sfire_chip *chip) | |||
661 | 705 | ||
662 | void usb6fire_pcm_destroy(struct sfire_chip *chip) | 706 | void usb6fire_pcm_destroy(struct sfire_chip *chip) |
663 | { | 707 | { |
664 | kfree(chip->pcm); | 708 | struct pcm_runtime *rt = chip->pcm; |
709 | |||
710 | usb6fire_pcm_buffers_destroy(rt); | ||
711 | kfree(rt); | ||
665 | chip->pcm = NULL; | 712 | chip->pcm = NULL; |
666 | } | 713 | } |
diff --git a/sound/usb/6fire/pcm.h b/sound/usb/6fire/pcm.h index 9b01133ee3fe..f5779d6182c6 100644 --- a/sound/usb/6fire/pcm.h +++ b/sound/usb/6fire/pcm.h | |||
@@ -32,7 +32,7 @@ struct pcm_urb { | |||
32 | struct urb instance; | 32 | struct urb instance; |
33 | struct usb_iso_packet_descriptor packets[PCM_N_PACKETS_PER_URB]; | 33 | struct usb_iso_packet_descriptor packets[PCM_N_PACKETS_PER_URB]; |
34 | /* END DO NOT SEPARATE */ | 34 | /* END DO NOT SEPARATE */ |
35 | u8 buffer[PCM_N_PACKETS_PER_URB * PCM_MAX_PACKET_SIZE]; | 35 | u8 *buffer; |
36 | 36 | ||
37 | struct pcm_urb *peer; | 37 | struct pcm_urb *peer; |
38 | }; | 38 | }; |
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 92ea945ff486..93e970f2b3c0 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -594,17 +594,16 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep, | |||
594 | ep->stride = frame_bits >> 3; | 594 | ep->stride = frame_bits >> 3; |
595 | ep->silence_value = pcm_format == SNDRV_PCM_FORMAT_U8 ? 0x80 : 0; | 595 | ep->silence_value = pcm_format == SNDRV_PCM_FORMAT_U8 ? 0x80 : 0; |
596 | 596 | ||
597 | /* calculate max. frequency */ | 597 | /* assume max. frequency is 25% higher than nominal */ |
598 | if (ep->maxpacksize) { | 598 | ep->freqmax = ep->freqn + (ep->freqn >> 2); |
599 | maxsize = ((ep->freqmax + 0xffff) * (frame_bits >> 3)) | ||
600 | >> (16 - ep->datainterval); | ||
601 | /* but wMaxPacketSize might reduce this */ | ||
602 | if (ep->maxpacksize && ep->maxpacksize < maxsize) { | ||
599 | /* whatever fits into a max. size packet */ | 603 | /* whatever fits into a max. size packet */ |
600 | maxsize = ep->maxpacksize; | 604 | maxsize = ep->maxpacksize; |
601 | ep->freqmax = (maxsize / (frame_bits >> 3)) | 605 | ep->freqmax = (maxsize / (frame_bits >> 3)) |
602 | << (16 - ep->datainterval); | 606 | << (16 - ep->datainterval); |
603 | } else { | ||
604 | /* no max. packet size: just take 25% higher than nominal */ | ||
605 | ep->freqmax = ep->freqn + (ep->freqn >> 2); | ||
606 | maxsize = ((ep->freqmax + 0xffff) * (frame_bits >> 3)) | ||
607 | >> (16 - ep->datainterval); | ||
608 | } | 607 | } |
609 | 608 | ||
610 | if (ep->fill_max) | 609 | if (ep->fill_max) |
diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c index 6430ed2a9f65..c21a3df9a0df 100644 --- a/sound/usb/hiface/pcm.c +++ b/sound/usb/hiface/pcm.c | |||
@@ -503,7 +503,7 @@ static snd_pcm_uframes_t hiface_pcm_pointer(struct snd_pcm_substream *alsa_sub) | |||
503 | snd_pcm_uframes_t dma_offset; | 503 | snd_pcm_uframes_t dma_offset; |
504 | 504 | ||
505 | if (rt->panic || !sub) | 505 | if (rt->panic || !sub) |
506 | return SNDRV_PCM_STATE_XRUN; | 506 | return SNDRV_PCM_POS_XRUN; |
507 | 507 | ||
508 | spin_lock_irqsave(&sub->lock, flags); | 508 | spin_lock_irqsave(&sub->lock, flags); |
509 | dma_offset = sub->dma_off; | 509 | dma_offset = sub->dma_off; |
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index 8b5d2c564e04..509315937f25 100644 --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c | |||
@@ -613,14 +613,24 @@ static int start_usb_playback(struct ua101 *ua) | |||
613 | 613 | ||
614 | static void abort_alsa_capture(struct ua101 *ua) | 614 | static void abort_alsa_capture(struct ua101 *ua) |
615 | { | 615 | { |
616 | if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) | 616 | unsigned long flags; |
617 | |||
618 | if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) { | ||
619 | snd_pcm_stream_lock_irqsave(ua->capture.substream, flags); | ||
617 | snd_pcm_stop(ua->capture.substream, SNDRV_PCM_STATE_XRUN); | 620 | snd_pcm_stop(ua->capture.substream, SNDRV_PCM_STATE_XRUN); |
621 | snd_pcm_stream_unlock_irqrestore(ua->capture.substream, flags); | ||
622 | } | ||
618 | } | 623 | } |
619 | 624 | ||
620 | static void abort_alsa_playback(struct ua101 *ua) | 625 | static void abort_alsa_playback(struct ua101 *ua) |
621 | { | 626 | { |
622 | if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) | 627 | unsigned long flags; |
628 | |||
629 | if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) { | ||
630 | snd_pcm_stream_lock_irqsave(ua->playback.substream, flags); | ||
623 | snd_pcm_stop(ua->playback.substream, SNDRV_PCM_STATE_XRUN); | 631 | snd_pcm_stop(ua->playback.substream, SNDRV_PCM_STATE_XRUN); |
632 | snd_pcm_stream_unlock_irqrestore(ua->playback.substream, flags); | ||
633 | } | ||
624 | } | 634 | } |
625 | 635 | ||
626 | static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream, | 636 | static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream, |
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index d5438083fd6a..95558ef4a7a0 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -888,6 +888,7 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, | |||
888 | case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */ | 888 | case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */ |
889 | case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */ | 889 | case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */ |
890 | case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */ | 890 | case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */ |
891 | case USB_ID(0x046d, 0x0826): /* HD Webcam c525 */ | ||
891 | case USB_ID(0x046d, 0x0991): | 892 | case USB_ID(0x046d, 0x0991): |
892 | /* Most audio usb devices lie about volume resolution. | 893 | /* Most audio usb devices lie about volume resolution. |
893 | * Most Logitech webcams have res = 384. | 894 | * Most Logitech webcams have res = 384. |
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 1bc45e71f1fe..0df9ede99dfd 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
@@ -319,19 +319,19 @@ static int create_auto_midi_quirk(struct snd_usb_audio *chip, | |||
319 | if (altsd->bNumEndpoints < 1) | 319 | if (altsd->bNumEndpoints < 1) |
320 | return -ENODEV; | 320 | return -ENODEV; |
321 | epd = get_endpoint(alts, 0); | 321 | epd = get_endpoint(alts, 0); |
322 | if (!usb_endpoint_xfer_bulk(epd) || | 322 | if (!usb_endpoint_xfer_bulk(epd) && |
323 | !usb_endpoint_xfer_int(epd)) | 323 | !usb_endpoint_xfer_int(epd)) |
324 | return -ENODEV; | 324 | return -ENODEV; |
325 | 325 | ||
326 | switch (USB_ID_VENDOR(chip->usb_id)) { | 326 | switch (USB_ID_VENDOR(chip->usb_id)) { |
327 | case 0x0499: /* Yamaha */ | 327 | case 0x0499: /* Yamaha */ |
328 | err = create_yamaha_midi_quirk(chip, iface, driver, alts); | 328 | err = create_yamaha_midi_quirk(chip, iface, driver, alts); |
329 | if (err < 0 && err != -ENODEV) | 329 | if (err != -ENODEV) |
330 | return err; | 330 | return err; |
331 | break; | 331 | break; |
332 | case 0x0582: /* Roland */ | 332 | case 0x0582: /* Roland */ |
333 | err = create_roland_midi_quirk(chip, iface, driver, alts); | 333 | err = create_roland_midi_quirk(chip, iface, driver, alts); |
334 | if (err < 0 && err != -ENODEV) | 334 | if (err != -ENODEV) |
335 | return err; | 335 | return err; |
336 | break; | 336 | break; |
337 | } | 337 | } |
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index 4967fe9c938d..63fb5219f0f8 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c | |||
@@ -273,7 +273,11 @@ static void usX2Y_clients_stop(struct usX2Ydev *usX2Y) | |||
273 | struct snd_usX2Y_substream *subs = usX2Y->subs[s]; | 273 | struct snd_usX2Y_substream *subs = usX2Y->subs[s]; |
274 | if (subs) { | 274 | if (subs) { |
275 | if (atomic_read(&subs->state) >= state_PRERUNNING) { | 275 | if (atomic_read(&subs->state) >= state_PRERUNNING) { |
276 | unsigned long flags; | ||
277 | |||
278 | snd_pcm_stream_lock_irqsave(subs->pcm_substream, flags); | ||
276 | snd_pcm_stop(subs->pcm_substream, SNDRV_PCM_STATE_XRUN); | 279 | snd_pcm_stop(subs->pcm_substream, SNDRV_PCM_STATE_XRUN); |
280 | snd_pcm_stream_unlock_irqrestore(subs->pcm_substream, flags); | ||
277 | } | 281 | } |
278 | for (u = 0; u < NRURBS; u++) { | 282 | for (u = 0; u < NRURBS; u++) { |
279 | struct urb *urb = subs->urb[u]; | 283 | struct urb *urb = subs->urb[u]; |