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:09 AM, Elvis Dowson wrote:
>        I've got LCD backlight brightness control working with a custom
> beagleboard design, with the LCD backlight pwm control signal connected to
> OMAP3503's gpt9_pwm_evt timer.
> 
> GPIO 96 is connected to the LCD LED enable pin for controlling the on/off for
> the LCD backlight.
> 
> I also see a bl_power file in /sys/class/backlight/beagleboard/ folder.
> 
> # ls /sys/class/backlight/beagleboard
> uevent
> subsystem
> bl_power
> brightness
> actual_brightness
> max_brightness
> boost
> pwm_fq
> min_duty
> power
> 
> I want to be able to fully turn the LCD backlight on and off. How do I map
> GPIO 96 to bl_power?
> 
> Right now, if I blank the LCD using the following command, it gives me a white
> screen, but the backlight doesn't turn off
> 
> $ echo 1 > /sys/class/graphics/fb0/blank

Elvis:

The following script should be instructive:

    device="/sys/devices/platform/pwm-backlight.0/backlight/pwm-backlight.0"
    power="${device}/bl_power"
    brightness="${device}/brightness"
    max="${device}/max_brightness"

    usage () {
        echo "Usage `basename ${0}` [[ --enable | --disable ] | --max | [
brightness ]]"
    
        exit ${1}
    }

    get_brightness () {
        cat ${brightness}
    }

    set_brightness () {
        echo ${1} > ${brightness}
    }

    max_brightness () {
        cat ${max}
    }

    disable_backlight () {
        echo 1 > ${power}
    }

    enable_backlight () {
        echo 0 > ${power}
    }

    if [ $# -eq 1 ]; then
        if [ "${1}" = "--enable" ]; then
            enable_backlight
        elif [ "${1}" = "--disable" ]; then
            disable_backlight
        elif [ "${1}" = "--max" ]; then
            max_brightness
        else
            set_brightness ${1}
        fi
    else
        get_brightness
    fi

Best,

Grant


--
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