diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-07-29 09:38:50 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-08-02 09:05:57 +0200 |
commit | c1b034a4214e4ce81132be9db44e9fe3e2369351 (patch) | |
tree | 0085bb5ef07895218adf83a852ae0d5e54addced /sound/usb/endpoint.c | |
parent | ALSA: usb-audio: Move txfr_quirk handling to quirk_flags (diff) | |
download | linux-c1b034a4214e4ce81132be9db44e9fe3e2369351.tar.xz linux-c1b034a4214e4ce81132be9db44e9fe3e2369351.zip |
ALSA: usb-audio: Move tx_length quirk handling to quirk_flags
There is another quirk for the transfer, and that's currently specific
to Zoom R16/24, handled in create_standard_audio_quirk(). Let's move
this also to the new quirk_flags.
Link: https://lore.kernel.org/r/20210729073855.19043-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/endpoint.c')
-rw-r--r-- | sound/usb/endpoint.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 4f856771216b..16c36e43c16f 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -240,6 +240,11 @@ static void retire_inbound_urb(struct snd_usb_endpoint *ep, call_retire_callback(ep, urb); } +static inline bool has_tx_length_quirk(struct snd_usb_audio *chip) +{ + return chip->quirk_flags & QUIRK_FLAG_TX_LENGTH; +} + static void prepare_silent_urb(struct snd_usb_endpoint *ep, struct snd_urb_ctx *ctx) { @@ -250,7 +255,7 @@ static void prepare_silent_urb(struct snd_usb_endpoint *ep, int i; /* For tx_length_quirk, put packet length at start of packet */ - if (ep->chip->tx_length_quirk) + if (has_tx_length_quirk(ep->chip)) extra = sizeof(packet_length); for (i = 0; i < ctx->packets; ++i) { @@ -952,7 +957,7 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep) unsigned int max_urbs, i; const struct audioformat *fmt = ep->cur_audiofmt; int frame_bits = ep->cur_frame_bytes * 8; - int tx_length_quirk = (chip->tx_length_quirk && + int tx_length_quirk = (has_tx_length_quirk(chip) && usb_pipeout(ep->pipe)); usb_audio_dbg(chip, "Setting params for data EP 0x%x, pipe 0x%x\n", |