From patchwork Wed Oct 25 22:01:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 117164 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp71631qgn; Wed, 25 Oct 2017 15:02:17 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SLVKE0ImCJj6XQp8n5+hlWvKk7IOTlADtMwS9GJic0utXWkH3a4XlVO98Cv+73Dd7IaBBZ X-Received: by 10.84.191.131 with SMTP id a3mr2709691pld.253.1508968937164; Wed, 25 Oct 2017 15:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508968937; cv=none; d=google.com; s=arc-20160816; b=sE4Uvazmzyk0jzxl4JPD65kn7Ww+O+te5ZsuIO6TiToOq4MCcXdOm1h+GWIsY6AXUX n/+uAmUvxs2bzx/5oAMUyTf+QPWYlor5+RxYYHVL/Q26XmXF9L79z3sYjZt5edq5s4I4 BCPs/ie4bG2yeAsEWzlz6T70ggxAtLU3zRBFtYc773pzTiWKu+u4/TmFrVRbkuaL3+Su tsk0nDVrAyIXq1Lu8mgYtwy8nrCDQWG5jkfQhBRN3Dz+WTtUwkqesmgx8832eNjrHXm6 52QENe89/McyPy+OIK8Xk0Cnyj0sFNE+BwnSxa7fFBDczyXFU9At4VvnKYz2kBGHFjkP q4AA== 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=N1UZJRK29mQRPVuqfaO5ZLzJp08tb2ZSsfkAhQ/L6DY=; b=jdNBTXLqxgsSSnLGUrRWhC5wezh+ap/OVvgMHdMqe9d+WKhWPY1ScDAgxZXogf0IL0 xc2KcxWA9+vzGigm8S9Fpnod5daIhr8maU6Gq3kHg9+LBrTMnsDkqnn4AJbuZftdctNB vO5oEYUhqr2jTCrTKNLjf2XBXDDUt+8tQ43A5+l7v5FD4qvVysOS5B+eQE0c9eahI+Xw 3+asI4PJGMXx7u33+GPYb1GuFpyrgXddyFSOd98bq2V1zNtQseflF7MPxK8Uw35h7V6/ h4HAuT6qtOwwCZSVkqED3hoycaMAY6vnGTeFmiO1HqGKpSKLZMesXz80xkR/5Zq11K0e Ku9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KKVa6VBI; 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 n9si2063535plp.715.2017.10.25.15.02.16; Wed, 25 Oct 2017 15:02:17 -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=KKVa6VBI; 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 S932325AbdJYWCN (ORCPT + 27 others); Wed, 25 Oct 2017 18:02:13 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:55240 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751984AbdJYWBu (ORCPT ); Wed, 25 Oct 2017 18:01:50 -0400 Received: by mail-pf0-f195.google.com with SMTP id n89so948798pfk.11 for ; Wed, 25 Oct 2017 15:01:50 -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=N1UZJRK29mQRPVuqfaO5ZLzJp08tb2ZSsfkAhQ/L6DY=; b=KKVa6VBI4VtRScGmc8knlx2VTwqmVWzdi6ZfbuTE7rOswerRlaYcYEJEydsvXpEe84 N1vVLk9TOlQLatZxSg+O9aFLh9m9jGGfM2Zo6WD7TntR4dhsVL6wuslcqxxfcJzpsqZq 0L1OArsiw1/kaIfpC3J64Q/JhpKySlfSz/DV0= 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=N1UZJRK29mQRPVuqfaO5ZLzJp08tb2ZSsfkAhQ/L6DY=; b=JFwIw5abWQ5x6eCS85FL0siN4OZ7CrgO0cJKHHfepnNbrD9fRHSC6RBYo9T9jpMR4g +zEgZLi8XOePUVIrSv5Orm5jxBSQhvZxD+2eFWVn8SfsEK4x5LS8+/q7H0hb/U6JPZNC wbRamxy5+RdVcfQYpCFyUAxc8b6UGqMxGSQYDNTQAX0tZWLSIn0FogTcSP4CVrR5+dge znjzUs0zr0SQhEu7qgik6WGAxdbpIg/0a8y4SSBkKSJIwNy44kmW1dd6zOmB2zZEgrwn I3/GH60/VTMWK6/58P+6h2qXUhA4SwZH+7wWdlY7QewSJ/Zt7Q0vo/cagtIC+d3aGMfe M3rQ== X-Gm-Message-State: AMCzsaUUwRg7CZnpa1aZtIR1oWz+gNyt5pqFmoroxsgMgwTkIXkL6IN5 UJDIpgRrayiv2r7+0FTiucilew== X-Received: by 10.84.240.196 with SMTP id l4mr2724713plt.149.1508968909458; Wed, 25 Oct 2017 15:01:49 -0700 (PDT) Received: from localhost.localdomain (181.sub-70-211-7.myvzw.com. [70.211.7.181]) by smtp.gmail.com with ESMTPSA id g207sm6582150pfb.101.2017.10.25.15.01.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 15:01:48 -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-kernel@vger.kernel.org Subject: [PATCH 1/3] usb: host: remove ehci-msm.c Date: Wed, 25 Oct 2017 17:01:37 -0500 Message-Id: <20171025220139.19457-2-elder@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171025220139.19457-1-elder@linaro.org> References: <20171025220139.19457-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/Makefile | 1 - drivers/usb/host/ehci-msm.c | 265 -------------------------------------------- 2 files changed, 266 deletions(-) delete mode 100644 drivers/usb/host/ehci-msm.c -- 2.11.0 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"); From patchwork Wed Oct 25 22:01:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 117163 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp71536qgn; Wed, 25 Oct 2017 15:02:10 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QFeev1OJkFicsTWr6BBbPW/pyzZ9Xy3Oj3b+EPCci4U+vLUvWxrbA8lNDowMAHcJ5nCmI2 X-Received: by 10.84.234.197 with SMTP id i5mr2792845plt.316.1508968930045; Wed, 25 Oct 2017 15:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508968930; cv=none; d=google.com; s=arc-20160816; b=BCmxgFKSySJtZK8NVV6QGfvg/UTRVWd19RI20FE6awPBPWw2ZjroT8yqrpN9vJKBKB Y5NvCeloHGa2sUqQXmRj7txnwIwUH5DmTm1q0oM0SOXxInVscMEFt1tD8VNoqPQxCvx3 l0Z1ozKwqoM+p8mF8BMQQb6stOQLY++m7zZPofCvuTqdmwn/49CBwixPWGrhYJVSmr/J SMErkoLFmJgx86zDVAvgnww0Vw5haf5Z7i2HXPg/w1ee8gc4M358Su0a69hkRg88p3C/ HkWo7UCeuOyaJynT9GP+vag5Rn+lEG5lbsMlCx2q3MuGnDUB3H0gIAGysvd2mgOb3iyt PyPw== 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=TDmq+54JxCFMx/bMqAIHN7FR+BMpX1s0aQw5pnlQhlU=; b=nYy2kBie/HEBfYC1lUGXodNvxcgCbH1JUcPbBo1d7ZTf3ZDDvUEY9FJpPIUsKMTuQX kg78nsY1a1T2NdN/yOHjqnrVNiSMvxhsdLAGvang5IrQk2Vri/vc3VwB2hrp6SOFwQ4K Em2s1e8BCHxpSw/TbNYKyliIfv3vju4G3Dbj/NsOf2eT+N5sk3bXQ9c4ZME1FI7phLcZ KGY2w5Qa0wC1+Q3GHJ0TJ+BhdajI7L+QeF/HMloFNMVtS171Tal6qPjVYne5qwNndFiV VEDkP7pZBwA7NDYoHskeaAfnJLC7L/kGbY+aHf9LYH+6LJrS830fXUZn/zc4WaKceA9D x8KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wa4qli0j; 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 c76si2552216pfe.241.2017.10.25.15.02.09; Wed, 25 Oct 2017 15:02:10 -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=Wa4qli0j; 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 S1752059AbdJYWCI (ORCPT + 27 others); Wed, 25 Oct 2017 18:02:08 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:48601 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752031AbdJYWBz (ORCPT ); Wed, 25 Oct 2017 18:01:55 -0400 Received: by mail-pg0-f67.google.com with SMTP id v78so1039297pgb.5 for ; Wed, 25 Oct 2017 15:01:55 -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=TDmq+54JxCFMx/bMqAIHN7FR+BMpX1s0aQw5pnlQhlU=; b=Wa4qli0jsG0KVUT+MoLFpdKDt8rCDSE+n/due5wTRimY4nyPR9HvPaAbcHTiU9fFh9 6hFm7XK85xC1I1doLCmvooqaHpFzKh+Ug1kEB6318v/DsPS3sU4zLmNSZjL8Hp97ANq0 rdPOTySx6zV3fgKM81vnrKplU7Po7gE9dxsD0= 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=TDmq+54JxCFMx/bMqAIHN7FR+BMpX1s0aQw5pnlQhlU=; b=kUg8oc1osT+GljO76jBvZ+86X/zS/EtSZG66el+ZNmaKc3snYuEd1dbe2EX7hTaPoi tlvG1M0GO0nc0xkaIJRSv2l/t7w+kDyIyA2PaqfBcN8BDuhR+R+CBdvali5BYDQJapU9 IulnbMjGZhphkHrtsqq22gLn/M5snSnwGXPLTEj+qvRqRmmG11F1EVlLmDAOn9MUHJu1 mMbP+My95tJcxMFd72E6twLc+doLwQVg0fZjqXv4IpdSCE8d4MsKb35Itv1dAT49Y2s/ utY117yPfGA8mtxFWsphm4661TAp8ZNK1dKOzcjMf4ekjX24hpHY+WV/es21f6d12Vdz R+WQ== X-Gm-Message-State: AMCzsaXMvGsSOrdMBwwZQIuBIWqI8IfyVvFGUtTE1K/3s82l9/iqV1np uHN2S/vxmlGkFy++3CYJJVo5oQ== X-Received: by 10.98.30.133 with SMTP id e127mr3437310pfe.137.1508968914440; Wed, 25 Oct 2017 15:01:54 -0700 (PDT) Received: from localhost.localdomain (181.sub-70-211-7.myvzw.com. [70.211.7.181]) by smtp.gmail.com with ESMTPSA id g207sm6582150pfb.101.2017.10.25.15.01.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 15:01:53 -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-kernel@vger.kernel.org Subject: [PATCH 3/3] usb: phy: remove phy-qcom-8x16-usb.c Date: Wed, 25 Oct 2017 17:01:39 -0500 Message-Id: <20171025220139.19457-4-elder@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171025220139.19457-1-elder@linaro.org> References: <20171025220139.19457-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 "phy-qcom-8x16-usb.c" USB phy driver support any more, so remove the code. Suggested-by: Stephen Boyd Signed-off-by: Alex Elder Acked-by: Bjorn Andersson Acked-by: Andy Gross --- drivers/usb/phy/Makefile | 1 - drivers/usb/phy/phy-qcom-8x16-usb.c | 366 ------------------------------------ 2 files changed, 367 deletions(-) delete mode 100644 drivers/usb/phy/phy-qcom-8x16-usb.c -- 2.11.0 diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index 61013f38abbe..8beefb7f2777 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -18,7 +18,6 @@ obj-$(CONFIG_TWL6030_USB) += phy-twl6030-usb.o obj-$(CONFIG_USB_EHCI_TEGRA) += phy-tegra-usb.o obj-$(CONFIG_USB_GPIO_VBUS) += phy-gpio-vbus-usb.o obj-$(CONFIG_USB_ISP1301) += phy-isp1301.o -obj-$(CONFIG_USB_QCOM_8X16_PHY) += phy-qcom-8x16-usb.o obj-$(CONFIG_USB_MV_OTG) += phy-mv-usb.o obj-$(CONFIG_USB_MXS_PHY) += phy-mxs-usb.o obj-$(CONFIG_USB_ULPI) += phy-ulpi.o diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c b/drivers/usb/phy/phy-qcom-8x16-usb.c deleted file mode 100644 index 679afeaaa9a8..000000000000 --- a/drivers/usb/phy/phy-qcom-8x16-usb.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2015, Linaro Limited - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only 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. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define HSPHY_AHBBURST 0x0090 -#define HSPHY_AHBMODE 0x0098 -#define HSPHY_GENCONFIG 0x009c -#define HSPHY_GENCONFIG_2 0x00a0 - -#define HSPHY_USBCMD 0x0140 -#define HSPHY_ULPI_VIEWPORT 0x0170 -#define HSPHY_CTRL 0x0240 - -#define HSPHY_TXFIFO_IDLE_FORCE_DIS BIT(4) -#define HSPHY_SESS_VLD_CTRL_EN BIT(7) -#define HSPHY_POR_ASSERT BIT(0) -#define HSPHY_RETEN BIT(1) - -#define HSPHY_SESS_VLD_CTRL BIT(25) - -#define ULPI_PWR_CLK_MNG_REG 0x88 -#define ULPI_PWR_OTG_COMP_DISABLE BIT(0) - -#define ULPI_MISC_A 0x96 -#define ULPI_MISC_A_VBUSVLDEXTSEL BIT(1) -#define ULPI_MISC_A_VBUSVLDEXT BIT(0) - -#define HSPHY_3P3_MIN 3050000 /* uV */ -#define HSPHY_3P3_MAX 3300000 /* uV */ - -#define HSPHY_1P8_MIN 1800000 /* uV */ -#define HSPHY_1P8_MAX 1800000 /* uV */ - -#define HSPHY_VDD_MIN 5 -#define HSPHY_VDD_MAX 7 - -struct phy_8x16 { - struct usb_phy phy; - void __iomem *regs; - struct clk *core_clk; - struct clk *iface_clk; - struct regulator_bulk_data regulator[3]; - - struct reset_control *phy_reset; - - struct gpio_desc *switch_gpio; - struct notifier_block reboot_notify; -}; - -static int phy_8x16_notify_connect(struct usb_phy *phy, - enum usb_device_speed speed) -{ - struct phy_8x16 *qphy = container_of(phy, struct phy_8x16, phy); - u32 val; - - val = ULPI_MISC_A_VBUSVLDEXTSEL | ULPI_MISC_A_VBUSVLDEXT; - usb_phy_io_write(&qphy->phy, val, ULPI_SET(ULPI_MISC_A)); - - val = readl(qphy->regs + HSPHY_USBCMD); - val |= HSPHY_SESS_VLD_CTRL; - writel(val, qphy->regs + HSPHY_USBCMD); - - return 0; -} - -static int phy_8x16_notify_disconnect(struct usb_phy *phy, - enum usb_device_speed speed) -{ - struct phy_8x16 *qphy = container_of(phy, struct phy_8x16, phy); - u32 val; - - val = ULPI_MISC_A_VBUSVLDEXT | ULPI_MISC_A_VBUSVLDEXTSEL; - usb_phy_io_write(&qphy->phy, val, ULPI_CLR(ULPI_MISC_A)); - - val = readl(qphy->regs + HSPHY_USBCMD); - val &= ~HSPHY_SESS_VLD_CTRL; - writel(val, qphy->regs + HSPHY_USBCMD); - - return 0; -} - -static int phy_8x16_vbus_on(struct phy_8x16 *qphy) -{ - phy_8x16_notify_connect(&qphy->phy, USB_SPEED_UNKNOWN); - - /* Switch D+/D- lines to Device connector */ - gpiod_set_value_cansleep(qphy->switch_gpio, 0); - - return 0; -} - -static int phy_8x16_vbus_off(struct phy_8x16 *qphy) -{ - phy_8x16_notify_disconnect(&qphy->phy, USB_SPEED_UNKNOWN); - - /* Switch D+/D- lines to USB HUB */ - gpiod_set_value_cansleep(qphy->switch_gpio, 1); - - return 0; -} - -static int phy_8x16_vbus_notify(struct notifier_block *nb, unsigned long event, - void *ptr) -{ - struct usb_phy *usb_phy = container_of(nb, struct usb_phy, vbus_nb); - struct phy_8x16 *qphy = container_of(usb_phy, struct phy_8x16, phy); - - if (event) - phy_8x16_vbus_on(qphy); - else - phy_8x16_vbus_off(qphy); - - return NOTIFY_DONE; -} - -static int phy_8x16_init(struct usb_phy *phy) -{ - struct phy_8x16 *qphy = container_of(phy, struct phy_8x16, phy); - u32 val, init[] = {0x44, 0x6B, 0x24, 0x13}; - u32 addr = ULPI_EXT_VENDOR_SPECIFIC; - int idx, state; - - for (idx = 0; idx < ARRAY_SIZE(init); idx++) - usb_phy_io_write(phy, init[idx], addr + idx); - - reset_control_reset(qphy->phy_reset); - - /* Assert USB HSPHY_POR */ - val = readl(qphy->regs + HSPHY_CTRL); - val |= HSPHY_POR_ASSERT; - writel(val, qphy->regs + HSPHY_CTRL); - - /* - * wait for minimum 10 microseconds as suggested in HPG. - * Use a slightly larger value since the exact value didn't - * work 100% of the time. - */ - usleep_range(12, 15); - - /* Deassert USB HSPHY_POR */ - val = readl(qphy->regs + HSPHY_CTRL); - val &= ~HSPHY_POR_ASSERT; - writel(val, qphy->regs + HSPHY_CTRL); - - usleep_range(10, 15); - - writel(0x00, qphy->regs + HSPHY_AHBBURST); - writel(0x08, qphy->regs + HSPHY_AHBMODE); - - /* workaround for rx buffer collision issue */ - val = readl(qphy->regs + HSPHY_GENCONFIG); - val &= ~HSPHY_TXFIFO_IDLE_FORCE_DIS; - writel(val, qphy->regs + HSPHY_GENCONFIG); - - val = readl(qphy->regs + HSPHY_GENCONFIG_2); - val |= HSPHY_SESS_VLD_CTRL_EN; - writel(val, qphy->regs + HSPHY_GENCONFIG_2); - - val = ULPI_PWR_OTG_COMP_DISABLE; - usb_phy_io_write(phy, val, ULPI_SET(ULPI_PWR_CLK_MNG_REG)); - - state = extcon_get_state(qphy->phy.edev, EXTCON_USB); - if (state) - phy_8x16_vbus_on(qphy); - else - phy_8x16_vbus_off(qphy); - - val = usb_phy_io_read(&qphy->phy, ULPI_FUNC_CTRL); - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; - val |= ULPI_FUNC_CTRL_OPMODE_NORMAL; - usb_phy_io_write(&qphy->phy, val, ULPI_FUNC_CTRL); - - return 0; -} - -static void phy_8x16_shutdown(struct usb_phy *phy) -{ - u32 val; - - /* Put the controller in non-driving mode */ - val = usb_phy_io_read(phy, ULPI_FUNC_CTRL); - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; - usb_phy_io_write(phy, val, ULPI_FUNC_CTRL); -} - -static int phy_8x16_read_devicetree(struct phy_8x16 *qphy) -{ - struct device *dev = qphy->phy.dev; - int ret; - - qphy->core_clk = devm_clk_get(dev, "core"); - if (IS_ERR(qphy->core_clk)) - return PTR_ERR(qphy->core_clk); - - qphy->iface_clk = devm_clk_get(dev, "iface"); - if (IS_ERR(qphy->iface_clk)) - return PTR_ERR(qphy->iface_clk); - - qphy->regulator[0].supply = "v3p3"; - qphy->regulator[1].supply = "v1p8"; - qphy->regulator[2].supply = "vddcx"; - - ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(qphy->regulator), - qphy->regulator); - if (ret) - return ret; - - qphy->phy_reset = devm_reset_control_get(dev, "phy"); - if (IS_ERR(qphy->phy_reset)) - return PTR_ERR(qphy->phy_reset); - - qphy->switch_gpio = devm_gpiod_get_optional(dev, "switch", - GPIOD_OUT_LOW); - return PTR_ERR_OR_ZERO(qphy->switch_gpio); -} - -static int phy_8x16_reboot_notify(struct notifier_block *this, - unsigned long code, void *unused) -{ - struct phy_8x16 *qphy; - - qphy = container_of(this, struct phy_8x16, reboot_notify); - - /* - * Ensure that D+/D- lines are routed to uB connector, so - * we could load bootloader/kernel at next reboot_notify - */ - gpiod_set_value_cansleep(qphy->switch_gpio, 0); - return NOTIFY_DONE; -} - -static int phy_8x16_probe(struct platform_device *pdev) -{ - struct phy_8x16 *qphy; - struct resource *res; - struct usb_phy *phy; - int ret; - - qphy = devm_kzalloc(&pdev->dev, sizeof(*qphy), GFP_KERNEL); - if (!qphy) - return -ENOMEM; - - platform_set_drvdata(pdev, qphy); - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - qphy->regs = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(qphy->regs)) - return PTR_ERR(qphy->regs); - - phy = &qphy->phy; - phy->dev = &pdev->dev; - phy->label = dev_name(&pdev->dev); - phy->init = phy_8x16_init; - phy->shutdown = phy_8x16_shutdown; - phy->notify_connect = phy_8x16_notify_connect; - phy->notify_disconnect = phy_8x16_notify_disconnect; - phy->io_priv = qphy->regs + HSPHY_ULPI_VIEWPORT; - phy->io_ops = &ulpi_viewport_access_ops; - phy->type = USB_PHY_TYPE_USB2; - phy->vbus_nb.notifier_call = phy_8x16_vbus_notify; - phy->id_nb.notifier_call = NULL; - - ret = phy_8x16_read_devicetree(qphy); - if (ret < 0) - return ret; - - ret = clk_set_rate(qphy->core_clk, INT_MAX); - if (ret < 0) - dev_dbg(phy->dev, "Can't boost core clock\n"); - - ret = clk_prepare_enable(qphy->core_clk); - if (ret < 0) - return ret; - - ret = clk_prepare_enable(qphy->iface_clk); - if (ret < 0) - goto off_core; - - ret = regulator_bulk_enable(ARRAY_SIZE(qphy->regulator), - qphy->regulator); - if (WARN_ON(ret)) - goto off_clks; - - ret = usb_add_phy_dev(&qphy->phy); - if (ret) - goto off_power; - - qphy->reboot_notify.notifier_call = phy_8x16_reboot_notify; - register_reboot_notifier(&qphy->reboot_notify); - - return 0; - -off_power: - regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator); -off_clks: - clk_disable_unprepare(qphy->iface_clk); -off_core: - clk_disable_unprepare(qphy->core_clk); - return ret; -} - -static int phy_8x16_remove(struct platform_device *pdev) -{ - struct phy_8x16 *qphy = platform_get_drvdata(pdev); - - unregister_reboot_notifier(&qphy->reboot_notify); - - /* - * Ensure that D+/D- lines are routed to uB connector, so - * we could load bootloader/kernel at next reboot_notify - */ - gpiod_set_value_cansleep(qphy->switch_gpio, 0); - - usb_remove_phy(&qphy->phy); - - clk_disable_unprepare(qphy->iface_clk); - clk_disable_unprepare(qphy->core_clk); - regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator); - return 0; -} - -static const struct of_device_id phy_8x16_dt_match[] = { - { .compatible = "qcom,usb-8x16-phy" }, - { } -}; -MODULE_DEVICE_TABLE(of, phy_8x16_dt_match); - -static struct platform_driver phy_8x16_driver = { - .probe = phy_8x16_probe, - .remove = phy_8x16_remove, - .driver = { - .name = "phy-qcom-8x16-usb", - .of_match_table = phy_8x16_dt_match, - }, -}; -module_platform_driver(phy_8x16_driver); - -MODULE_LICENSE("GPL v2"); -MODULE_DESCRIPTION("Qualcomm APQ8016/MSM8916 chipsets USB transceiver driver");