Messages in this thread | | | Date | Sun, 6 Nov 2005 16:55:27 +0100 | From | Pavel Machek <> | Subject | Re: [patch] collie: enable frontlight |
| |
Hi!
> Pavel Machek <pavel@ucw.cz> wrote: > > > > +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?)
Oops, I see; I invented my own lock when I should have used lchip->lock. Fixed locally, I'll push it up eventually.
Pavel -- Thanks, Sharp! - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |