linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Erickson <marathon96@gmail.com>
To: Elvis Dowson <elvis.dowson@mac.com>
Cc: linux-omap Mailing List <linux-omap@vger.kernel.org>
Subject: Re: How to completely switch off LCD backlight
Date: Sun, 06 Feb 2011 10:58:09 -0800	[thread overview]
Message-ID: <C9742F41.23E44%marathon96@gmail.com> (raw)
In-Reply-To: <4732E696-B597-4BCE-A0E9-E60E30A7F94D@mac.com>

On 2/6/11 9:53 AM, Elvis Dowson wrote:
> On Feb 6, 2011, at 9:30 PM, Grant Erickson wrote:
>> The following script should be instructive:
>> 
>>    device="/sys/devices/platform/pwm-backlight.0/backlight/pwm-backlight.0"
> 
> For me, this is located in /sys/class/backlight/beagleboard
> 
> and bl_power is located in /sys/class/backlight/beagleboard
> 
>>    power="${device}/bl_power"
>>    brightness="${device}/brightness"
>>    max="${device}/max_brightness"
>> 
>> 
>>    disable_backlight () {
>>        echo 1 > ${power}
>>    }
>> 
>>    enable_backlight () {
>>        echo 0 > ${power}
>>    }
> 
> I did try
> 
> echo 1 > bl_power
> 
> but there was no effect. GPIO 96 from the OMAP3503 is physically connected to
> LCD LED backlight enable, which I think is what would be used to turn the
> backlight on/off.
> 
> Where can I specify the mapping of GPIO 96 to the bl_power file, so that the
> LCD backlight can be switched off?

Elvis:

If you are using the generic pwm-bl.c driver and you are using something
akin to:

    http://www.mail-archive.com/linux-omap@vger.kernel.org/msg38559.html

handle the PWM, then you likely need to perform gpio_set_value in your
platform-specific notify callback.

When using the pwm-bl.c driver (or likely any other than uses the generic
backlight class), bl_power toggles the on/off state of the backlight YET
preserves the current brightness level of the backlight.

So, if your backlight is on at 50% and you turn it off with bl_power, when
you turn it back on again with bl_power, it'll return to 50%.

In the pwm-bl.c driver, this all happens with pwm-config(). So, in your
notify callback, when you get a brightness value of zero, you'll call
gpio_set_value(96, 0)--assuming your enable signal is active high. Likewise,
when you get a brightness value of non-zero, you'll call gpio_set_value(96,
1)--again, assuming your enable signal is active high.

The generic PWM device is then handling the level then the enable GPIO is
asserted (which, again, you are controlling in your notify callback).

Best,

Grant

> 
> Elvis
> 
> 
> 



      parent reply	other threads:[~2011-02-06 18:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0617A24A-1BF3-40E0-B36E-017423BB5DF1@mac.com>
2011-02-06 17:30 ` How to completely switch off LCD backlight Grant Erickson
     [not found]   ` <4732E696-B597-4BCE-A0E9-E60E30A7F94D@mac.com>
2011-02-06 18:41     ` Gregoire Gentil
2011-02-06 18:58     ` Grant Erickson [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=C9742F41.23E44%marathon96@gmail.com \
    --to=marathon96@gmail.com \
    --cc=elvis.dowson@mac.com \
    --cc=linux-omap@vger.kernel.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).