From patchwork Wed Dec 14 08:14:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puma Hsu X-Patchwork-Id: 2948 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp78202wrn; Wed, 14 Dec 2022 00:16:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf4LSSYM+GhBCSCMVMBQoA7O+yj4cRstyGFuuC/uTEsHy0JpL+Ja703/j7K/Eq9+SnoC/O05 X-Received: by 2002:a17:903:40c5:b0:189:c99d:6af4 with SMTP id t5-20020a17090340c500b00189c99d6af4mr24496330pld.8.1671005816274; Wed, 14 Dec 2022 00:16:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671005816; cv=none; d=google.com; s=arc-20160816; b=FlqZOgczGNgfyW0/teKdUltwMUOB9uHahhwV+co4xNiIHa99Q0Jgz/2kywfO2QXTpt /bEzeWB9aI0EUkI9gIb9Dn+BOjCz9Or66w+kc1l5/Ocn1AYg+QI7vsMHdDfhOGAU1oFp Q5r1bJa+NPItm9ZCBFZbfkTkquSYVHWXsBGvxfgrap+LGO8gad+EroknK1ZoY9L1uqtj +CYgBTomlkq7igMcljwpWNGosDb9ih46rLBL/wQdKbZEBpctMYlNdbuEZJzHw+L3woB5 IPFUky7Ryyj0Fi23d5y0II2SgNjwDDTfAV/uQf/NHEkVfAAszUzwdawpI9vdt5Qeg/8U UkRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=ZlQfCsrJq4nqGiGSGJoqdYiGzQG1JqFCkFWZgjViQrU=; b=t1a7zOK9iGfTXa33lRWa8WMhI7OHCAbU4j2nbp0UPNPHx5oNsuhAxnehKpv1D0TD4S +J1CHcDd0AHdIdqJA7icf8N8UTEZhWsYmzHJV9uXU6ww/I/EmyGfh7hojrggpU5X0/d2 Wgym/7nFdK45oU7XlcwveKmOvXuMpSztVnRhgmhPNxMul9yX/+GrfsDQoMRvMECXMm2D vIZAr5B3Oydgn29fG6Rw297SrK6mTwM/e0R7FgMEVL6nJMlGueChleuJky+R46EuaXXA 07lj6dX+cPipV1qUgCreqzx0tfpDViKFDPdXf1XS9fhnqZq2Xb4+UYcp7B3gphVS+R3D rdnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Eb2gingk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a170902db0e00b0018bde2250f9si2478082plx.212.2022.12.14.00.16.43; Wed, 14 Dec 2022 00:16:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Eb2gingk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237450AbiLNIPd (ORCPT + 99 others); Wed, 14 Dec 2022 03:15:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237531AbiLNIPL (ORCPT ); Wed, 14 Dec 2022 03:15:11 -0500 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84AE2E27 for ; Wed, 14 Dec 2022 00:15:10 -0800 (PST) Received: by mail-pl1-x64a.google.com with SMTP id u6-20020a170903124600b00188cd4769bcso2074732plh.0 for ; Wed, 14 Dec 2022 00:15:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=ZlQfCsrJq4nqGiGSGJoqdYiGzQG1JqFCkFWZgjViQrU=; b=Eb2gingklSMl9cha53wgAH0IBEyXBUinCjy4bH0XwYS066GkCfGG4lKjHYkRDEVxgG otK7YVOfig0248wrC/C+nDjvzfrUmK93mXrmV+fmvFaroL0YakK6RRLkrDqRJsq91zNp 6+yjdPqikrw9AROQwNWnxq6HDdzE3BRNhezCVqDaTsVn6LX99Ys+UdNtT/Wxnfl7D8al wv5/nASL4w8NX6r5ocvmt+CNqV3zGK3sskAToMPvI7Xnj52rQayO2Y/27A83V+SSPZoN h49USi8WYVWojrlD4hJHoPcdbgSpP3nbipnL2QHeIlQkJ9B+CMzhxKFNeSCR4cT/yhk3 433g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZlQfCsrJq4nqGiGSGJoqdYiGzQG1JqFCkFWZgjViQrU=; b=euEJ7xdi9/+TNHoaXvB1f612mRL2C+7ywONb2uaO9kaZ5tlWiRe4lhtc+I3ruPyxzl GlFUridI4NfZaQy8gmiO8BTFWpo/kBlgiKW9RBIWIkSO1FFGsDTraGMCp4O6ENcF3QuG sSgt6cPls7tlKABoMXAiJza3Q3WQ90PwutenKKSatKvK1v3dB2qmmp6ikwNTfEll0oTb lZD+26knUUB1yENojjRU4u/bZkDqFJa9Uzx9q3uOPGWMDYnGU86Y150HlTjDK6QKzroh h/esjF1BaWG/94s/JxSju4EX4RNEOoGHICp0w0giJ2dN1TQ0M9J92A8qqM1XMCZQORPq CfqQ== X-Gm-Message-State: ANoB5pka+1NFXqs4hcWZ52lIYrvgVSlAGQIg7lFihRZ7BCeYY3rWu1rE 6Q+hEvR0epB7Ei7j1CzV4dcJE9qPjP1q X-Received: from pumahsu.ntc.corp.google.com ([2401:fa00:fc:202:cb1:cbe3:3a49:1751]) (user=pumahsu job=sendgmr) by 2002:a17:903:3314:b0:189:a208:d13d with SMTP id jk20-20020a170903331400b00189a208d13dmr44522733plb.144.1671005710041; Wed, 14 Dec 2022 00:15:10 -0800 (PST) Date: Wed, 14 Dec 2022 16:14:54 +0800 Message-Id: <20221214081456.714859-1-pumahsu@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.39.0.rc1.256.g54fd8350bd-goog Subject: [PATCH v2 0/2] add hooks for usb suspend and resume From: Puma Hsu To: gregkh@linuxfoundation.org, mka@chromium.org, dianders@chromium.org Cc: albertccwang@google.com, raychi@google.com, howardyen@google.com, leejj@google.com, hch@infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Puma Hsu X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752176594688161427?= X-GMAIL-MSGID: =?utf-8?q?1752176594688161427?= In mobile, a co-processor can be used for USB audio. When the co-processor is working for USB audio, the co-processor is the user/owner of the USB driver, and the ACPU is able to sleep in such condition to improve power consumption. In order to support this, we need to create hooks in suspend and resume functions. We also upload our implementations for reviewing. Puma Hsu (2): usb: core: add hooks for usb suspend and resume usb: core: add implementations for usb suspend/resume hooks drivers/usb/core/driver.c | 36 +++++++++++++ drivers/usb/core/usb-hooks-impl-goog.c | 72 ++++++++++++++++++++++++++ drivers/usb/core/usb.h | 5 ++ 3 files changed, 113 insertions(+) create mode 100644 drivers/usb/core/usb-hooks-impl-goog.c --- Changes in v2: - Remove the wrong input in the Makefile - Change description in commit message