All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Felipe Balbi <felipebalbi@users.sourceforge.net>
Cc: linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH] LED: OMAP PWM: Use work queue for brightness
Date: Wed, 14 Nov 2007 18:07:10 -0800	[thread overview]
Message-ID: <20071115020710.GE6005@atomide.com> (raw)
In-Reply-To: <31e679430710300300g51d65e89g6a9fdf2aeccb65ca@mail.gmail.com>

* Felipe Balbi <felipebalbi@users.sourceforge.net> [071030 03:01]:
> Hi,
> 
> On 10/30/07, Daniel Stone <daniel.stone@nokia.com> wrote:
> > It isn't safe to schedule from a LED brightness_set handler, so use a work queue.
> >
> > Signed-off-by: Daniel Stone <daniel.stone@nokia.com>
> > ---
> >  drivers/leds/leds-omap-pwm.c |   22 ++++++++++++++++++++--
> >  1 files changed, 20 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/leds/leds-omap-pwm.c b/drivers/leds/leds-omap-pwm.c
> > index 6b195d6..c5d7ff0 100644
> > --- a/drivers/leds/leds-omap-pwm.c
> > +++ b/drivers/leds/leds-omap-pwm.c

<snip>


> > @@ -134,9 +142,17 @@ static void omap_pwm_led_set(struct led_classdev *led_cdev,
> >  {
> >         struct omap_pwm_led *led = cdev_to_omap_pwm_led(led_cdev);
> >
> > -       if (value != LED_OFF) {
> > +       led->brightness = value;
> > +       schedule_work(&led->work);
> > +}
> > +
> > +static void omap_pwm_led_work(struct work_struct *work)
> > +{
> > +       struct omap_pwm_led *led = work_to_omap_pwm_led(work);
> > +
> > +       if (led->brightness != LED_OFF) {
> >                 omap_pwm_led_power_on(led);
> > -               omap_pwm_led_set_pwm_cycle(led, value);
> > +               omap_pwm_led_set_pwm_cycle(led, led->brightness);
> >         } else {
> >                 omap_pwm_led_power_off(led);
> >         }
> > @@ -228,6 +244,8 @@ static int omap_pwm_led_probe(struct platform_device *pdev)
> >         led->cdev.default_trigger = NULL;
> >         led->cdev.name = pdata->name;
> >         led->pdata = pdata;
> > +       led->brightness = 0;
> 
> led->brightness = LED_OFF;
> would look better.
> 
> besides the patch looks ok to me.

Pushing with Felipe's suggestion for LED_OFF.

Tony

      reply	other threads:[~2007-11-15  2:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30  9:37 [PATCH] LED: OMAP PWM: Use work queue for brightness Daniel Stone
2007-10-30 10:00 ` Felipe Balbi
2007-11-15  2:07   ` Tony Lindgren [this message]

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=20071115020710.GE6005@atomide.com \
    --to=tony@atomide.com \
    --cc=felipebalbi@users.sourceforge.net \
    --cc=linux-omap-open-source@linux.omap.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.