Skip to content

Commit bf990c1

Browse files
TomAi0tiwai
authored andcommitted
ALSA: usb-audio: add quirk to fix Hamedal C20 disconnect issue
For Hamedal C20, the current rate is different from the runtime rate, snd_usb_endpoint stop and close endpoint to resetting rate. if snd_usb_endpoint close the endpoint, sometimes usb will disconnect the device. Signed-off-by: Ai Chao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 79e28f2 commit bf990c1

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

sound/usb/endpoint.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,8 @@ void snd_usb_endpoint_close(struct snd_usb_audio *chip,
931931
usb_audio_dbg(chip, "Closing EP 0x%x (count %d)\n",
932932
ep->ep_num, ep->opened);
933933

934-
if (!--ep->iface_ref->opened)
934+
if (!--ep->iface_ref->opened &&
935+
!(chip->quirk_flags & QUIRK_FLAG_IFACE_SKIP_CLOSE))
935936
endpoint_set_interface(chip, ep, false);
936937

937938
if (!--ep->opened) {

sound/usb/quirks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,6 +2148,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
21482148
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
21492149
DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */
21502150
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
2151+
DEVICE_FLG(0x0525, 0xa4ad, /* Hamedal C20 usb camero */
2152+
QUIRK_FLAG_IFACE_SKIP_CLOSE),
21512153

21522154
/* Vendor matches */
21532155
VENDOR_FLG(0x045e, /* MS Lifecam */

sound/usb/usbaudio.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ extern bool snd_usb_skip_validation;
170170
* Apply the generic implicit feedback sync mode (same as implicit_fb=1 option)
171171
* QUIRK_FLAG_SKIP_IMPLICIT_FB
172172
* Don't apply implicit feedback sync mode
173+
* QUIRK_FLAG_IFACE_SKIP_CLOSE
174+
* Don't closed interface during setting sample rate
173175
*/
174176

175177
#define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0)
@@ -191,5 +193,6 @@ extern bool snd_usb_skip_validation;
191193
#define QUIRK_FLAG_SET_IFACE_FIRST (1U << 16)
192194
#define QUIRK_FLAG_GENERIC_IMPLICIT_FB (1U << 17)
193195
#define QUIRK_FLAG_SKIP_IMPLICIT_FB (1U << 18)
196+
#define QUIRK_FLAG_IFACE_SKIP_CLOSE (1U << 19)
194197

195198
#endif /* __USBAUDIO_H */

0 commit comments

Comments
 (0)