Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: usb-audio: Add quirk bits for enabling/disabling generic implicit fb

For making easier to test, add the new quirk_flags bits 17 and 18 to
enable and disable the generic implicit feedback mode. The bit 17 is
equivalent with implicit_fb=1 option, applying the generic implicit
feedback sync mode. OTOH, the bit 18 disables the implicit fb mode
forcibly.

Link: https://lore.kernel.org/r/20220421064101.12456-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+13 -2
+3 -1
Documentation/sound/alsa-configuration.rst
··· 2246 2246 Apply the generic implicit feedback sync mode. When this is set 2247 2247 and the playback stream sync mode is ASYNC, the driver tries to 2248 2248 tie an adjacent ASYNC capture stream as the implicit feedback 2249 - source. 2249 + source. This is equivalent with quirk_flags bit 17. 2250 2250 use_vmalloc 2251 2251 Use vmalloc() for allocations of the PCM buffers (default: yes). 2252 2252 For architectures with non-coherent memory like ARM or MIPS, the ··· 2288 2288 * bit 14: Ignore errors for mixer access 2289 2289 * bit 15: Support generic DSD raw U32_BE format 2290 2290 * bit 16: Set up the interface at first like UAC1 2291 + * bit 17: Apply the generic implicit feedback sync mode 2292 + * bit 18: Don't apply implicit feedback sync mode 2291 2293 2292 2294 This module supports multiple devices, autoprobe and hotplugging. 2293 2295
+4 -1
sound/usb/implicit.c
··· 350 350 } 351 351 352 352 /* Try the generic implicit fb if available */ 353 - if (chip->generic_implicit_fb) 353 + if (chip->generic_implicit_fb || 354 + (chip->quirk_flags & QUIRK_FLAG_GENERIC_IMPLICIT_FB)) 354 355 return add_generic_implicit_fb(chip, fmt, alts); 355 356 356 357 /* No quirk */ ··· 388 387 struct audioformat *fmt, 389 388 struct usb_host_interface *alts) 390 389 { 390 + if (chip->quirk_flags & QUIRK_FLAG_SKIP_IMPLICIT_FB) 391 + return 0; 391 392 if (fmt->endpoint & USB_DIR_IN) 392 393 return audioformat_capture_quirk(chip, fmt, alts); 393 394 else
+6
sound/usb/usbaudio.h
··· 164 164 * Support generic DSD raw U32_BE format 165 165 * QUIRK_FLAG_SET_IFACE_FIRST: 166 166 * Set up the interface at first like UAC1 167 + * QUIRK_FLAG_GENERIC_IMPLICIT_FB 168 + * Apply the generic implicit feedback sync mode (same as implicit_fb=1 option) 169 + * QUIRK_FLAG_SKIP_IMPLICIT_FB 170 + * Don't apply implicit feedback sync mode 167 171 */ 168 172 169 173 #define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0) ··· 187 183 #define QUIRK_FLAG_IGNORE_CTL_ERROR (1U << 14) 188 184 #define QUIRK_FLAG_DSD_RAW (1U << 15) 189 185 #define QUIRK_FLAG_SET_IFACE_FIRST (1U << 16) 186 + #define QUIRK_FLAG_GENERIC_IMPLICIT_FB (1U << 17) 187 + #define QUIRK_FLAG_SKIP_IMPLICIT_FB (1U << 18) 190 188 191 189 #endif /* __USBAUDIO_H */