All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milo Kim <milo.kim@ti.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: linux-leds@vger.kernel.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Bo Shen <voice.shen@atmel.com>
Subject: Re: leds-pwm: issue in  __led_pwm_set()
Date: Sat, 28 Sep 2013 22:29:45 +0900	[thread overview]
Message-ID: <5246D9C9.80600@ti.com> (raw)
In-Reply-To: <5245E09A.2030400@free-electrons.com>

On 09/28/2013 04:46 AM, Alexandre Belloni wrote:
> On 27/09/2013 20:34, Alexandre Belloni wrote:
>>
>> Ok, I tested that and it seems to be working fine.
>>
>
> One last question though. What about power management ?
>
> For example, in pwm_bl, pwm_backlight_suspend calls:
>
>      pwm_config(pb->pwm, 0, pb->period);
>      pwm_disable(pb->pwm);
>
> Which is fine because it will correctly set up the PWM to a low level.

OK.

> Then, to disable the pwm itself and its clock, I suppose we would have
> to define some pm_ops in atmel_pwm, am I right ?

Maybe the suspend/resume() can be handled by the PWM driver.
However, not every PWM consumer of atmel-pwm needs the PM code.
I think it would be better if those are handled by each the PWM consumer.

> So we will have to be extra careful to correctly set a low level on the
> pin at that time.

If you only care about the leds-pwm, then no additional handling is 
required.
The LED subsystem provides a 'LED_CORE_SUSPENDRESUME' flag which enables 
the PM automatically.
The brightness is set to 0 forcedly on the suspend, and the stored 
brightness is recovered on the resume.
The leds-pwm driver enables this flag.
On the suspend mode, pwm_config() and pwm_disable() are called in 
__led_pwm_set(). That's exactly what you need.

Best regards,
Milo


      reply	other threads:[~2013-09-28 13:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-25 20:00 leds-pwm: issue in __led_pwm_set() Alexandre Belloni
2013-09-26  0:28 ` Milo Kim
2013-09-26  7:13   ` Alexandre Belloni
2013-09-26  7:34     ` Milo Kim
2013-09-26  7:48       ` Alexandre Belloni
2013-09-27 15:51         ` Milo Kim
2013-09-27 16:15           ` Alexandre Belloni
2013-09-27 17:23             ` Milo Kim
2013-09-27 17:33               ` Milo Kim
2013-09-27 18:34                 ` Alexandre Belloni
2013-09-27 19:46                   ` Alexandre Belloni
2013-09-28 13:29                     ` Milo Kim [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=5246D9C9.80600@ti.com \
    --to=milo.kim@ti.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=thierry.reding@gmail.com \
    --cc=voice.shen@atmel.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.