Subject: Re: [PATCH] powerpc/5200: tighten up ac97 reset timing

From: Wolfram Sang <[email-masked]>
Date: Fri, 3 Sep 2010 18:22:24 +0200

> >> -       udelay(2);
> >> +       udelay(1);
> >>
> >>         /* Deassert reset */
> >>         setbits8(&wkup_gpio->wkup_dvo, reset);
> >>
> >> +       /* wait at least 200ns */
> >> +       __delay(7);
> >
> > ndelay(200)?
> 
> Is ndelay defined for powerpc?  I was under the impression that it was
> being redefined to udelay in linux/delay.h.
> 
> #ifndef ndelay
> static inline void ndelay(unsigned long x)
> {
>         udelay(DIV_ROUND_UP(x, 1000));
> }
> #define ndelay(x) ndelay(x)
> #endif

Yes, but it is way more readable. Does the extra delay hurt? The value
of 7 looks a bit magic to me. Are you sure it will do for various clock
frequencies?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |