Hi Andrew,
there is a bit for the connection status of every
port of the root-hubs:
OHCI:
connection = 0;
num_ports = readl (&ohci->regs->roothub.a) & RH_A_NDP;
for ( i = 0; i < num_ports; i++) {
connection |= (readl (&ohci->regs->roothub.portstatus[i]) &
RH_PS_CCS);
}
if(!connection) suspend();
UHCI:
connection = 0;
for (i = 0; i < uhci->rh.numports; i++) {
connection |= ((inw (io_addr + USBPORTSC1 + i * 2) & 0x1);
}
if(!connection) suspend();
If you just want to suspend the root hubs
one place for the test might be the end of the
?hci_free_device()
function.
I think every HUB should be able to resume the bus if one of its
ports has a change connection event. So we should be able to suspend
every unused HUB. But here the check - if there is a device connected
to the HUB - should go into the HUB code.
Both UHCI and OHCI can generate a resume on a connection change event
if they are configured the right way.
- Roman
Johannes Erdfelt wrote:
>
> On Fri, Mar 09, 2001, Grover, Andrew <[EMAIL PROTECTED]> wrote:
> > > This wouldn't work for systems with builtin hubs (not the
> > > root hub) and
> > > just doesn't seem very intuitive to me.
> > >
> > > I'm not super familiar with the steps ACPI goes through to
> > > suspend, but
> > > don't we have a warning that a suspend is about to happen and
> > > we can do
> > > things?
> > >
> > > Wouldn't this be a better time to suspend the HC?
> >
> > I am not talking about suspending the HC when the system is suspended, I am
> > talking about suspending the HC when *the system is running* and no devices
> > are attached.
> >
> > Why bother? Because running the HC even with nothing attached prevents ACPI
> > from putting the CPU into deep sleep (C3) when idle. The HC is not only
> > wasting power, it is causing the CPU to waste power.
> >
> > We will also want to suspend the HC (even with devices attached) when the
> > system goes to sleep, but I was focussing on the other issue first.
>
> Ahh, then this is tricky. This sounds like the best we can do for now
> then.
>
> It's unfortunately not perfect.
>
> > I am not a USB expert -- how would builtin hubs complicate things?
>
> It's just like any other device, it would generate traffic. This is not
> the same as the root hub (which all HC's have are not a "real" device)
> and not all HC's have builtin hub's, but I'm seeing them more often now.
>
> JE
>
> _______________________________________________
> [EMAIL PROTECTED]
> To unsubscribe, use the last form field at:
> http://lists.sourceforge.net/lists/listinfo/linux-usb-devel
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel