USB: sl811-hcd: Fix device disconnect

A while ago I provided a patch that fixed device detection after device
removal (USB: sl811-hcd: Fix device disconnect).
Chris Brissette pointed out that the detection/removal counter method
to distinguish insert or remove my fail under certain conditions.
Latest SL811HS datasheet (Document 38-08008 Rev. *D) indicates that
bit 6 (SL11H_INTMASK_RD) of the Interrupt Status Register together with
bit 5 (SL11H_INTMASK_INSRMV) can be used to determine whether a device
has been inserted or removed.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Michael Hennerich 2010-04-28 17:31:36 -04:00 committed by Greg Kroah-Hartman
parent 869aa98c1d
commit 8a3461e2cd

View file

@ -720,10 +720,10 @@ static irqreturn_t sl811h_irq(struct usb_hcd *hcd)
/* port status seems weird until after reset, so
* force the reset and make khubd clean up later.
*/
if (sl811->stat_insrmv & 1)
sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION;
else
if (irqstat & SL11H_INTMASK_RD)
sl811->port1 &= ~(1 << USB_PORT_FEAT_CONNECTION);
else
sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION;
sl811->port1 |= 1 << USB_PORT_FEAT_C_CONNECTION;