Re: [PATCH] Platform: Samsung Q10 backlight driver

From: Dmitry Torokhov
Date: Wed Feb 16 2011 - 20:05:33 EST


On Wed, Feb 16, 2011 at 03:58:07PM -0800, Greg KH wrote:
> On Wed, Feb 16, 2011 at 11:30:29PM +0000, Frederick van der Wyck wrote:
> > +
> > +static void samsungq10_bl_send_intensity(struct backlight_device *bd)
> > +{
> > + int brightness = bd->props.brightness;
> > +
> > + if (!samsungq10_suspended) {
> > + while (inb(0x64)&2)
> > + ;
> > + outb_p(0xbe, 0x64);
> > + while (inb(0x64)&2)
> > + ;
> > + outb_p(0x89, 0x60);
> > + while (inb(0x64)&2)
> > + ;
> > + outb_p(0x91, 0x60);
> > + while (inb(0x64)&2)
> > + ;
>
> Potentially endless loops are not good, please timeout if you don't get
> the proper value over a time.

Double not good since it is i8042 registers. Use
i8042_lock_chip()/i8042_command()/i8042_unlock_chip().

--
Dmitry
--
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/