lkml.org 
[lkml]   [2013]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1 v2] pwm_bl: Add support for backlight enable GPIO
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-03-05 09:21    [W:0.045 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site