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 09:30:29 -0800	[thread overview]
Message-ID: <C9741AB5.23E3E%marathon96@gmail.com> (raw)
In-Reply-To: <0617A24A-1BF3-40E0-B36E-017423BB5DF1@mac.com>

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



       reply	other threads:[~2011-02-06 17:30 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 ` Grant Erickson [this message]
     [not found]   ` <4732E696-B597-4BCE-A0E9-E60E30A7F94D@mac.com>
2011-02-06 18:41     ` How to completely switch off LCD backlight Gregoire Gentil
2011-02-06 18:58     ` Grant Erickson

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=C9741AB5.23E3E%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).