From: Thierry Reding <thierry.reding@avionic-design.de>
To: Andrew Chew <achew@nvidia.com>
Cc: acourbot@nvidia.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1 v2] pwm_bl: Add support for backlight enable GPIO
Date: Tue, 5 Mar 2013 08:10:43 +0100 [thread overview]
Message-ID: <20130305071043.GB7212@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <1362458630-31576-1-git-send-email-achew@nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 2236 bytes --]
On Mon, Mar 04, 2013 at 08:43:50PM -0800, Andrew Chew wrote:
> The backlight enable GPIO is specified in the device tree node for
> backlight.
>
> Signed-off-by: Andrew Chew <achew@nvidia.com>
> ---
> I decided to go ahead with disabling/enabling the backlight via GPIO as
> needed. Note that I named the new functions pwm_backlight_enable() and
> pwm_backlight_disable() (instead of something more gpio-specific) because
> I thought it would be convenient to have a generic hook for when someone
> wants to add yet more stuff to be done on enable/disable.
>
> I tested this by going into /sys/class/backlight/backlight.n and manually
> adjusting the brightness, and checked the gpio state to see that it had
> the appropriate value.
>
> .../bindings/video/backlight/pwm-backlight.txt | 2 +
> drivers/video/backlight/pwm_bl.c | 50 ++++++++++++++++++--
> include/linux/pwm_backlight.h | 2 +
> 3 files changed, 50 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
> index 1e4fc72..1ed4f0f 100644
> --- a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
> +++ b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
> @@ -14,6 +14,8 @@ Required properties:
> Optional properties:
> - pwm-names: a list of names for the PWM devices specified in the
> "pwms" property (see PWM binding[0])
> + - enable-gpio: a GPIO that needs to be used to enable the backlight
According to Documentation/devicetree/bindings/gpio/gpio.txt this should
be called "enable-gpios".
> + - enable-gpio-active-high: polarity of GPIO is active high (default is low)
There is OF_GPIO_ACTIVE_LOW, which is automatically parsed from the
second cell of a GPIO specifier. It will only work if you request the
GPIO using of_get_named_gpio_flags(), though, so it will only work in
the non-DT case.
I think using a regulator would be more appropriate, since it gives you
more flexibility than a plain GPIO. Does anybody see a problem with
using a regulator instead?
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2013-03-05 7:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 4:43 Andrew Chew
2013-03-05 5:14 ` Alex Courbot
2013-03-05 7:10 ` Thierry Reding [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=20130305071043.GB7212@avionic-0098.mockup.avionic-design.de \
--to=thierry.reding@avionic-design.de \
--cc=achew@nvidia.com \
--cc=acourbot@nvidia.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®