diff options
author | Hema HK <hemahk@ti.com> | 2011-02-17 01:36:07 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-02-18 07:05:37 -0500 |
commit | ee896e348cf6f323a00e4ee52e6386f515f86cee (patch) | |
tree | 05aa1bd7587a1ab547492222ae2d18a966872e0e /arch/arm | |
parent | d8692748408fbec28dfb065f4127307e24187476 (diff) |
usb: otg: OMAP4430: Introducing suspend function for power management
Introduced the suspend/resume function for the OMAP4430 internal PHY.
This will be used by the twl6030-usb transceiver driver.
Moved the clock enable/disable function calls and power on/off of the PHY
code from power on/off functions to suspend/resume function.
Pass the suspend function through board data for OMAP4430sdp and OMAP4panda.
This will be used by the twl6030-usb transceiver driver.
Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_phy_internal.c | 22 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/usb.h | 1 |
4 files changed, 18 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 07d1b20b1148..9cf8e333255f 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -272,6 +272,7 @@ static struct twl4030_usb_data omap4_usbphy_data = { | |||
272 | .phy_exit = omap4430_phy_exit, | 272 | .phy_exit = omap4430_phy_exit, |
273 | .phy_power = omap4430_phy_power, | 273 | .phy_power = omap4430_phy_power, |
274 | .phy_set_clock = omap4430_phy_set_clk, | 274 | .phy_set_clock = omap4430_phy_set_clk, |
275 | .phy_suspend = omap4430_phy_suspend, | ||
275 | }; | 276 | }; |
276 | 277 | ||
277 | static struct omap2_hsmmc_info mmc[] = { | 278 | static struct omap2_hsmmc_info mmc[] = { |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index e944025d5ef8..77748f813667 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -153,6 +153,7 @@ static struct twl4030_usb_data omap4_usbphy_data = { | |||
153 | .phy_exit = omap4430_phy_exit, | 153 | .phy_exit = omap4430_phy_exit, |
154 | .phy_power = omap4430_phy_power, | 154 | .phy_power = omap4430_phy_power, |
155 | .phy_set_clock = omap4430_phy_set_clk, | 155 | .phy_set_clock = omap4430_phy_set_clk, |
156 | .phy_suspend = omap4430_phy_suspend, | ||
156 | }; | 157 | }; |
157 | 158 | ||
158 | static struct omap2_hsmmc_info mmc[] = { | 159 | static struct omap2_hsmmc_info mmc[] = { |
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c index 745252c60e32..3ce675899fce 100644 --- a/arch/arm/mach-omap2/omap_phy_internal.c +++ b/arch/arm/mach-omap2/omap_phy_internal.c | |||
@@ -103,13 +103,6 @@ int omap4430_phy_set_clk(struct device *dev, int on) | |||
103 | int omap4430_phy_power(struct device *dev, int ID, int on) | 103 | int omap4430_phy_power(struct device *dev, int ID, int on) |
104 | { | 104 | { |
105 | if (on) { | 105 | if (on) { |
106 | /* enabled the clocks */ | ||
107 | omap4430_phy_set_clk(dev, 1); | ||
108 | /* power on the phy */ | ||
109 | if (__raw_readl(ctrl_base + CONTROL_DEV_CONF) & PHY_PD) { | ||
110 | __raw_writel(~PHY_PD, ctrl_base + CONTROL_DEV_CONF); | ||
111 | mdelay(200); | ||
112 | } | ||
113 | if (ID) | 106 | if (ID) |
114 | /* enable VBUS valid, IDDIG groung */ | 107 | /* enable VBUS valid, IDDIG groung */ |
115 | __raw_writel(AVALID | VBUSVALID, ctrl_base + | 108 | __raw_writel(AVALID | VBUSVALID, ctrl_base + |
@@ -125,10 +118,25 @@ int omap4430_phy_power(struct device *dev, int ID, int on) | |||
125 | /* Enable session END and IDIG to high impedence. */ | 118 | /* Enable session END and IDIG to high impedence. */ |
126 | __raw_writel(SESSEND | IDDIG, ctrl_base + | 119 | __raw_writel(SESSEND | IDDIG, ctrl_base + |
127 | USBOTGHS_CONTROL); | 120 | USBOTGHS_CONTROL); |
121 | } | ||
122 | return 0; | ||
123 | } | ||
124 | |||
125 | int omap4430_phy_suspend(struct device *dev, int suspend) | ||
126 | { | ||
127 | if (suspend) { | ||
128 | /* Disable the clocks */ | 128 | /* Disable the clocks */ |
129 | omap4430_phy_set_clk(dev, 0); | 129 | omap4430_phy_set_clk(dev, 0); |
130 | /* Power down the phy */ | 130 | /* Power down the phy */ |
131 | __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF); | 131 | __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF); |
132 | } else { | ||
133 | /* Enable the internel phy clcoks */ | ||
134 | omap4430_phy_set_clk(dev, 1); | ||
135 | /* power on the phy */ | ||
136 | if (__raw_readl(ctrl_base + CONTROL_DEV_CONF) & PHY_PD) { | ||
137 | __raw_writel(~PHY_PD, ctrl_base + CONTROL_DEV_CONF); | ||
138 | mdelay(200); | ||
139 | } | ||
132 | } | 140 | } |
133 | 141 | ||
134 | return 0; | 142 | return 0; |
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index 450a332f1009..f888e0e57dc8 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h | |||
@@ -88,6 +88,7 @@ extern int omap4430_phy_power(struct device *dev, int ID, int on); | |||
88 | extern int omap4430_phy_set_clk(struct device *dev, int on); | 88 | extern int omap4430_phy_set_clk(struct device *dev, int on); |
89 | extern int omap4430_phy_init(struct device *dev); | 89 | extern int omap4430_phy_init(struct device *dev); |
90 | extern int omap4430_phy_exit(struct device *dev); | 90 | extern int omap4430_phy_exit(struct device *dev); |
91 | extern int omap4430_phy_suspend(struct device *dev, int suspend); | ||
91 | 92 | ||
92 | #endif | 93 | #endif |
93 | 94 | ||