From patchwork Sun Dec 2 15:01:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 1830951 Return-Path: X-Original-To: patchwork-linux-pm@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 DA7EEDFB79 for ; Sun, 2 Dec 2012 15:03:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752061Ab2LBPC6 (ORCPT ); Sun, 2 Dec 2012 10:02:58 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:37750 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753488Ab2LBPC4 (ORCPT ); Sun, 2 Dec 2012 10:02:56 -0500 Received: by mail-pa0-f46.google.com with SMTP id bh2so1351656pad.19 for ; Sun, 02 Dec 2012 07:02:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=UMe/pMpbfUSe5x/IP1O4dNsJSf8Iu4GOEtESf1zjIR8=; b=VQxPyqR7Tyymz4MpkbIi48RTysltf5rTu4aAWH0jSfuCyCby0W8AeEQTA7BZwUG9SZ vHT5YeLmQxV4+ZWiKeGic9xv1DEufkK5mpNu2fzRYeIKnmXuqSvMUugSbZQjwB3bWmHY eOF20OIf7evCJ+S9qegJyp/mPuylhDpHKemsln64gbc3z1ziE7CfqIO8b//Eys7u1nm4 0MaYL16UNdm/fachIBVAOAymDYdn1+ey516OFvtt7NFRLeX/LvlO1nusncdFBNyfoKVP /Y/7YpvMJqMsvO08dvreKDaVfsqGUiG/kOTNJ5SS9893KQp4fWBz53HLRu6z0+dIKsbf obzg== Received: by 10.68.233.201 with SMTP id ty9mr22065568pbc.14.1354460576509; Sun, 02 Dec 2012 07:02:56 -0800 (PST) Received: from localhost ([183.37.207.193]) by mx.google.com with ESMTPS id ay5sm6413961pab.1.2012.12.02.07.02.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Dec 2012 07:02:54 -0800 (PST) From: Ming Lei To: Alan Stern , Greg Kroah-Hartman Cc: Lan Tianyu , Sarah Sharp , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Oliver Neukum , linux-omap@vger.kernel.org, linux-usb@vger.kernel.org, Andy Green , Roger Quadros , Felipe Balbi , Ming Lei Subject: [RFC PATCH 5/5] usb: omap ehci: remove all regulator control from ehci omap Date: Sun, 2 Dec 2012 23:01:07 +0800 Message-Id: <1354460467-28006-6-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1354460467-28006-1-git-send-email-tom.leiming@gmail.com> References: <1354460467-28006-1-git-send-email-tom.leiming@gmail.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Andy Green This series migrates it to the hub driver as suggested by Felipe Balbi. Cc: Andy Green Cc: Roger Quadros Cc: Alan Stern Cc: Felipe Balbi Signed-off-by: Andy Green Signed-off-by: Ming Lei --- drivers/usb/host/ehci-omap.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index ac17a7c..d25e39e 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -150,19 +149,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 */ @@ -176,14 +162,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; @@ -224,23 +207,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); @@ -266,7 +232,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) return 0; err_pm_runtime: - disable_put_regulator(pdata); pm_runtime_put_sync(dev); usb_put_hcd(hcd); @@ -291,7 +256,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);