aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-dbg.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2005-08-31 14:52:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-12 15:23:46 -0400
commitfdd13b36c4a501d8787a27e54635fbd943f2685d (patch)
treeeebcc2fc677b5b625235e2e0797b5f9ab6d74905 /drivers/usb/host/ohci-dbg.c
parente0fd3cbc50a8c925e8e7d8448df689015362c458 (diff)
[PATCH] USB: OHCI relies less on NDP register
Some OHCI implementations have differences in the way the NDP register (in roothub_a) reports the number of ports present. This patch allows the platform specific code to optionally supply the number of ports. The driver just reads the value at init (if not supplied) instead of reading it every time its needed (except for an AMD756 bug workaround). It also sets the value correctly for the ARM pxa27x architecture. Signed-Off-By: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ohci-dbg.c')
-rw-r--r--drivers/usb/host/ohci-dbg.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
index 447f488f5d93..7924c74f958e 100644
--- a/drivers/usb/host/ohci-dbg.c
+++ b/drivers/usb/host/ohci-dbg.c
@@ -228,23 +228,22 @@ ohci_dump_roothub (
228 char **next, 228 char **next,
229 unsigned *size) 229 unsigned *size)
230{ 230{
231 u32 temp, ndp, i; 231 u32 temp, i;
232 232
233 temp = roothub_a (controller); 233 temp = roothub_a (controller);
234 if (temp == ~(u32)0) 234 if (temp == ~(u32)0)
235 return; 235 return;
236 ndp = (temp & RH_A_NDP);
237 236
238 if (verbose) { 237 if (verbose) {
239 ohci_dbg_sw (controller, next, size, 238 ohci_dbg_sw (controller, next, size,
240 "roothub.a %08x POTPGT=%d%s%s%s%s%s NDP=%d\n", temp, 239 "roothub.a %08x POTPGT=%d%s%s%s%s%s NDP=%d(%d)\n", temp,
241 ((temp & RH_A_POTPGT) >> 24) & 0xff, 240 ((temp & RH_A_POTPGT) >> 24) & 0xff,
242 (temp & RH_A_NOCP) ? " NOCP" : "", 241 (temp & RH_A_NOCP) ? " NOCP" : "",
243 (temp & RH_A_OCPM) ? " OCPM" : "", 242 (temp & RH_A_OCPM) ? " OCPM" : "",
244 (temp & RH_A_DT) ? " DT" : "", 243 (temp & RH_A_DT) ? " DT" : "",
245 (temp & RH_A_NPS) ? " NPS" : "", 244 (temp & RH_A_NPS) ? " NPS" : "",
246 (temp & RH_A_PSM) ? " PSM" : "", 245 (temp & RH_A_PSM) ? " PSM" : "",
247 ndp 246 (temp & RH_A_NDP), controller->num_ports
248 ); 247 );
249 temp = roothub_b (controller); 248 temp = roothub_b (controller);
250 ohci_dbg_sw (controller, next, size, 249 ohci_dbg_sw (controller, next, size,
@@ -266,7 +265,7 @@ ohci_dump_roothub (
266 ); 265 );
267 } 266 }
268 267
269 for (i = 0; i < ndp; i++) { 268 for (i = 0; i < controller->num_ports; i++) {
270 temp = roothub_portstatus (controller, i); 269 temp = roothub_portstatus (controller, i);
271 dbg_port_sw (controller, i, temp, next, size); 270 dbg_port_sw (controller, i, temp, next, size);
272 } 271 }