diff options
author | David Brownell <david-b@pacbell.net> | 2006-04-03 00:26:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-04-14 14:12:25 -0400 |
commit | 68ba61b89c10b3412c7ee05cd649303ba5a588d1 (patch) | |
tree | f89509f31d1489cc3de2e3fbbbbeaaebd1029754 /drivers/usb/host | |
parent | 35fcca442aca1a8d927b697e7e15d3f655958bd7 (diff) |
[PATCH] USB: at91 usb driver supend/resume fixes
AT91: the two USB drivers (OHCI, UDC) got out of sync with various
usbcore and driver model PM updates; fix.
Also minor fixes to ohci: whitespace/style, MODULE_ALIAS so coldplug works
using /sys/.../modalias, and turn off _both_ clocks during suspend.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 980030d684d5..6b7350b52419 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <asm/arch/board.h> | 20 | #include <asm/arch/board.h> |
21 | 21 | ||
22 | #ifndef CONFIG_ARCH_AT91RM9200 | 22 | #ifndef CONFIG_ARCH_AT91RM9200 |
23 | #error "This file is AT91RM9200 bus glue. CONFIG_ARCH_AT91RM9200 must be defined." | 23 | #error "CONFIG_ARCH_AT91RM9200 must be defined." |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | /* interface and function clocks */ | 26 | /* interface and function clocks */ |
@@ -84,8 +84,6 @@ static int usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *); | |||
84 | * Allocates basic resources for this USB host controller, and | 84 | * Allocates basic resources for this USB host controller, and |
85 | * then invokes the start() method for the HCD associated with it | 85 | * then invokes the start() method for the HCD associated with it |
86 | * through the hotplug entry's driver_data. | 86 | * through the hotplug entry's driver_data. |
87 | * | ||
88 | * Store this function in the HCD's struct pci_driver as probe(). | ||
89 | */ | 87 | */ |
90 | int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev) | 88 | int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev) |
91 | { | 89 | { |
@@ -148,7 +146,6 @@ int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device * | |||
148 | } | 146 | } |
149 | 147 | ||
150 | 148 | ||
151 | /* may be called without controller electrically present */ | ||
152 | /* may be called with controller, bus, and devices active */ | 149 | /* may be called with controller, bus, and devices active */ |
153 | 150 | ||
154 | /** | 151 | /** |
@@ -166,11 +163,11 @@ static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pde | |||
166 | usb_remove_hcd(hcd); | 163 | usb_remove_hcd(hcd); |
167 | at91_stop_hc(pdev); | 164 | at91_stop_hc(pdev); |
168 | iounmap(hcd->regs); | 165 | iounmap(hcd->regs); |
169 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | 166 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
170 | 167 | ||
171 | clk_put(fclk); | 168 | clk_put(fclk); |
172 | clk_put(iclk); | 169 | clk_put(iclk); |
173 | fclk = iclk = NULL; | 170 | fclk = iclk = NULL; |
174 | 171 | ||
175 | dev_set_drvdata(&pdev->dev, NULL); | 172 | dev_set_drvdata(&pdev->dev, NULL); |
176 | return 0; | 173 | return 0; |
@@ -235,8 +232,8 @@ static const struct hc_driver ohci_at91_hc_driver = { | |||
235 | .hub_control = ohci_hub_control, | 232 | .hub_control = ohci_hub_control, |
236 | 233 | ||
237 | #ifdef CONFIG_PM | 234 | #ifdef CONFIG_PM |
238 | .hub_suspend = ohci_hub_suspend, | 235 | .bus_suspend = ohci_bus_suspend, |
239 | .hub_resume = ohci_hub_resume, | 236 | .bus_resume = ohci_bus_resume, |
240 | #endif | 237 | #endif |
241 | .start_port_reset = ohci_start_port_reset, | 238 | .start_port_reset = ohci_start_port_reset, |
242 | }; | 239 | }; |
@@ -254,21 +251,21 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *dev) | |||
254 | } | 251 | } |
255 | 252 | ||
256 | #ifdef CONFIG_PM | 253 | #ifdef CONFIG_PM |
257 | static int ohci_hcd_at91_drv_suspend(struct platform_device *dev, u32 state, u32 level) | ||
258 | { | ||
259 | printk("%s(%s:%d): not implemented yet\n", | ||
260 | __func__, __FILE__, __LINE__); | ||
261 | 254 | ||
255 | /* REVISIT suspend/resume look "too" simple here */ | ||
256 | |||
257 | static int | ||
258 | ohci_hcd_at91_drv_suspend(struct platform_device *dev, pm_message_t mesg) | ||
259 | { | ||
262 | clk_disable(fclk); | 260 | clk_disable(fclk); |
261 | clk_disable(iclk); | ||
263 | 262 | ||
264 | return 0; | 263 | return 0; |
265 | } | 264 | } |
266 | 265 | ||
267 | static int ohci_hcd_at91_drv_resume(struct platform_device *dev, u32 state) | 266 | static int ohci_hcd_at91_drv_resume(struct platform_device *dev) |
268 | { | 267 | { |
269 | printk("%s(%s:%d): not implemented yet\n", | 268 | clk_enable(iclk); |
270 | __func__, __FILE__, __LINE__); | ||
271 | |||
272 | clk_enable(fclk); | 269 | clk_enable(fclk); |
273 | 270 | ||
274 | return 0; | 271 | return 0; |
@@ -278,6 +275,8 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *dev, u32 state) | |||
278 | #define ohci_hcd_at91_drv_resume NULL | 275 | #define ohci_hcd_at91_drv_resume NULL |
279 | #endif | 276 | #endif |
280 | 277 | ||
278 | MODULE_ALIAS("at91rm9200-ohci"); | ||
279 | |||
281 | static struct platform_driver ohci_hcd_at91_driver = { | 280 | static struct platform_driver ohci_hcd_at91_driver = { |
282 | .probe = ohci_hcd_at91_drv_probe, | 281 | .probe = ohci_hcd_at91_drv_probe, |
283 | .remove = ohci_hcd_at91_drv_remove, | 282 | .remove = ohci_hcd_at91_drv_remove, |