Skip to content

Commit 0f1f7a6

Browse files
committed
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>
1 parent faf5933 commit 0f1f7a6

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

Documentation/sound/alsa-configuration.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2246,7 +2246,7 @@ implicit_fb
22462246
Apply the generic implicit feedback sync mode. When this is set
22472247
and the playback stream sync mode is ASYNC, the driver tries to
22482248
tie an adjacent ASYNC capture stream as the implicit feedback
2249-
source.
2249+
source. This is equivalent with quirk_flags bit 17.
22502250
use_vmalloc
22512251
Use vmalloc() for allocations of the PCM buffers (default: yes).
22522252
For architectures with non-coherent memory like ARM or MIPS, the
@@ -2288,6 +2288,8 @@ quirk_flags
22882288
* bit 14: Ignore errors for mixer access
22892289
* bit 15: Support generic DSD raw U32_BE format
22902290
* 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
22912293

22922294
This module supports multiple devices, autoprobe and hotplugging.
22932295

sound/usb/implicit.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ static int audioformat_implicit_fb_quirk(struct snd_usb_audio *chip,
350350
}
351351

352352
/* 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))
354355
return add_generic_implicit_fb(chip, fmt, alts);
355356

356357
/* No quirk */
@@ -387,6 +388,8 @@ int snd_usb_parse_implicit_fb_quirk(struct snd_usb_audio *chip,
387388
struct audioformat *fmt,
388389
struct usb_host_interface *alts)
389390
{
391+
if (chip->quirk_flags & QUIRK_FLAG_SKIP_IMPLICIT_FB)
392+
return 0;
390393
if (fmt->endpoint & USB_DIR_IN)
391394
return audioformat_capture_quirk(chip, fmt, alts);
392395
else

sound/usb/usbaudio.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ extern bool snd_usb_skip_validation;
164164
* Support generic DSD raw U32_BE format
165165
* QUIRK_FLAG_SET_IFACE_FIRST:
166166
* 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
167171
*/
168172

169173
#define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0)
@@ -183,5 +187,7 @@ extern bool snd_usb_skip_validation;
183187
#define QUIRK_FLAG_IGNORE_CTL_ERROR (1U << 14)
184188
#define QUIRK_FLAG_DSD_RAW (1U << 15)
185189
#define QUIRK_FLAG_SET_IFACE_FIRST (1U << 16)
190+
#define QUIRK_FLAG_GENERIC_IMPLICIT_FB (1U << 17)
191+
#define QUIRK_FLAG_SKIP_IMPLICIT_FB (1U << 18)
186192

187193
#endif /* __USBAUDIO_H */

0 commit comments

Comments
 (0)