PERFORCE change 131694 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Wed Dec 26 04:27:38 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=131694
Change 131694 by hselasky at hselasky_laptop001 on 2007/12/26 12:27:28
o Improve suspend and resume handling by disabling
interrupts we are not waiting for.
o It appears that we need to keep the clocks on for
as long as there is VBUS.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/at9100_dci.c#7 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/at9100_dci.c#7 (text+ko) ====
@@ -818,6 +818,13 @@
sc->sc_flags.status_suspend = 0;
sc->sc_flags.change_suspend = 0;
sc->sc_flags.change_connect = 1;
+
+ /* disable resume interrupt */
+ AT91_UDP_WRITE_4(sc, AT91_UDP_IDR,
+ AT91_UDP_INT_RXRSM);
+ /* enable suspend interrupt */
+ AT91_UDP_WRITE_4(sc, AT91_UDP_IER,
+ AT91_UDP_INT_RXSUSP);
}
/*
* If RXRSM and RXSUSP is set at the same time we interpret
@@ -828,11 +835,26 @@
if (sc->sc_flags.status_suspend) {
sc->sc_flags.status_suspend = 0;
sc->sc_flags.change_suspend = 1;
+
+ /* disable resume interrupt */
+ AT91_UDP_WRITE_4(sc, AT91_UDP_IDR,
+ AT91_UDP_INT_RXRSM);
+ /* enable suspend interrupt */
+ AT91_UDP_WRITE_4(sc, AT91_UDP_IER,
+ AT91_UDP_INT_RXSUSP);
}
} else if (status & AT91_UDP_INT_RXSUSP) {
if (!sc->sc_flags.status_suspend) {
sc->sc_flags.status_suspend = 1;
sc->sc_flags.change_suspend = 1;
+
+ /* disable suspend interrupt */
+ AT91_UDP_WRITE_4(sc, AT91_UDP_IDR,
+ AT91_UDP_INT_RXSUSP);
+
+ /* enable resume interrupt */
+ AT91_UDP_WRITE_4(sc, AT91_UDP_IER,
+ AT91_UDP_INT_RXRSM);
}
}
/* complete root HUB interrupt endpoint */
@@ -2191,11 +2213,7 @@
goto tr_stalled;
}
if (sc->sc_flags.status_vbus) {
- if (sc->sc_flags.status_suspend) {
- at9100_dci_clocks_off(sc);
- } else {
- at9100_dci_clocks_on(sc);
- }
+ at9100_dci_clocks_on(sc);
at9100_dci_pull_up(sc);
} else {
at9100_dci_pull_down(sc);
More information about the p4-projects
mailing list