[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100517200017.GA25262@sirena.org.uk>
Date: Mon, 17 May 2010 21:00:18 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Uwe Kleine-K?nig <u.kleine-koenig@...gutronix.de>
Cc: Philippe R?tornaz <philippe.retornaz@...l.ch>,
linux-arm-kernel@...ts.infradead.org,
maramaopercheseimorto@...il.com, sameo@...ux.intel.com,
s.hauer@...gutronix.de, linux-kernel@...r.kernel.org,
rpurdie@...ux.intel.com, valentin.longchamp@...l.ch
Subject: Re: [PATCH 1/2] mc13783: add LED support
On Mon, May 17, 2010 at 09:02:42PM +0200, Uwe Kleine-K?nig wrote:
> On Mon, May 17, 2010 at 06:40:22PM +0200, Philippe R?tornaz wrote:
> > +static void mc13783_led_set(struct led_classdev *led_cdev,
> > + enum led_brightness value)
> > +{
> > + struct mc13783_led *led;
> > +
> > + led = container_of(led_cdev, struct mc13783_led, cdev);
> > + led->new_brightness = value;
> > + schedule_work(&led->work);
> > +}
> I wonder why you don't set the registers directly here, but use a work
> struct instead.
The LED API allows clients to configure the LEDs from interrupt context
so for devices on blocking buses (like this) the driver needs to defer
the actual implementation of the change.
It'd be nice to add helpers for this to the LED core, there's quite a
few drivers implementing this idiom now - a flag that does the deferring
of the set() for example.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists