From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Kim, Milo" <Milo.Kim@ti.com>
Cc: Bryan Wu <bryan.wu@canonical.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"sameo@linux.intel.com" <sameo@linux.intel.com>,
"Girdwood, Liam" <lrg@ti.com>,
"dwmw2@infradead.org" <dwmw2@infradead.org>,
Anton Vorontsov <cbouatmailru@gmail.com>,
Richard Purdie <rpurdie@rpsys.net>,
Andrew Morton <akpm@linux-foundation.org>,
"a.zummo@towertech.it" <a.zummo@towertech.it>
Subject: Re: [PATCH 6/6] leds: add new lp8788 led driver
Date: Wed, 18 Jul 2012 15:52:48 +0100 [thread overview]
Message-ID: <20120718145248.GC4495@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <A874F61F95741C4A9BA573A70FE3998FD7DE@DQHE02.ent.ti.com>
[-- Attachment #1: Type: text/plain, Size: 749 bytes --]
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...).
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-07-18 14:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 14:34 [PATCH 6/6] leds: add new lp8788 led driver Kim, Milo
2012-07-18 14:52 ` Mark Brown [this message]
2012-07-20 0:08 ` Bryan Wu
2012-07-20 8:57 ` Kim, Milo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120718145248.GC4495@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=Milo.Kim@ti.com \
--cc=a.zummo@towertech.it \
--cc=akpm@linux-foundation.org \
--cc=bryan.wu@canonical.com \
--cc=cbouatmailru@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=rpurdie@rpsys.net \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.