linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: acourbot@nvidia.com (Alex Courbot)
To: linux-arm-kernel@lists.infradead.org
Subject: Devicetree node to turn off LCD when backlight is 'disabled'
Date: Tue, 12 Feb 2013 16:35:56 +0900	[thread overview]
Message-ID: <5119F0DC.1010109@nvidia.com> (raw)
In-Reply-To: <1360563905.4130.6.camel@gitbox>

On 02/11/2013 03:25 PM, Tony Prisk wrote:
> I was just wondering if the following would be an acceptable way to turn
> off an lcd backlight when the pwm-backlight driver is set to level 0.
> The LCD backlight is 'powered' by the gpio.
>
> leds {
> 	compatible = "gpio-leds";
> 	backlight {
> 		label = "lcd-power";
> 		gpios = <&gpio 0 0 0>;  /* bank pin active_low */
> 		linux,default-trigger = "backlight";
> 		default-state = "on";
> 	};
> };

This would work... for the most common case of a FB blank event (as 
gpio-leds will be notified of it and switch your GPIO on/off according 
to the kind of event). There are a few drawbacks however:

1) You will have no control over the order of your power sequence. 
pwm-backlight also uses FB notifications to switch the PWM on/off. Which 
one will happen first will depend on the registration order.

2) This will only work on FB blank events. For instance, if someone 
writes "0" into the "brightness" property of your backlight's sysfs 
node, no FB blank event will be emitted and your GPIO will remain on.

Also this solution works for the simple case where you control the 
backlight using only a GPIO. It would be good to support more complex 
cases as well (I have to handle a GPIO and a regulator, for instance).

The "correct" way of doing this would be to let the pwm-backlight driver 
(or even the backlight framework) control the power status of the 
backlight itself. You can do this using the platform callbacks of 
pwm-backlight, but this will require a custom panel. Another possibility 
would be to use the power sequence framework within the backlight 
drivers, but I need to rewrite it first.

So as an ad-hoc solution, what you propose would certainly work - 
however I think this is a good opportunity to try and solve this problem 
more globally. Maybe we can start discussing about Power Sequences 2.0. :)

Alex.

  parent reply	other threads:[~2013-02-12  7:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11  6:25 Devicetree node to turn off LCD when backlight is 'disabled' Tony Prisk
2013-02-12  7:04 ` Thierry Reding
2013-02-12  8:26   ` Tony Prisk
2013-02-12  7:35 ` Alex Courbot [this message]
2013-02-12 18:05   ` Grant Likely

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=5119F0DC.1010109@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).