[PATCH 3/5 v2] mpc52xx suspend: USB

Grant Likely grant.likely at secretlab.ca
Sat Mar 24 03:00:11 EST 2007


On 3/23/07, Sylvain Munaut <tnt at 246tnt.com> wrote:
> Domen Puncer wrote:
> > +     struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
> > +     if (machine_is_compatible("generic-mpc5200")) {
> > +             struct ohci_hcd *ohci = hcd_to_ohci(hcd);
> >
> >
> Not good, what if you have a Ohci PCI card on a 5200 board ...
>
> You somehow need to check the compatible list of the of_node associated
> with the particular instance you're putting to sleep.

Also, I don't think the device tree should be queried at runtime
inside the suspend/resume functions.  All device tree queries should
probably go into the probe() routine and the results cached.

However, I'm no longer convinced that this is the correct approach.
I've gone and looked at the 5200b usb documentation, and it looks to
me like the handling of port power is really a board/system specific
thing.  For example, a new system might require port power to be
forced on when the processor is suspended.

I think this code should be moved to the board support code in
arch/powerpc/platforms/52xx.

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195



More information about the Linuxppc-embedded mailing list