Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756171AbdIHPrj (ORCPT ); Fri, 8 Sep 2017 11:47:39 -0400 Received: from mail-he1eur01on0130.outbound.protection.outlook.com ([104.47.0.130]:18336 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755884AbdIHPre (ORCPT ); Fri, 8 Sep 2017 11:47:34 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [PATCH v2 04/11] usb: xhci: Add Intel cherrytrail extended cap / otg phy mux handling To: Hans de Goede , MyungJoo Ham , Chanwoo Choi , Guenter Roeck , Heikki Krogerus , Darren Hart , Andy Shevchenko , Mathias Nyman Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, devel@driverdev.osuosl.org, Kuppuswamy Sathyanarayanan , Sathyanarayanan Kuppuswamy Natarajan , Greg Kroah-Hartman , linux-usb@vger.kernel.org References: <20170905164221.11266-1-hdegoede@redhat.com> <20170905164221.11266-5-hdegoede@redhat.com> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: <354fbada-a1d7-5542-26a0-a10034f35d6a@axentia.se> Date: Fri, 8 Sep 2017 17:47:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170905164221.11266-5-hdegoede@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [81.224.168.30] X-ClientProxiedBy: HE1PR06CA0133.eurprd06.prod.outlook.com (2603:10a6:7:16::20) To VI1PR0202MB2560.eurprd02.prod.outlook.com (2603:10a6:801:6::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 54c60fc4-dec7-48f4-4e63-08d4f6d0e9af X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(2017082002075)(300000503095)(300135400095)(201703131423075)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:VI1PR0202MB2560; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0202MB2560;3:3ipe7xhslaD6Sy/ULJZXCKExXBBUz+l2tDN0HT4MJwxLe99BoqdQ4ZYDGay25bq+GQIbt9nNR6kc7UlS6+QXn9LbRJN75bfJXupr1Cp2ZhUU01Hkc020TDNivMbg9hh4Hu81En7keEDc+u6gGOnepqHXAmg8fPJRd2W++zAusr7k868J3O+Y0vrcl0ME9ZER2SQxH8Voq5fZy5bejt70xY4slREDYzx5Vrpdyr739GDkDMnlr0auj28JeRivpBlW;25:4qiRKICZksRYrbw7XDfYOD1yiszeXeh34GSHrPhl5yGrNZ6+FEKuyRB0JtNI2njurHBg2u4BGGY8RKWV5WVFMrjjf5n3s2xUJJvUlcwIruOTAd3WLxyrQ0tVKsFDoIF9j7Woqx0jhqXeVSXBROnLtlB0UPDweT7tDN/G1IN90G+xYBFNAgV3fE/11TgK5946KREjenO29ctQZ0EbmQZEkKW/B0vmnr9DEJZUWyDqdeo7nkawHoQeEOgiBgvk/NxpxIeyRpGUQjXt6I4V7YoxcJXnDR5V4I6JlergdKOSCHqfd+INVrAl85QV9gfBLhHcX1WRpO28KnVaYBJN2q777g==;31:/BOAHPHlTNatEILn1s0fczXi9uOfonzu0O+97oFXH29rMC4D1sgJZNozcf2he5b2jyrv6f78CsIgf8iweO+0PmCA7MV161QlO/TYtOr7TAqzMpEo6TxboByNcBbaMkyj2aZttShN+3NXDiCuEpUir7/qJqyXNv7Q9LiIQnPC33CISvupCivb04whSpvY4olvFOlv9ixb0aGrJdHq42rfMbMSHhGu/TSNkv3MOfiF8LA= X-MS-TrafficTypeDiagnostic: VI1PR0202MB2560: X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6041248)(20161123562025)(20161123558100)(20161123555025)(201703131423075)(201703061421075)(20161123564025)(20161123560025)(2016111802025)(6072148)(6042181)(6043046)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR0202MB2560;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR0202MB2560; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0202MB2560;4:pW1LcdzJR402g/qVf12z98X14U7MG+E6U7XTH1+OU/NPbCgsB3ZnIK2Rx4Xhzj2mNTQ2hN2HcKbWwMR3OilRSt+cFTH9Vn4yCx5IaYT7qMb/Js6Reyfan2G++bnAG7e0ahsu80lwjTYpJddJMIg8Bi6VDKFVKq5hkQRf1rMEaLHgSZxOEj1e/NERV1C1PFbnMeJzJHgKm6RJf0dqDR4nBdFA/5V21LPgJ1xxvmul/aY432hldVmHQNIgpnFUtz8a X-Forefront-PRVS: 04244E0DC5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(7370300001)(6049001)(6009001)(24454002)(199003)(189002)(377424004)(68736007)(2950100002)(54906002)(65826007)(36756003)(33646002)(105586002)(53936002)(106356001)(7736002)(4326008)(83506001)(64126003)(86362001)(7416002)(25786009)(53546010)(117156002)(50466002)(97736004)(6666003)(4001350100001)(5660300001)(305945005)(6116002)(3846002)(101416001)(81166006)(81156014)(31696002)(8676002)(65956001)(65806001)(23676002)(3260700006)(230700001)(6246003)(66066001)(42186005)(31686004)(6486002)(76176999)(54356999)(189998001)(77096006)(50986999)(2906002)(508600001)(229853002)(7350300001)(47776003)(74482002)(42262002);DIR:OUT;SFP:1102;SCL:1;S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ltv7TK9O3X9+3Mn70vY3Y/GXK314AZb4RhNxHyGfPvcYABu2ES5chNF/tU2a7ITQjBISXkaAc5hB3Y8x52x91zE7vNsAHIVwJMgsW/RvBFZ3mLaS/6A0U0zy1iqgzcWfAWFw//PxUxnNeKtsiOquTZST3E07mLWAIy6pVqFbI7VSV0Smlvy8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 15:47:28.1543 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0202MB2560 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2223 Lines: 53 On 2017-09-05 18:42, Hans de Goede wrote: > The Intel cherrytrail xhci controller has an extended cap mmio-range > which contains registers to control the muxing to the xhci (host mode) > or the dwc3 (device mode) and vbus-detection for the otg usb-phy. > > Having a mux driver included in the xhci code (or under drivers/usb/host) > is not desirable. So this commit adds a simple handler for this extended > capability, which creates a platform device with the caps mmio region as > resource, this allows us to write a separate platform mux driver for the > mux. > > Signed-off-by: Hans de Goede > --- > Changes in v2: > -Check xHCI controller PCI device-id instead of only checking for the > Intel Extended capability ID, as the Extended capability ID is used on > other model Intel xHCI controllers too > --- > drivers/usb/host/Makefile | 2 +- > drivers/usb/host/xhci-intel-quirks.c | 85 ++++++++++++++++++++++++++++++++++++ > drivers/usb/host/xhci-pci.c | 4 ++ > drivers/usb/host/xhci.h | 2 + > 4 files changed, 92 insertions(+), 1 deletion(-) > create mode 100644 drivers/usb/host/xhci-intel-quirks.c > > diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile > index cf2691fffcc0..441edf82eb1c 100644 > --- a/drivers/usb/host/Makefile > +++ b/drivers/usb/host/Makefile > @@ -63,7 +63,7 @@ obj-$(CONFIG_USB_OHCI_HCD_DAVINCI) += ohci-da8xx.o > obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o > obj-$(CONFIG_USB_FHCI_HCD) += fhci.o > obj-$(CONFIG_USB_XHCI_HCD) += xhci-hcd.o > -obj-$(CONFIG_USB_XHCI_PCI) += xhci-pci.o > +obj-$(CONFIG_USB_XHCI_PCI) += xhci-pci.o xhci-intel-quirks.o > obj-$(CONFIG_USB_XHCI_PLATFORM) += xhci-plat-hcd.o > obj-$(CONFIG_USB_XHCI_MTK) += xhci-mtk.o > obj-$(CONFIG_USB_XHCI_TEGRA) += xhci-tegra.o > diff --git a/drivers/usb/host/xhci-intel-quirks.c b/drivers/usb/host/xhci-intel-quirks.c > new file mode 100644 > index 000000000000..819f5f9da9ee > --- /dev/null > +++ b/drivers/usb/host/xhci-intel-quirks.c > @@ -0,0 +1,85 @@ > +/* > + * Intel Vendor Defined XHCI extended capability handling > + * > + * Copyright (c) 2016) Hans de Goede 2017? And drop the stray bracket. Cheers, Peter