diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-12-18 20:05:39 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-12-18 20:07:43 +0100 |
commit | a032ff0e8065668e672eb2e223e265b7808f35a3 (patch) | |
tree | 90c43579c425f8789fc9cec99c8ea39ba6c26874 /sound/usb/pcm.c | |
parent | ALSA: usx2y: Adjust indentation in snd_usX2Y_hwdep_dsp_status (diff) | |
parent | ALSA: usb-audio: set the interface format after resume on Dell WD19 (diff) | |
download | linux-a032ff0e8065668e672eb2e223e265b7808f35a3.tar.xz linux-a032ff0e8065668e672eb2e223e265b7808f35a3.zip |
Merge branch 'for-linus' into for-next
Taking the 5.5 devel branch back into the main devel branch.
A USB-audio fix needs to be adjusted to adapt the changes that have
been formerly applied for stop_sync.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/pcm.c')
-rw-r--r-- | sound/usb/pcm.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 8a52996041e9..0372f6212313 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -523,11 +523,11 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) if (WARN_ON(altsd->bAlternateSetting != fmt->altsetting)) return -EINVAL; - if (fmt == subs->cur_audiofmt) + if (fmt == subs->cur_audiofmt && !subs->need_setup_fmt) return 0; /* close the old interface */ - if (subs->interface >= 0 && subs->interface != fmt->iface) { + if (subs->interface >= 0 && (subs->interface != fmt->iface || subs->need_setup_fmt)) { if (!subs->stream->chip->keep_iface) { err = usb_set_interface(subs->dev, subs->interface, 0); if (err < 0) { @@ -541,6 +541,9 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) subs->altset_idx = 0; } + if (subs->need_setup_fmt) + subs->need_setup_fmt = false; + /* set interface */ if (iface->cur_altsetting != alts) { err = snd_usb_select_mode_quirk(subs, fmt); @@ -1734,6 +1737,13 @@ static int snd_usb_substream_playback_trigger(struct snd_pcm_substream *substrea subs->data_endpoint->retire_data_urb = retire_playback_urb; subs->running = 0; return 0; + case SNDRV_PCM_TRIGGER_SUSPEND: + if (subs->stream->chip->setup_fmt_after_resume_quirk) { + stop_endpoints(subs); + subs->need_setup_fmt = true; + return 0; + } + break; } return -EINVAL; @@ -1766,6 +1776,13 @@ static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream subs->data_endpoint->retire_data_urb = retire_capture_urb; subs->running = 1; return 0; + case SNDRV_PCM_TRIGGER_SUSPEND: + if (subs->stream->chip->setup_fmt_after_resume_quirk) { + stop_endpoints(subs); + subs->need_setup_fmt = true; + return 0; + } + break; } return -EINVAL; |