Commit f21dca85 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: usb-audio: Move clock setup quirk into quirk_flags

There are a couple of device-specific quirks in the clock setup code,
and those can be moved gracefully to quirk_flags, too.

Link: https://lore.kernel.org/r/20210729073855.19043-7-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 019c7f91
...@@ -324,11 +324,8 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip, ...@@ -324,11 +324,8 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip,
sources[ret - 1], sources[ret - 1],
visited, validate); visited, validate);
if (ret > 0) { if (ret > 0) {
/* /* Skip setting clock selector again for some devices */
* For Samsung USBC Headset (AKG), setting clock selector again if (chip->quirk_flags & QUIRK_FLAG_SKIP_CLOCK_SELECTOR)
* will result in incorrect default clock setting problems
*/
if (chip->usb_id == USB_ID(0x04e8, 0xa051))
return ret; return ret;
err = uac_clock_selector_set_val(chip, entity_id, cur); err = uac_clock_selector_set_val(chip, entity_id, cur);
if (err < 0) if (err < 0)
...@@ -541,10 +538,8 @@ static int set_sample_rate_v2v3(struct snd_usb_audio *chip, ...@@ -541,10 +538,8 @@ static int set_sample_rate_v2v3(struct snd_usb_audio *chip,
*/ */
clock = snd_usb_clock_find_source(chip, fmt, false); clock = snd_usb_clock_find_source(chip, fmt, false);
/* Denon DN-X1600 hardcoded /* Hardcoded sample rates */
* Sample rate seems to be set on the hardware itself if (chip->quirk_flags & QUIRK_FLAG_IGNORE_CLOCK_SOURCE)
*/
if (chip->usb_id == USB_ID(0x154e, 0x500e))
return 0; return 0;
if (clock < 0) if (clock < 0)
......
...@@ -1890,6 +1890,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { ...@@ -1890,6 +1890,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x04d8, 0xfeea, /* Benchmark DAC1 Pre */ DEVICE_FLG(0x04d8, 0xfeea, /* Benchmark DAC1 Pre */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x04e8, 0xa051, /* Samsung USBC Headset (AKG) */
QUIRK_FLAG_SKIP_CLOCK_SELECTOR),
DEVICE_FLG(0x0556, 0x0014, /* Phoenix Audio TMX320VC */ DEVICE_FLG(0x0556, 0x0014, /* Phoenix Audio TMX320VC */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x05a3, 0x9420, /* ELP HD USB Camera */ DEVICE_FLG(0x05a3, 0x9420, /* ELP HD USB Camera */
...@@ -1906,6 +1908,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { ...@@ -1906,6 +1908,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER), QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER),
DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */ DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x154e, 0x500e, /* Denon DN-X1600 */
QUIRK_FLAG_IGNORE_CLOCK_SOURCE),
DEVICE_FLG(0x1686, 0x00dd, /* Zoom R16/24 */ DEVICE_FLG(0x1686, 0x00dd, /* Zoom R16/24 */
QUIRK_FLAG_TX_LENGTH), QUIRK_FLAG_TX_LENGTH),
DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */ DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */
......
...@@ -140,6 +140,10 @@ extern bool snd_usb_skip_validation; ...@@ -140,6 +140,10 @@ extern bool snd_usb_skip_validation;
* Add length specifier to transfers * Add length specifier to transfers
* QUIRK_FLAG_PLAYBACK_FIRST: * QUIRK_FLAG_PLAYBACK_FIRST:
* Start playback stream at first even in implement feedback mode * Start playback stream at first even in implement feedback mode
* QUIRK_FLAG_SKIP_CLOCK_SELECTOR:
* Skip clock selector setup; the device may reset to invalid state
* QUIRK_FLAG_IGNORE_CLOCK_SOURCE:
* Ignore errors from clock source search; i.e. hardcoded clock
*/ */
#define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0) #define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0)
...@@ -147,5 +151,7 @@ extern bool snd_usb_skip_validation; ...@@ -147,5 +151,7 @@ extern bool snd_usb_skip_validation;
#define QUIRK_FLAG_ALIGN_TRANSFER (1U << 2) #define QUIRK_FLAG_ALIGN_TRANSFER (1U << 2)
#define QUIRK_FLAG_TX_LENGTH (1U << 3) #define QUIRK_FLAG_TX_LENGTH (1U << 3)
#define QUIRK_FLAG_PLAYBACK_FIRST (1U << 4) #define QUIRK_FLAG_PLAYBACK_FIRST (1U << 4)
#define QUIRK_FLAG_SKIP_CLOCK_SELECTOR (1U << 5)
#define QUIRK_FLAG_IGNORE_CLOCK_SOURCE (1U << 6)
#endif /* __USBAUDIO_H */ #endif /* __USBAUDIO_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment