On Sat, May 06, 2000, Brad Hards <[EMAIL PROTECTED]> wrote:
> Pavel Machek wrote:
> > --- clean/drivers/usb/uhci.c    Thu Apr 27 10:05:49 2000
> > +++ linux/drivers/usb/uhci.c    Fri May  5 12:21:58 2000
> > @@ -2357,10 +2357,14 @@
> > 
> >  static int handle_pm_event(struct pm_dev *dev, pm_request_t rqst, void *data)
> >  {
> > +       struct uhci *uhci = dev->data;
> >         switch (rqst) {
> >         case PM_SUSPEND:
> > +               reset_hc(uhci);
> >                 break;
> >         case PM_RESUME:
> > +               reset_hc(uhci);
> > +               start_hc(uhci);
> >                 break;
> >         }
> >         return 0;
> 
> I don't doubt that this is better than the existing arrangement, but it
> doesn't look complete.
> 
> From my reading of the UHCI spec, I think that the following should
> occur:
> 
> On initialisation of the HC, we Set bit 1 in the USBINTR register.
> 
> On getting an interrupt, we check the USBSTS register to see if bit 2 is
> set, and if it is, we wake up the machine, then Clear bit 4 in the
> USBSTS register.
> 
> On getting PM_SUSPEND, we Clear bit 0 in the USBCMD register, then Set
> bit 3 in the USBCMD register.
> 
> On getting PM_RESUME, we Set bit 4 and Clear bit 3 in the USBCMD
> register, wait 20ms, then Clear bit 4 in the USBCMD register. We might
> need to Set bit 0 in the USBCMD register as well. 
> 
> Only one problem - I can't do this, just don't know enough to code it.
> 
> Anyone, Bueller?

I think you're confusing 2 things.

There's remote wakeup from USB devices which requires HC support. I think
that's what you're talking about.

What the PM stuff in the kernel does is to handle power management for
the Host Controller. It needs to be reset when full power is reapplied to
the device. That's what this patch does.

This isn't to say what you're talking isn't necessary, but for right now
since PM is in it's infancy under Linux, I think partial support is fine
for 2.4 atleast.

JE


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to