From patchwork Tue Apr 26 09:18:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jung Daehwan X-Patchwork-Id: 12826765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 421BFC433EF for ; Tue, 26 Apr 2022 09:58:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345186AbiDZKBz (ORCPT ); Tue, 26 Apr 2022 06:01:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348171AbiDZKBe (ORCPT ); Tue, 26 Apr 2022 06:01:34 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36F8733E91 for ; Tue, 26 Apr 2022 02:20:28 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20220426092025epoutp039c814c7463fe51918dd88be9f22d6400~pZ8MG1vun3263332633epoutp03G for ; Tue, 26 Apr 2022 09:20:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20220426092025epoutp039c814c7463fe51918dd88be9f22d6400~pZ8MG1vun3263332633epoutp03G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1650964825; bh=gtJAxLOQgrMmX0jWzFakONkF7P6sHoAQWH61J9RzsI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bgu5Bgf4OyBF4N0aJBlcQfpYZiB0YEXsu9hVZwunyIvZc0i+E3Zx/r1RqK5VmoMNa jeVIqiLrRGJftWceNMStCc1Yk6zkTsl8eizQe2f2U/KVvvtpcfKf/u3egblj0jM8Ak HLtsUM+BttcvHf/i2QCSjd1vFpCuDthllX8Qx5mU= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20220426092025epcas2p3d14f3e24838f8a8d88c8bf0acfe656df~pZ8Lg1Q3S0586405864epcas2p3D; Tue, 26 Apr 2022 09:20:25 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.89]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4KnbvW100Sz4x9Q1; Tue, 26 Apr 2022 09:20:23 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id B7.27.10028.659B7626; Tue, 26 Apr 2022 18:20:23 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20220426092022epcas2p2c016c83b21e41c7bcd4bdfbb95e464c0~pZ8JPwIwa1542715427epcas2p2g; Tue, 26 Apr 2022 09:20:22 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220426092022epsmtrp2b8129b54ca939ed0c966fdb4b2b8809f~pZ8JOcLlR1198711987epsmtrp2E; Tue, 26 Apr 2022 09:20:22 +0000 (GMT) X-AuditID: b6c32a47-589ff7000000272c-61-6267b956c9f2 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 3A.63.08853.659B7626; Tue, 26 Apr 2022 18:20:22 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220426092022epsmtip2bc7ea80debbb111994c4354b8e3a6851~pZ8JFUHWS2696726967epsmtip2A; Tue, 26 Apr 2022 09:20:22 +0000 (GMT) From: Daehwan Jung To: Mathias Nyman , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org (open list:USB XHCI DRIVER), linux-kernel@vger.kernel.org (open list), Howard Yen , Jack Pham , Puma Hsu , "J . Avila" , Daehwan Jung , sc.suh@samsung.com, Krzysztof Kozlowski Subject: [PATCH v4 4/5] usb: host: add some to xhci overrides for xhci-exynos Date: Tue, 26 Apr 2022 18:18:47 +0900 Message-Id: <1650964728-175347-5-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1650964728-175347-1-git-send-email-dh10.jung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBKsWRmVeSWpSXmKPExsWy7bCmmW74zvQkg4O7mCzuLJjGZPHkyCJ2 i+bF69ksrv95z2jR/vwCm8XGtz+YLC7vmsNmsWhZK7NF86YprBYz1ypbdN29wejA7TGroZfN 43JfL5PHgk2lHov3vGTy2D93DbtH35ZVjB6fN8kFsEdl22SkJqakFimk5iXnp2TmpdsqeQfH O8ebmhkY6hpaWpgrKeQl5qbaKrn4BOi6ZeYAnaikUJaYUwoUCkgsLlbSt7Mpyi8tSVXIyC8u sVVKLUjJKTAv0CtOzC0uzUvXy0stsTI0MDAyBSpMyM54/qKVveCuYMXxObtYGxj/83UxcnJI CJhI7Dt4hbmLkYtDSGAHo8Tlgx8YIZxPjBLzH/6Hcr4xSvxf1coO03L3xFsWiMReRonZn16y Qzg/GCWOLjwN1MLBwSagJfF9ISNIg4hAnMTSzktMIDXMAk+YJHa8u8UEkhAW8Jf42DeLFaSe RUBV4ttKW5Awr4CbxIwZj9gglslJ3DzXyQxicwq4S7zoWQS2S0LgK7vEtv9zoC5ykWh6uJ4J whaWeHV8C1RcSuLzu71Qg4oldn1qZYJobmCUaHxwghkiYSwx61k72NHMApoS63fpg5gSAsoS R26xgFQwC/BJdBz+yw4R5pXoaBOCaFSWmH55AiuELSlx8PU5qIEeEge/T4IG3CxGifYJF1gn MMrNQli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b0pi ZVVqUX58UWlOavEhRmkOFiVx3gtdJ+OFBNITS1KzU1MLUotgskwcnFINTFHv25MMz6+4M11f Iv47U3f2KblPwo3uL+d29RlZ2ib0nznVtHC7+k/e8G0pHy6bHuaqUBa2MHjGeahCzk2UO/bS qwIt/6PscpNKul8yKZ/cFyx97tD8bZwxhu0rlyx/qPKJ9yWbzjX5x8fLftt8Vb+ZJhj0TG3v Sa6TRvxMjw5P37J1JuOCeu7eu1+L/9bpTPnTsvjtD79NlzhfTV8scOrc4s2bLfYxyxz68Mwk 6K//pbmT2w+65AsVJhqv6Zrd1cNhkL4s74tixFmui1YvT3080v7liMOPl9lCoaxusfYCge+Z V6xtsEm6mBW0Osdk15uyOxabAs7rZWVuEM8OW+nfPSuZ5ewZv+DfZzfMKlZiKc5INNRiLipO BADwruL+wwIAAA== X-CMS-MailID: 20220426092022epcas2p2c016c83b21e41c7bcd4bdfbb95e464c0 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220426092022epcas2p2c016c83b21e41c7bcd4bdfbb95e464c0 References: <1650964728-175347-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Co-processor needs some information about connected usb device. It's proper to pass information after usb device gets address when getting "Set Address" command. It supports vendors to implement it using xhci overrides. There're several power scenarios depending on vendors. It gives vendors flexibilty to meet their power requirement. They can override suspend and resume of root hub. Signed-off-by: Daehwan Jung --- drivers/usb/host/xhci.c | 6 ++++++ drivers/usb/host/xhci.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 5ccf1bbe8732..8b3df1302650 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -5555,6 +5555,12 @@ void xhci_init_driver(struct hc_driver *drv, drv->check_bandwidth = over->check_bandwidth; if (over->reset_bandwidth) drv->reset_bandwidth = over->reset_bandwidth; + if (over->address_device) + drv->address_device = over->address_device; + if (over->bus_suspend) + drv->bus_suspend = over->bus_suspend; + if (over->bus_resume) + drv->bus_resume = over->bus_resume; } } EXPORT_SYMBOL_GPL(xhci_init_driver); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 3a414a2f41f0..5bc621e77762 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1947,6 +1947,9 @@ struct xhci_driver_overrides { struct usb_host_endpoint *ep); int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); + int (*address_device)(struct usb_hcd *hcd, struct usb_device *udev); + int (*bus_suspend)(struct usb_hcd *hcd); + int (*bus_resume)(struct usb_hcd *hcd); }; #define XHCI_CFC_DELAY 10 @@ -2103,6 +2106,7 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep); int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); +int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev); int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id); int xhci_ext_cap_init(struct xhci_hcd *xhci);