summaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-07-29 09:38:52 +0200
committerTakashi Iwai <tiwai@suse.de>2021-08-02 09:05:59 +0200
commitf21dca857b4c2ab226083330ee31479ddac1e99d (patch)
treec153dd3e5b6a9fc6e616bdd36a56a0fb44635f21 /sound/usb
parent019c7f912ca947c80b9b6f090fee90f90e1be9c8 (diff)
downloadlinux-f21dca857b4c2ab226083330ee31479ddac1e99d.tar.bz2
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.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/clock.c13
-rw-r--r--sound/usb/quirks.c4
-rw-r--r--sound/usb/usbaudio.h6
3 files changed, 14 insertions, 9 deletions
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index 90b03ae03574..81d5ce07d548 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -324,11 +324,8 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip,
sources[ret - 1],
visited, validate);
if (ret > 0) {
- /*
- * For Samsung USBC Headset (AKG), setting clock selector again
- * will result in incorrect default clock setting problems
- */
- if (chip->usb_id == USB_ID(0x04e8, 0xa051))
+ /* Skip setting clock selector again for some devices */
+ if (chip->quirk_flags & QUIRK_FLAG_SKIP_CLOCK_SELECTOR)
return ret;
err = uac_clock_selector_set_val(chip, entity_id, cur);
if (err < 0)
@@ -541,10 +538,8 @@ static int set_sample_rate_v2v3(struct snd_usb_audio *chip,
*/
clock = snd_usb_clock_find_source(chip, fmt, false);
- /* Denon DN-X1600 hardcoded
- * Sample rate seems to be set on the hardware itself
- */
- if (chip->usb_id == USB_ID(0x154e, 0x500e))
+ /* Hardcoded sample rates */
+ if (chip->quirk_flags & QUIRK_FLAG_IGNORE_CLOCK_SOURCE)
return 0;
if (clock < 0)
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 9f295cb8c3c5..a9d8bde416ce 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1890,6 +1890,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x04d8, 0xfeea, /* Benchmark DAC1 Pre */
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 */
QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x05a3, 0x9420, /* ELP HD USB Camera */
@@ -1906,6 +1908,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER),
DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */
QUIRK_FLAG_GET_SAMPLE_RATE),
+ DEVICE_FLG(0x154e, 0x500e, /* Denon DN-X1600 */
+ QUIRK_FLAG_IGNORE_CLOCK_SOURCE),
DEVICE_FLG(0x1686, 0x00dd, /* Zoom R16/24 */
QUIRK_FLAG_TX_LENGTH),
DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 8de2b6c51dad..82073ebeac5b 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -140,6 +140,10 @@ extern bool snd_usb_skip_validation;
* Add length specifier to transfers
* QUIRK_FLAG_PLAYBACK_FIRST:
* 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)
@@ -147,5 +151,7 @@ extern bool snd_usb_skip_validation;
#define QUIRK_FLAG_ALIGN_TRANSFER (1U << 2)
#define QUIRK_FLAG_TX_LENGTH (1U << 3)
#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 */