From patchwork Fri Feb 25 13:24:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalliguddi, Hema" X-Patchwork-Id: 590071 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1PDOfFh005656 for ; Fri, 25 Feb 2011 13:24:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932553Ab1BYNYj (ORCPT ); Fri, 25 Feb 2011 08:24:39 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:36688 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932337Ab1BYNYh (ORCPT ); Fri, 25 Feb 2011 08:24:37 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p1PDOXu5016729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Feb 2011 07:24:35 -0600 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p1PDOAw9006857; Fri, 25 Feb 2011 18:54:32 +0530 (IST) From: Hema HK To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, Hema HK , Felipe Balbi , Tony Lindgren , Paul Walmsley Subject: [PATCH 5/5 v2] usb: musb: OMAP4430: Save/restore the context Date: Fri, 25 Feb 2011 18:54:06 +0530 Message-Id: <1298640246-21181-6-git-send-email-hemahk@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1298640246-21181-1-git-send-email-hemahk@ti.com> References: <1298640246-21181-1-git-send-email-hemahk@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 25 Feb 2011 13:24:41 +0000 (UTC) diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c index c50441f..e2e605f 100644 --- a/arch/arm/mach-omap2/omap_phy_internal.c +++ b/arch/arm/mach-omap2/omap_phy_internal.c @@ -44,6 +44,7 @@ static struct clk *phyclk, *clk48m, *clk32k; static void __iomem *ctrl_base; +static int usbotghs_control; int omap4430_phy_init(struct device *dev) { @@ -130,6 +131,9 @@ int omap4430_phy_suspend(struct device *dev, int suspend) omap4430_phy_set_clk(dev, 0); /* Power down the phy */ __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF); + + /* save the context */ + usbotghs_control = __raw_readl(ctrl_base + USBOTGHS_CONTROL); } else { /* Enable the internel phy clcoks */ omap4430_phy_set_clk(dev, 1); @@ -138,6 +142,9 @@ int omap4430_phy_suspend(struct device *dev, int suspend) __raw_writel(~PHY_PD, ctrl_base + CONTROL_DEV_CONF); mdelay(200); } + + /* restore the context */ + __raw_writel(usbotghs_control, ctrl_base + USBOTGHS_CONTROL); } return 0;