Commit 019c7f91 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: usb-audio: Move playback_first flag into quirk_flags

The snd_usb_audio.playback_first flag is used by the implicit feedback
mode handling, and this can be also moved to quirk_flags.

Link: https://lore.kernel.org/r/20210729073855.19043-6-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c1b034a4
...@@ -1382,7 +1382,7 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep) ...@@ -1382,7 +1382,7 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep)
goto __error; goto __error;
if (snd_usb_endpoint_implicit_feedback_sink(ep) && if (snd_usb_endpoint_implicit_feedback_sink(ep) &&
!ep->chip->playback_first) { !(ep->chip->quirk_flags & QUIRK_FLAG_PLAYBACK_FIRST)) {
for (i = 0; i < ep->nurbs; i++) { for (i = 0; i < ep->nurbs; i++) {
struct snd_urb_ctx *ctx = ep->urb + i; struct snd_urb_ctx *ctx = ep->urb + i;
list_add_tail(&ctx->ready_list, &ep->ready_playback_urbs); list_add_tail(&ctx->ready_list, &ep->ready_playback_urbs);
......
...@@ -171,7 +171,7 @@ static int add_roland_implicit_fb(struct snd_usb_audio *chip, ...@@ -171,7 +171,7 @@ static int add_roland_implicit_fb(struct snd_usb_audio *chip,
if (!usb_endpoint_is_isoc_in(epd) || if (!usb_endpoint_is_isoc_in(epd) ||
(epd->bmAttributes & USB_ENDPOINT_SYNCTYPE) != USB_ENDPOINT_SYNC_ASYNC) (epd->bmAttributes & USB_ENDPOINT_SYNCTYPE) != USB_ENDPOINT_SYNC_ASYNC)
return 0; return 0;
chip->playback_first = 1; chip->quirk_flags |= QUIRK_FLAG_PLAYBACK_FIRST;
return add_implicit_fb_sync_ep(chip, fmt, epd->bEndpointAddress, 0, return add_implicit_fb_sync_ep(chip, fmt, epd->bEndpointAddress, 0,
alts->desc.bInterfaceNumber, alts); alts->desc.bInterfaceNumber, alts);
} }
...@@ -320,7 +320,7 @@ static int audioformat_implicit_fb_quirk(struct snd_usb_audio *chip, ...@@ -320,7 +320,7 @@ static int audioformat_implicit_fb_quirk(struct snd_usb_audio *chip,
case IMPLICIT_FB_FIXED: case IMPLICIT_FB_FIXED:
return 0; /* no quirk */ return 0; /* no quirk */
case IMPLICIT_FB_BOTH: case IMPLICIT_FB_BOTH:
chip->playback_first = 1; chip->quirk_flags |= QUIRK_FLAG_PLAYBACK_FIRST;
return add_generic_implicit_fb(chip, fmt, alts); return add_generic_implicit_fb(chip, fmt, alts);
} }
} }
...@@ -344,7 +344,7 @@ static int audioformat_implicit_fb_quirk(struct snd_usb_audio *chip, ...@@ -344,7 +344,7 @@ static int audioformat_implicit_fb_quirk(struct snd_usb_audio *chip,
/* Pioneer devices with vendor spec class */ /* Pioneer devices with vendor spec class */
if (is_pioneer_implicit_fb(chip, alts)) { if (is_pioneer_implicit_fb(chip, alts)) {
chip->playback_first = 1; chip->quirk_flags |= QUIRK_FLAG_PLAYBACK_FIRST;
return add_implicit_fb_sync_ep(chip, fmt, return add_implicit_fb_sync_ep(chip, fmt,
get_endpoint(alts, 1)->bEndpointAddress, get_endpoint(alts, 1)->bEndpointAddress,
1, alts->desc.bInterfaceNumber, 1, alts->desc.bInterfaceNumber,
......
...@@ -36,7 +36,6 @@ struct snd_usb_audio { ...@@ -36,7 +36,6 @@ struct snd_usb_audio {
wait_queue_head_t shutdown_wait; wait_queue_head_t shutdown_wait;
unsigned int quirk_flags; unsigned int quirk_flags;
unsigned int need_delayed_register:1; /* warn for delayed registration */ unsigned int need_delayed_register:1; /* warn for delayed registration */
unsigned int playback_first:1; /* for implicit fb: don't wait for the first capture URBs */
int num_interfaces; int num_interfaces;
int num_suspended_intf; int num_suspended_intf;
int sample_rate_read_error; int sample_rate_read_error;
...@@ -139,11 +138,14 @@ extern bool snd_usb_skip_validation; ...@@ -139,11 +138,14 @@ extern bool snd_usb_skip_validation;
* slots (audio frames) * slots (audio frames)
* QUIRK_TX_LENGTH: * QUIRK_TX_LENGTH:
* Add length specifier to transfers * Add length specifier to transfers
* QUIRK_FLAG_PLAYBACK_FIRST:
* Start playback stream at first even in implement feedback mode
*/ */
#define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0) #define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0)
#define QUIRK_FLAG_SHARE_MEDIA_DEVICE (1U << 1) #define QUIRK_FLAG_SHARE_MEDIA_DEVICE (1U << 1)
#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)
#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