From patchwork Tue Oct 31 13:11:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 117623 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3897792qgn; Tue, 31 Oct 2017 06:11:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q2rXFlSBFdQ24K+XC7MKQkiTjJ0P5R7Tke8qetoi1UEhZRQIj73kQt+BhIX7igkTquolXk X-Received: by 10.159.229.130 with SMTP id az2mr1874289plb.113.1509455510311; Tue, 31 Oct 2017 06:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509455510; cv=none; d=google.com; s=arc-20160816; b=F56hgCKbkQce+GGHU0X5qMvC0517YGQB5FbE14gybwesmhpLkLEB7NDkWphuvAUZiy lE5Zi5hwpttwcYh0wQcMogJDZ3ATyYo3K66sqbVVF4XLNyPLapqSm0mnZzezYh3UaiZh xxJTaC8LxqpgfGtGh7m3oP5eb2WtY380ijXSTiyu+0SnyG6zAxGxSleFHLVRbC2GpHvq xAaW/hgeaCglxDxysfAV9tcJuTSmBe7QieWbKfEdZblq3SnrmWUtb8UlkxWlv/i+p3S2 DG868eEPvLQ/tbtzvKQAMt3Twi1r24gRgp8qjKf1ARKFdyq0cwzzhb9K3KZkz2h1bUqj 2eBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Z5CQQlFj/TdJtu8QF1l51oqyXb9HK/eQ6AF2q2XSZv8=; b=wvFYquMCO6jWk33snJMu2Kq00dbJf5o48mUyLzJKyBdo4jA3WWnyc6Jxe/2wb4k9EK Hiz27yTy2isW9+DTKiL/61LwNkxqwsEdRHER1BFcwR6to0nEUuiPckHwbqnZLbt7TXKr HcYtskiQHIZcB22wiK5rnYtX0A1ARgQ3/DeQSVQjawvELg9aiSU3zN7QV6B2zaFXGoSE MIqQdnVm+765T3Ck2E1wJL8DhL27A52DLf6qdtnJJhx/OnxOM3NZ3EWN7P6rmWbqrUbl kIJkh4RqbpsNW4CrHEjaMlClF9ENY575r76rBJ5U8Q+oa7OhqX9PwGqgKEgIAFVTMe48 UlNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wvk23DLW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a27si1664763pfe.519.2017.10.31.06.11.49; Tue, 31 Oct 2017 06:11:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wvk23DLW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753354AbdJaNLq (ORCPT + 27 others); Tue, 31 Oct 2017 09:11:46 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:47114 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753087AbdJaNLl (ORCPT ); Tue, 31 Oct 2017 09:11:41 -0400 Received: by mail-io0-f196.google.com with SMTP id h70so34908607ioi.4 for ; Tue, 31 Oct 2017 06:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z5CQQlFj/TdJtu8QF1l51oqyXb9HK/eQ6AF2q2XSZv8=; b=Wvk23DLWwFKnSRQZ085DqSOUhny1hYzEOxkvpoMO/zFIBHOFoKU13DAn8w1Z+z+aM4 vKk8ODoj9qLxm/YtOWALXIFDdWcHM2yeSYFrZAP+ZXOLX4Ez0yZBW14YpAv1N7cmwfbh RZMUkwF4WPedQDdQ1zkS5crusz7TLYeSxep1M= 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=Z5CQQlFj/TdJtu8QF1l51oqyXb9HK/eQ6AF2q2XSZv8=; b=ecdCFvwTcWXm6eh5Po+8WfXGiMsqfjyLfLJxWxF8PS8sO0+lqQnIXKhcMQ7QgnpKnm HsyYGalj1AW6Kpaln1FasoqxN9SDe2mPBndzeKNeKeNcDMnrz8hLPaiHzIK3YXZgQdGB LUv0KYle0aOKeBTCHkpTQw40In1CVY7FYMXII2jiseD/xA4QtMN+I685Klieu3jR6Jt9 WTa/RxQAiw1lDcN3CGQNgNQD4B0n3glpnAM0n6SlCnLiFh9SShvJqzeE+nN4NtxfxwIv 8qE6t6hmppx9qkMDJ0NaoTdrMuUt5h19BQ/kryOEZcPo2ahoWnpFuCqYp6Vuj6sepdR4 IKwQ== X-Gm-Message-State: AMCzsaUW+3e/xhaYapzjMMxHeqlY9njcg+P/fVAf6niFre5E+PoNYPlt LZrB9scPxM3Ly1f3rjnZWm66iw== X-Received: by 10.36.112.143 with SMTP id f137mr2952029itc.84.1509455500233; Tue, 31 Oct 2017 06:11:40 -0700 (PDT) Received: from localhost.localdomain (c-24-245-18-91.hsd1.mn.comcast.net. [24.245.18.91]) by smtp.gmail.com with ESMTPSA id w8sm647514iod.26.2017.10.31.06.11.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 06:11:39 -0700 (PDT) From: Alex Elder To: gregkh@linuxfoundation.org, stern@rowland.harvard.edu, balbi@kernel.org Cc: manjunath.goudar@linaro.org, bjorn.andersson@linaro.org, Linyu.Yuan@alcatel-sbell.com.cn, andy.gross@linaro.org, tony@atomide.com, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] usb: host: remove ehci-msm.c Date: Tue, 31 Oct 2017 08:11:29 -0500 Message-Id: <20171031131131.8099-2-elder@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171031131131.8099-1-elder@linaro.org> References: <20171031131131.8099-1-elder@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No Qualcomm SoC requires the "ehci-msm.c" code any more. So remove it. Suggested-by: Stephen Boyd Signed-off-by: Alex Elder Acked-by: Bjorn Andersson Acked-by: Andy Gross --- drivers/usb/host/Kconfig | 12 -- drivers/usb/host/Makefile | 1 - drivers/usb/host/ehci-msm.c | 265 -------------------------------------------- 3 files changed, 278 deletions(-) delete mode 100644 drivers/usb/host/ehci-msm.c -- 2.11.0 diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index fa5692dec832..f03b8041a9b1 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -222,18 +222,6 @@ config USB_EHCI_HCD_AT91 Enables support for the on-chip EHCI controller on Atmel chips. -config USB_EHCI_MSM - tristate "Support for Qualcomm QSD/MSM on-chip EHCI USB controller" - depends on ARCH_QCOM - select USB_EHCI_ROOT_HUB_TT - ---help--- - Enables support for the USB Host controller present on the - Qualcomm chipsets. Root Hub has inbuilt TT. - This driver depends on OTG driver for PHY initialization, - clock management, powering up VBUS, and power management. - This driver is not supported on boards like trout which - has an external PHY. - config USB_EHCI_TEGRA tristate "NVIDIA Tegra HCD support" depends on ARCH_TEGRA diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index cf2691fffcc0..1645c549bdb1 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -39,7 +39,6 @@ obj-$(CONFIG_USB_EHCI_HCD_SPEAR) += ehci-spear.o obj-$(CONFIG_USB_EHCI_HCD_STI) += ehci-st.o obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o -obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o obj-$(CONFIG_USB_W90X900_EHCI) += ehci-w90x900.o diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c deleted file mode 100644 index 2f8d3af811ce..000000000000 --- a/drivers/usb/host/ehci-msm.c +++ /dev/null @@ -1,265 +0,0 @@ -/* ehci-msm.c - HSUSB Host Controller Driver Implementation - * - * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved. - * - * Partly derived from ehci-fsl.c and ehci-hcd.c - * Copyright (c) 2000-2004 by David Brownell - * Copyright (c) 2005 MontaVista Software - * - * All source code in this file is licensed under the following license except - * where indicated. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * See the GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program; if not, you can find it at http://www.fsf.org - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ehci.h" - -#define MSM_USB_BASE (hcd->regs) - -#define DRIVER_DESC "Qualcomm On-Chip EHCI Host Controller" - -static const char hcd_name[] = "ehci-msm"; -static struct hc_driver __read_mostly msm_hc_driver; - -static int ehci_msm_reset(struct usb_hcd *hcd) -{ - struct ehci_hcd *ehci = hcd_to_ehci(hcd); - int retval; - - ehci->caps = USB_CAPLENGTH; - hcd->has_tt = 1; - - retval = ehci_setup(hcd); - if (retval) - return retval; - - /* select ULPI phy and clear other status/control bits in PORTSC */ - writel(PORTSC_PTS_ULPI, USB_PORTSC); - /* bursts of unspecified length. */ - writel(0, USB_AHBBURST); - /* Use the AHB transactor, allow posted data writes */ - writel(0x8, USB_AHBMODE); - /* Disable streaming mode and select host mode */ - writel(0x13, USB_USBMODE); - /* Disable ULPI_TX_PKT_EN_CLR_FIX which is valid only for HSIC */ - writel(readl(USB_GENCONFIG_2) & ~ULPI_TX_PKT_EN_CLR_FIX, USB_GENCONFIG_2); - - return 0; -} - -static int ehci_msm_probe(struct platform_device *pdev) -{ - struct usb_hcd *hcd; - struct resource *res; - struct usb_phy *phy; - int ret; - - dev_dbg(&pdev->dev, "ehci_msm proble\n"); - - hcd = usb_create_hcd(&msm_hc_driver, &pdev->dev, dev_name(&pdev->dev)); - if (!hcd) { - dev_err(&pdev->dev, "Unable to create HCD\n"); - return -ENOMEM; - } - - ret = platform_get_irq(pdev, 0); - if (ret < 0) { - dev_err(&pdev->dev, "Unable to get IRQ resource\n"); - goto put_hcd; - } - hcd->irq = ret; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "Unable to get memory resource\n"); - ret = -ENODEV; - goto put_hcd; - } - - hcd->rsrc_start = res->start; - hcd->rsrc_len = resource_size(res); - hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len); - if (!hcd->regs) { - dev_err(&pdev->dev, "ioremap failed\n"); - ret = -ENOMEM; - goto put_hcd; - } - - /* - * If there is an OTG driver, let it take care of PHY initialization, - * clock management, powering up VBUS, mapping of registers address - * space and power management. - */ - if (pdev->dev.of_node) - phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0); - else - phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); - - if (IS_ERR(phy)) { - if (PTR_ERR(phy) == -EPROBE_DEFER) { - dev_err(&pdev->dev, "unable to find transceiver\n"); - ret = -EPROBE_DEFER; - goto put_hcd; - } - phy = NULL; - } - - hcd->usb_phy = phy; - device_init_wakeup(&pdev->dev, 1); - - if (phy && phy->otg) { - /* - * MSM OTG driver takes care of adding the HCD and - * placing hardware into low power mode via runtime PM. - */ - ret = otg_set_host(phy->otg, &hcd->self); - if (ret < 0) { - dev_err(&pdev->dev, "unable to register with transceiver\n"); - goto put_hcd; - } - - pm_runtime_no_callbacks(&pdev->dev); - pm_runtime_enable(&pdev->dev); - } else { - ret = usb_add_hcd(hcd, hcd->irq, IRQF_SHARED); - if (ret) - goto put_hcd; - } - - return 0; - -put_hcd: - usb_put_hcd(hcd); - - return ret; -} - -static int ehci_msm_remove(struct platform_device *pdev) -{ - struct usb_hcd *hcd = platform_get_drvdata(pdev); - - device_init_wakeup(&pdev->dev, 0); - pm_runtime_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); - - if (hcd->usb_phy && hcd->usb_phy->otg) - otg_set_host(hcd->usb_phy->otg, NULL); - else - usb_remove_hcd(hcd); - - usb_put_hcd(hcd); - - return 0; -} - -#ifdef CONFIG_PM -static int ehci_msm_pm_suspend(struct device *dev) -{ - struct usb_hcd *hcd = dev_get_drvdata(dev); - struct ehci_hcd *ehci = hcd_to_ehci(hcd); - bool do_wakeup = device_may_wakeup(dev); - - dev_dbg(dev, "ehci-msm PM suspend\n"); - - /* Only call ehci_suspend if ehci_setup has been done */ - if (ehci->sbrn) - return ehci_suspend(hcd, do_wakeup); - - return 0; -} - -static int ehci_msm_pm_resume(struct device *dev) -{ - struct usb_hcd *hcd = dev_get_drvdata(dev); - struct ehci_hcd *ehci = hcd_to_ehci(hcd); - - dev_dbg(dev, "ehci-msm PM resume\n"); - - /* Only call ehci_resume if ehci_setup has been done */ - if (ehci->sbrn) - ehci_resume(hcd, false); - - return 0; -} - -#else -#define ehci_msm_pm_suspend NULL -#define ehci_msm_pm_resume NULL -#endif - -static const struct dev_pm_ops ehci_msm_dev_pm_ops = { - .suspend = ehci_msm_pm_suspend, - .resume = ehci_msm_pm_resume, -}; - -static const struct acpi_device_id msm_ehci_acpi_ids[] = { - { "QCOM8040", 0 }, - { } -}; -MODULE_DEVICE_TABLE(acpi, msm_ehci_acpi_ids); - -static const struct of_device_id msm_ehci_dt_match[] = { - { .compatible = "qcom,ehci-host", }, - {} -}; -MODULE_DEVICE_TABLE(of, msm_ehci_dt_match); - -static struct platform_driver ehci_msm_driver = { - .probe = ehci_msm_probe, - .remove = ehci_msm_remove, - .shutdown = usb_hcd_platform_shutdown, - .driver = { - .name = "msm_hsusb_host", - .pm = &ehci_msm_dev_pm_ops, - .of_match_table = msm_ehci_dt_match, - .acpi_match_table = ACPI_PTR(msm_ehci_acpi_ids), - }, -}; - -static const struct ehci_driver_overrides msm_overrides __initconst = { - .reset = ehci_msm_reset, -}; - -static int __init ehci_msm_init(void) -{ - if (usb_disabled()) - return -ENODEV; - - pr_info("%s: " DRIVER_DESC "\n", hcd_name); - ehci_init_driver(&msm_hc_driver, &msm_overrides); - return platform_driver_register(&ehci_msm_driver); -} -module_init(ehci_msm_init); - -static void __exit ehci_msm_cleanup(void) -{ - platform_driver_unregister(&ehci_msm_driver); -} -module_exit(ehci_msm_cleanup); - -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_ALIAS("platform:msm-ehci"); -MODULE_LICENSE("GPL");