Skip to content

Commit

Permalink
usb: ohci-at91: Set RemoteWakeupConnected bit explicitly.
Browse files Browse the repository at this point in the history
The reset value of RWC is 0, set RemoteWakeupConnected bit explicitly
before calling ohci_run, it also fixes the issue that the mass
storage stick connected wasn't suspended when the system suspend.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wenyou Yang authored and Greg Kroah-Hartman committed Oct 24, 2016
1 parent 36de70e commit ed19ece
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/usb/host/ohci-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
ohci->num_ports = board->ports;
at91_start_hc(pdev);

/*
* The RemoteWakeupConnected bit has to be set explicitly
* before calling ohci_run. The reset value of this bit is 0.
*/
ohci->hc_control = OHCI_CTRL_RWC;

retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (retval == 0) {
device_wakeup_enable(hcd->self.controller);
Expand Down Expand Up @@ -677,9 +683,6 @@ ohci_hcd_at91_drv_suspend(struct device *dev)
* REVISIT: some boards will be able to turn VBUS off...
*/
if (!ohci_at91->wakeup) {
ohci->hc_control = ohci_readl(ohci, &ohci->regs->control);
ohci->hc_control &= OHCI_CTRL_RWC;
ohci_writel(ohci, ohci->hc_control, &ohci->regs->control);
ohci->rh_state = OHCI_RH_HALTED;

/* flush the writes */
Expand Down

0 comments on commit ed19ece

Please sign in to comment.