Skip to content

Commit 6e41340

Browse files
committed
ALSA: usb-audio: Move set-interface-first workaround into common quirk
The recent quirk for WALKMAN (commit 7af5a14: "ALSA: usb-audio: Fix regression on Sony WALKMAN NW-A45 DAC") may be required for other devices and is worth to be put into the common quirk flags. This patch adds a new quirk flag bit QUIRK_FLAG_SET_IFACE_FIRST and a quirk table entry for the device. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 1a10d5b commit 6e41340

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

Documentation/sound/alsa-configuration.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,7 @@ quirk_flags
22782278
* bit 13: Disable runtime PM autosuspend
22792279
* bit 14: Ignore errors for mixer access
22802280
* bit 15: Support generic DSD raw U32_BE format
2281+
* bit 16: Set up the interface at first like UAC1
22812282

22822283
This module supports multiple devices, autoprobe and hotplugging.
22832284

sound/usb/endpoint.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,10 +1293,8 @@ int snd_usb_endpoint_configure(struct snd_usb_audio *chip,
12931293
* to be set up before parameter setups
12941294
*/
12951295
iface_first = ep->cur_audiofmt->protocol == UAC_VERSION_1;
1296-
/* Workaround for Sony WALKMAN NW-A45 DAC;
1297-
* it requires the interface setup at first like UAC1
1298-
*/
1299-
if (chip->usb_id == USB_ID(0x054c, 0x0b8c))
1296+
/* Workaround for devices that require the interface setup at first like UAC1 */
1297+
if (chip->quirk_flags & QUIRK_FLAG_SET_IFACE_FIRST)
13001298
iface_first = true;
13011299
if (iface_first) {
13021300
err = endpoint_set_interface(chip, ep, true);

sound/usb/quirks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
17901790
QUIRK_FLAG_GET_SAMPLE_RATE),
17911791
DEVICE_FLG(0x04e8, 0xa051, /* Samsung USBC Headset (AKG) */
17921792
QUIRK_FLAG_SKIP_CLOCK_SELECTOR | QUIRK_FLAG_CTL_MSG_DELAY_5M),
1793+
DEVICE_FLG(0x054c, 0x0b8c, /* Sony WALKMAN NW-A45 DAC */
1794+
QUIRK_FLAG_SET_IFACE_FIRST),
17931795
DEVICE_FLG(0x0556, 0x0014, /* Phoenix Audio TMX320VC */
17941796
QUIRK_FLAG_GET_SAMPLE_RATE),
17951797
DEVICE_FLG(0x05a3, 0x9420, /* ELP HD USB Camera */

sound/usb/usbaudio.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ extern bool snd_usb_skip_validation;
161161
* Ignore errors for mixer access
162162
* QUIRK_FLAG_DSD_RAW:
163163
* Support generic DSD raw U32_BE format
164+
* QUIRK_FLAG_SET_IFACE_FIRST:
165+
* Set up the interface at first like UAC1
164166
*/
165167

166168
#define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0)
@@ -179,5 +181,6 @@ extern bool snd_usb_skip_validation;
179181
#define QUIRK_FLAG_DISABLE_AUTOSUSPEND (1U << 13)
180182
#define QUIRK_FLAG_IGNORE_CTL_ERROR (1U << 14)
181183
#define QUIRK_FLAG_DSD_RAW (1U << 15)
184+
#define QUIRK_FLAG_SET_IFACE_FIRST (1U << 16)
182185

183186
#endif /* __USBAUDIO_H */

0 commit comments

Comments
 (0)