Re: [patch] collie: enable frontlight

From: Pavel Machek
Date: Sun Nov 06 2005 - 10:45:46 EST


Hi!

> > +static spinlock_t fl_lock = SPIN_LOCK_UNLOCKED;
> > +
> > +#define LCM_ALC_EN 0x8000
> > +
> > +void frontlight_set(struct locomo *lchip, int duty, int vr, int bpwf)
> > +{
> > + unsigned long flags;
> > +
> > + spin_lock_irqsave(&fl_lock, flags);
> > + locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
> > + udelay(100);
> > + locomo_writel(duty, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
> > + locomo_writel(bpwf | LCM_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
> > + spin_unlock_irqrestore(&fl_lock, flags);
> > +}
>
> ick, a 100 microsecond glitch, quite unnecessary. Why not use a semaphore
> here, if any locking is actually needed? (It's called from device probe -
> there's higher-level serialisation, no?)

Suspend (locomo_suspend) touches frontlight registers, too, and it
does it under spinlock => converting to semaphore would not too
simple. As it is only one glitch during probe, it should not hurt that
much...
Pavel
--
Thanks, Sharp!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/