[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120718145248.GC4495@opensource.wolfsonmicro.com>
Date: Wed, 18 Jul 2012 15:52:48 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: "Kim, Milo" <Milo.Kim@...com>
Cc: Bryan Wu <bryan.wu@...onical.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"sameo@...ux.intel.com" <sameo@...ux.intel.com>,
"Girdwood, Liam" <lrg@...com>,
"dwmw2@...radead.org" <dwmw2@...radead.org>,
Anton Vorontsov <cbouatmailru@...il.com>,
Richard Purdie <rpurdie@...ys.net>,
Andrew Morton <akpm@...ux-foundation.org>,
"a.zummo@...ertech.it" <a.zummo@...ertech.it>
Subject: Re: [PATCH 6/6] leds: add new lp8788 led driver
On Wed, Jul 18, 2012 at 02:34:02PM +0000, Kim, Milo wrote:
> +static void lp8788_brightness_set(struct led_classdev *led_cdev,
> + enum led_brightness brt_val)
> +{
> + struct lp8788_led *led =
> + container_of(led_cdev, struct lp8788_led, led_dev);
> + enum lp8788_isink_number num = led->isink_num;
> + int enable;
> +
> + switch (num) {
> + case LP8788_ISINK_1:
> + case LP8788_ISINK_2:
> + case LP8788_ISINK_3:
> + lp8788_write_byte(led->lp, lp8788_pwm_addr[num], brt_val);
The brightness_set() (and other) callbacks can be called from atomic
context so you can't interact with an I2C device here, you need to
defer to a workqueue or something (and ideally factor this out into the
framework so we don't need to keep open coding it...).
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists