diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-26 06:10:20 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-24 07:30:13 -0400 |
commit | 846a70487e2a0e5045c6a428a0969d3e0490b359 (patch) | |
tree | 49458980d4d950e8592715616df956a3ba05a85e /drivers/usb/host/ohci-sa1111.c | |
parent | 132db99ae2c6f6a586fc932507fcf4484d90c8fa (diff) |
USB: sa1111: add OHCI shutdown methods
Add OHCI shutdown methods to cleanly shutdown the OHCI controller on
system shutdowns and reboots. This avoids the controller continuing
to run should be soft-reboot the platform, potentially scribbling
over system memory.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/usb/host/ohci-sa1111.c')
-rw-r--r-- | drivers/usb/host/ohci-sa1111.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c index 83f3a40db538..95c3f0fb48d3 100644 --- a/drivers/usb/host/ohci-sa1111.c +++ b/drivers/usb/host/ohci-sa1111.c | |||
@@ -89,6 +89,7 @@ static const struct hc_driver ohci_sa1111_hc_driver = { | |||
89 | */ | 89 | */ |
90 | .start = ohci_sa1111_start, | 90 | .start = ohci_sa1111_start, |
91 | .stop = ohci_stop, | 91 | .stop = ohci_stop, |
92 | .shutdown = ohci_shutdown, | ||
92 | 93 | ||
93 | /* | 94 | /* |
94 | * managing i/o requests and associated device resources | 95 | * managing i/o requests and associated device resources |
@@ -232,6 +233,16 @@ static int ohci_hcd_sa1111_remove(struct sa1111_dev *dev) | |||
232 | return 0; | 233 | return 0; |
233 | } | 234 | } |
234 | 235 | ||
236 | static void ohci_hcd_sa1111_shutdown(struct sa1111_dev *dev) | ||
237 | { | ||
238 | struct usb_hcd *hcd = sa1111_get_drvdata(dev); | ||
239 | |||
240 | if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) { | ||
241 | hcd->driver->shutdown(hcd); | ||
242 | sa1111_stop_hc(dev); | ||
243 | } | ||
244 | } | ||
245 | |||
235 | static struct sa1111_driver ohci_hcd_sa1111_driver = { | 246 | static struct sa1111_driver ohci_hcd_sa1111_driver = { |
236 | .drv = { | 247 | .drv = { |
237 | .name = "sa1111-ohci", | 248 | .name = "sa1111-ohci", |
@@ -240,4 +251,5 @@ static struct sa1111_driver ohci_hcd_sa1111_driver = { | |||
240 | .devid = SA1111_DEVID_USB, | 251 | .devid = SA1111_DEVID_USB, |
241 | .probe = ohci_hcd_sa1111_probe, | 252 | .probe = ohci_hcd_sa1111_probe, |
242 | .remove = ohci_hcd_sa1111_remove, | 253 | .remove = ohci_hcd_sa1111_remove, |
254 | .shutdown = ohci_hcd_sa1111_shutdown, | ||
243 | }; | 255 | }; |