Pavel Machek <[email protected]> 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?)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]