From patchwork Wed Nov 28 12:59:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 1816141 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9F8EDDF26F for ; Wed, 28 Nov 2012 12:59:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754998Ab2K1M7z (ORCPT ); Wed, 28 Nov 2012 07:59:55 -0500 Received: from warmcat.com ([87.106.134.80]:59180 "EHLO warmcat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754991Ab2K1M7y (ORCPT ); Wed, 28 Nov 2012 07:59:54 -0500 Subject: [try#1 PATCH 4/7] usb: omap ehci: remove all regulator control from ehci omap To: linux-omap@vger.kernel.org, linux-usb@vger.kernel.org From: Andy Green Cc: gregkh@linuxfoundation.org, rogerq@ti.com, keshava_mgowda@ti.com, balbi@ti.com, stern@rowland.harvard.edu Date: Wed, 28 Nov 2012 12:59:50 +0000 Message-ID: <20121128125950.29569.68156.stgit@build.warmcat.com> In-Reply-To: <20121128124744.29569.52739.stgit@build.warmcat.com> References: <20121128124744.29569.52739.stgit@build.warmcat.com> User-Agent: StGit/0.16-2-g0d85 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This series migrates it to be assets of the logical ehci-omap.0 device object. Signed-off-by: Andy Green --- arch/arm/mach-omap2/usb-host.c | 1 - arch/arm/plat-omap/include/plat/usb.h | 7 ------ drivers/usb/host/ehci-omap.c | 37 --------------------------------- 3 files changed, 45 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c index 3c43449..98f3287 100644 --- a/arch/arm/mach-omap2/usb-host.c +++ b/arch/arm/mach-omap2/usb-host.c @@ -498,7 +498,6 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) ohci_data.port_mode[i] = pdata->port_mode[i]; ehci_data.port_mode[i] = pdata->port_mode[i]; ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i]; - ehci_data.regulator[i] = pdata->regulator[i]; } ehci_data.phy_reset = pdata->phy_reset; ohci_data.es2_compatibility = pdata->es2_compatibility; diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index 87ee140..70acdee 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h @@ -36,12 +36,6 @@ struct usbhs_omap_board_data { unsigned es2_compatibility:1; unsigned phy_reset:1; - - /* - * Regulators for USB PHYs. - * Each PHY can have a separate regulator. - */ - struct regulator *regulator[OMAP3_HS_USB_PORTS]; }; #ifdef CONFIG_ARCH_OMAP2PLUS @@ -49,7 +43,6 @@ struct usbhs_omap_board_data { struct ehci_hcd_omap_platform_data { enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; int reset_gpio_port[OMAP3_HS_USB_PORTS]; - struct regulator *regulator[OMAP3_HS_USB_PORTS]; unsigned phy_reset:1; }; diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 44e7d0f..7ab7c54 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -149,19 +148,6 @@ static int omap_ehci_init(struct usb_hcd *hcd) return rc; } -static void disable_put_regulator( - struct ehci_hcd_omap_platform_data *pdata) -{ - int i; - - for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) { - if (pdata->regulator[i]) { - regulator_disable(pdata->regulator[i]); - regulator_put(pdata->regulator[i]); - } - } -} - /* configure so an HC device and id are always provided */ /* always called with process context; sleeping is OK */ @@ -175,14 +161,11 @@ static void disable_put_regulator( static int ehci_hcd_omap_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct ehci_hcd_omap_platform_data *pdata = dev->platform_data; struct resource *res; struct usb_hcd *hcd; void __iomem *regs; int ret = -ENODEV; int irq; - int i; - char supply[7]; if (usb_disabled()) return -ENODEV; @@ -223,23 +206,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) hcd->rsrc_len = resource_size(res); hcd->regs = regs; - /* get ehci regulator and enable */ - for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) { - if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) { - pdata->regulator[i] = NULL; - continue; - } - snprintf(supply, sizeof(supply), "hsusb%d", i); - pdata->regulator[i] = regulator_get(dev, supply); - if (IS_ERR(pdata->regulator[i])) { - pdata->regulator[i] = NULL; - dev_dbg(dev, - "failed to get ehci port%d regulator\n", i); - } else { - regulator_enable(pdata->regulator[i]); - } - } - pm_runtime_enable(dev); pm_runtime_get_sync(dev); @@ -261,11 +227,9 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) goto err_pm_runtime; } - return 0; err_pm_runtime: - disable_put_regulator(pdata); pm_runtime_put_sync(dev); usb_put_hcd(hcd); @@ -290,7 +254,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) struct ehci_hcd_omap_platform_data *pdata = dev->platform_data; usb_remove_hcd(hcd); - disable_put_regulator(dev->platform_data); iounmap(hcd->regs); usb_put_hcd(hcd);