Re: How to completely switch off LCD backlight

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx/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
> 
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux