mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yueyao Zhu <yueyao.zhu@gmail.com>
To: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: linux-usb@vger.kernel.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, Andrew Chant <achant@google.com>,
	Badhri Jagan Sridharan <badhri@google.com>,
	Dmitry Torokhov <dtor@google.com>, Yueyao Zhu <yueyao@google.com>
Subject: [PATCH 3/3] sound: usb: allow interfaces that the driver claims to autosuspend
Date: Thu,  8 Jun 2017 14:58:28 -0700	[thread overview]
Message-ID: <20170608215828.130455-4-yueyao.zhu@gmail.com> (raw)
In-Reply-To: <20170608215828.130455-1-yueyao.zhu@gmail.com>

From: Yueyao Zhu <yueyao@google.com>

Instead of calling usb_enable_autosuspend() to change the configuration
of a USB device as an interface driver, enable autosuspend for every
interfaces that the driver claims.

Signed-off-by: Yueyao Zhu <yueyao@google.com>
---
 sound/usb/card.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/usb/card.c b/sound/usb/card.c
index 6640277a725b..79bec2883740 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -184,6 +184,7 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int
 			return -EINVAL;
 		}
 		usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1L);
+		usb_allow_interface_autosuspend(iface);
 
 		return 0;
 	}
@@ -206,6 +207,7 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int
 	if (! snd_usb_parse_audio_interface(chip, interface)) {
 		usb_set_interface(dev, interface, 0); /* reset the current interface */
 		usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1L);
+		usb_allow_interface_autosuspend(iface);
 	}
 
 	return 0;
@@ -618,6 +620,7 @@ static int usb_audio_probe(struct usb_interface *intf,
 	usb_chip[chip->index] = chip;
 	chip->num_interfaces++;
 	usb_set_intfdata(intf, chip);
+	usb_allow_interface_autosuspend(intf);
 	atomic_dec(&chip->active);
 	mutex_unlock(&register_mutex);
 	return 0;
-- 
2.13.0.506.g27d5fe0cd-goog

  parent reply	other threads:[~2017-06-08 21:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 21:58 [PATCH 0/3] USB: add API for interface driver to vote for autosuspend Yueyao Zhu
2017-06-08 21:58 ` [PATCH 1/3] " Yueyao Zhu
2017-06-10 11:50   ` kbuild test robot
2017-06-08 21:58 ` [PATCH 2/3] HID: usbhid: enable autosuspend for devices whose Yueyao Zhu
2017-06-08 21:58 ` Yueyao Zhu [this message]
2017-06-09 14:48 ` [PATCH 0/3] USB: add API for interface driver to vote for autosuspend Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170608215828.130455-4-yueyao.zhu@gmail.com \
    --to=yueyao.zhu@gmail.com \
    --cc=achant@google.com \
    --cc=badhri@google.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dtor@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=yueyao@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®