lkml.org 
[lkml]   [2005]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-11-06 16:58    [W:0.061 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site