Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1362bf92 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sound: usb: Set SET_ALT control transfer timout as 1 sec"

parents 261e0271 d410188b
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@
#define SUBSTREAM_FLAG_DATA_EP_STARTED	0
#define SUBSTREAM_FLAG_SYNC_EP_STARTED	1

#define MAX_SETALT_TIMEOUT_MS 1000

/* return the estimated delay based on USB frame counters */
snd_pcm_uframes_t snd_usb_pcm_delay(struct snd_usb_substream *subs,
				    unsigned int rate)
@@ -508,7 +510,8 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)

	/* close the old interface */
	if (subs->interface >= 0 && subs->interface != fmt->iface) {
		err = usb_set_interface(subs->dev, subs->interface, 0);
		err = usb_set_interface_timeout(subs->dev, subs->interface, 0,
			MAX_SETALT_TIMEOUT_MS);
		if (err < 0) {
			dev_err(&dev->dev,
				"%d:%d: return to setting 0 failed (%d)\n",
@@ -527,7 +530,8 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
		if (err < 0)
			return -EIO;

		err = usb_set_interface(dev, fmt->iface, fmt->altsetting);
		err = usb_set_interface_timeout(dev, fmt->iface,
				fmt->altsetting, MAX_SETALT_TIMEOUT_MS);
		if (err < 0) {
			dev_err(&dev->dev,
				"%d:%d: usb_set_interface failed (%d)\n",
@@ -574,7 +578,8 @@ int snd_usb_enable_audio_stream(struct snd_usb_substream *subs,

	if (!enable) {
		if (subs->interface >= 0) {
			usb_set_interface(subs->dev, subs->interface, 0);
			usb_set_interface_timeout(subs->dev, subs->interface, 0,
				MAX_SETALT_TIMEOUT_MS);
			subs->altset_idx = 0;
			subs->interface = -1;
			subs->cur_audiofmt = NULL;