From patchwork Mon Aug 10 07:37:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Duc Dang X-Patchwork-Id: 6980331 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E77D9F373 for ; Mon, 10 Aug 2015 07:41:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1970220739 for ; Mon, 10 Aug 2015 07:41:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 297CA20727 for ; Mon, 10 Aug 2015 07:41:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOhf3-0004eu-KE; Mon, 10 Aug 2015 07:38:21 +0000 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOhex-0004aJ-Qz for linux-arm-kernel@lists.infradead.org; Mon, 10 Aug 2015 07:38:18 +0000 Received: by pabyb7 with SMTP id yb7so100784442pab.0 for ; Mon, 10 Aug 2015 00:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Y8u1YVuqHXjJVNgV27Mavh2RcQNxipqDBnH1nspcJ9g=; b=bznG/qh2BvBjC8S1NtXB5Ftm7V1XzAnIUn8cEDZqPgNQmGXVbw4VmjIiArAphaSn7k cIY63vR6k0JiebxMKFmH3cGd3H8OPZfY3sPew8v5uzdsnbd3emH+bPA09aD+bc+JYX4x leCiXEpqxOVUrg+CiDyNEjmcvIMYinTgAu5pE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Y8u1YVuqHXjJVNgV27Mavh2RcQNxipqDBnH1nspcJ9g=; b=Xg02LVPpgzOqBVC9wDr5mQQqfgmLGeG5llmBzMQ2i3lxgSLGZCRX0eXHEcBdDPdydx w362LgDS3R+jWGaOFWqD0NijpsRoV3Gs2pgCPcBiwvaoU3TWMKYLLJDlCbaQR1S/xDVK KrZp51oH0uMKJBeYhOI83U2tWkYnC2VGQk2FBF/hWURZLQMsW/w22vINn9W0ShP6XoFC vjCzlaTxM0GZyd3pmiePXo46RPmH0Lq8I4bnH7mYC/lHr2ZnhaQKbi/egsDyaISlEm39 3wDcIDeyku1RB655V4iS/KiVgExwLava3ySINOwUDas1z4hbVzqX4d6vh/s6B22Iiq5d s08A== X-Gm-Message-State: ALoCoQnxPnlw+Y0K/SqTGZCqCRd0YBETCLWBK499IUBTlgcL1T2ZgOp/3YFfXar5TuOYQwkDvBd0 X-Received: by 10.68.115.143 with SMTP id jo15mr41412864pbb.142.1439192275031; Mon, 10 Aug 2015 00:37:55 -0700 (PDT) Received: from dhdang-Precision-WorkStation-T3400.amcc.com (70-35-53-82.static.wiline.com. [70.35.53.82]) by smtp.gmail.com with ESMTPSA id pu4sm18769089pdb.86.2015.08.10.00.37.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Aug 2015 00:37:54 -0700 (PDT) From: Duc Dang To: Greg KH , Russell King - ARM Linux , Loc Ho Subject: [PATCH v6 2/2] usb: Add support for ACPI identification to xhci-platform Date: Mon, 10 Aug 2015 00:37:22 -0700 Message-Id: <466084f08a22e7af257f5ed3c7757938c76bf5cd.1439190829.git.dhdang@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: <20150808092252.GJ7557@n2100.arm.linux.org.uk> References: <20150808092252.GJ7557@n2100.arm.linux.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150810_003816_085315_D98C96ED X-CRM114-Status: GOOD ( 18.16 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Feng Kan , Mark Langsdorf , Arnd Bergmann , mathias.nyman@intel.com, Duc Dang , USB list , patches , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Provide the methods to let ACPI identify the need to use xhci-platform. Change the Kconfig files so the xhci-plat.o file is selectable during kernel config. This has been tested on an ARM64 machine with platform XHCI, an x86_64 machine with XHCI, and an x86_64 machine without XHCI. There were no regressions or error messages on the machines without platform XHCI. [dhdang: regenerate the patch over 4.2-rc5 and address new comments] Signed-off-by: Mark Langsdorf Signed-off-by: Duc Dang --- Change from v5: Change comment to "XHCI-compliant USB Controller" as "PNP0D10" ID is not X-Gene specific Changes from v4: Remove #ifdef CONFIG_ACPI Changes from v3: Regenerate the patch over 4.2-rc5 No code change Changes from v2 Replaced tristate with a boolean as the driver doesn't compile as a module Correct --help-- to ---help--- Changes from v1 Renamed from "add support for APM X-Gene to xhci-platform" Removed changes to arm64/Kconfig Made CONFIG_USB_XHCI_PLATFORM a user selectable config option drivers/usb/host/Kconfig | 7 ++++++- drivers/usb/host/xhci-plat.c | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 8afc3c1..96231ee 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -32,7 +32,12 @@ config USB_XHCI_PCI default y config USB_XHCI_PLATFORM - tristate + tristate "xHCI platform driver support" + ---help--- + Say 'Y' to enable the support for the xHCI host controller + as a platform device. Many ARM SoCs provide USB this way. + + If unsure, say 'Y'. config USB_XHCI_MVEBU tristate "xHCI support for Marvell Armada 375/38x" diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 5d1b84b..7ec2d31 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "xhci.h" #include "xhci-mvebu.h" @@ -266,6 +267,13 @@ static const struct of_device_id usb_xhci_of_match[] = { MODULE_DEVICE_TABLE(of, usb_xhci_of_match); #endif +static const struct acpi_device_id usb_xhci_acpi_match[] = { + /* XHCI-compliant USB Controller */ + { "PNP0D10", }, + { } +}; +MODULE_DEVICE_TABLE(acpi, usb_xhci_acpi_match); + static struct platform_driver usb_xhci_driver = { .probe = xhci_plat_probe, .remove = xhci_plat_remove, @@ -273,6 +281,7 @@ static struct platform_driver usb_xhci_driver = { .name = "xhci-hcd", .pm = DEV_PM_OPS, .of_match_table = of_match_ptr(usb_xhci_of_match), + .acpi_match_table = ACPI_PTR(usb_xhci_acpi_match), }, }; MODULE_ALIAS("platform:xhci-hcd");