Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c59ef38 authored by Hema HK's avatar Hema HK Committed by Felipe Balbi
Browse files

usb: otg: OMAP4430: Save/restore the context



Add the context save/restore for the control module register
used for OMAP4430 musb with UTMI embedded PHY interface.

Signed-off-by: default avatarHema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 37db3af1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@

static struct clk *phyclk, *clk48m, *clk32k;
static void __iomem *ctrl_base;
static int usbotghs_control;

int omap4430_phy_init(struct device *dev)
{
@@ -129,6 +130,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);
@@ -137,6 +141,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;