From patchwork Thu Jun 8 21:58:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yueyao Zhu X-Patchwork-Id: 9776617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0640D6034B for ; Thu, 8 Jun 2017 21:59:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB60E28599 for ; Thu, 8 Jun 2017 21:59:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0040285AB; Thu, 8 Jun 2017 21:59:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 921EE28599 for ; Thu, 8 Jun 2017 21:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751976AbdFHV67 (ORCPT ); Thu, 8 Jun 2017 17:58:59 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:32997 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751923AbdFHV6m (ORCPT ); Thu, 8 Jun 2017 17:58:42 -0400 Received: by mail-pf0-f196.google.com with SMTP id f27so6506631pfe.0; Thu, 08 Jun 2017 14:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KKFs9WiNYFRbGBDrmW9xDtk0YQIE1xTuovgv+YL3Oho=; b=hoJ4whUVa6giPeLZQHchJnaVZzRfdymEyljOEs3/fzOi8w+6CVC7228pQ5N+QQBndJ j7ldI/0ExeLzzAX/wiSMHXeyV/Ijer/ogZy+anXOCEe9bMPOw5ZEmJOc7oCQdHsDbABO cLY+w38FINTPwtkr9NXlphhCpfktm+cAVPbYV1wyXSnDRc1tHLS42CvWZXbC0uIEbsZa PGWWCnmAJ+j7bqFduG3D48dBIwcPdmqiywjCh6pYyyN6d8lcQlBO23qkyDtNsRuCocut eJxTjla6GM5fir3CkPGIJc7bPh+y8UtLuVb31p+hK6U3h4a9cp4kE9s8GYKOnGx4HOzd em+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KKFs9WiNYFRbGBDrmW9xDtk0YQIE1xTuovgv+YL3Oho=; b=sC1gS308ZuMHnRP3OZORvt2++CIglpfJC1il5U3g2O6qYvVl5WsPDSE8D1rfQcUxob xlXYHMvUYYsQMIsL9+ljtW/ugwRctJJt0DAInRBuVpR5j511ifN0cY3iMwFHMvlCgqYs cD89K8NBK3X7s6LAOVTocM7O55jNNJ7X11Zx9JVIWJ9BK2hIsVmyCLH0/kFBhGFyhRed kKWkWI2THuMGqQL0dfON2g3qpthPHxp0ST+NwxpuEsmiGfV/bjevhkxHNJrb0jR1dPaL OI78x1biHH5rHkpxBkTbV5hMk4IGpy/Nd0d+4K906avAZLDIiKf07PCdb/nhokl9uB4e iCPQ== X-Gm-Message-State: AODbwcAevQkniPaGP1S2eE1baWZolyFBU+7RbzXo0T9HS4tVhD24iUuv 6alkvK1cjROonQ== X-Received: by 10.84.179.193 with SMTP id b59mr36370361plc.3.1496959121533; Thu, 08 Jun 2017 14:58:41 -0700 (PDT) Received: from yueyao0.mtv.corp.google.com ([100.98.126.197]) by smtp.gmail.com with ESMTPSA id u73sm10826385pgb.24.2017.06.08.14.58.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Jun 2017 14:58:41 -0700 (PDT) From: Yueyao Zhu To: Jiri Kosina , Benjamin Tissoires , Greg Kroah-Hartman , Jaroslav Kysela , Takashi Iwai Cc: linux-usb@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Chant , Badhri Jagan Sridharan , Dmitry Torokhov , Yueyao Zhu Subject: [PATCH 3/3] sound: usb: allow interfaces that the driver claims to autosuspend Date: Thu, 8 Jun 2017 14:58:28 -0700 Message-Id: <20170608215828.130455-4-yueyao.zhu@gmail.com> X-Mailer: git-send-email 2.13.0.506.g27d5fe0cd-goog In-Reply-To: <20170608215828.130455-1-yueyao.zhu@gmail.com> References: <20170608215828.130455-1-yueyao.zhu@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yueyao Zhu 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 --- 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(®ister_mutex); return 0;