Skip to content

Commit

Permalink
pwm-backlight: Add optional enable GPIO
Browse files Browse the repository at this point in the history
To support a wider variety of backlight setups, introduce an optional
enable GPIO. Legacy users of the platform data already have a means of
supporting GPIOs by using the .init(), .exit() and .notify() hooks. DT
users however cannot use those, so an alternative method is required.

In order to ease the introduction of the optional enable GPIO, make it
available in the platform data first, so that existing users can be
converted. Once that has happened a second patch will add code to make
use of it in the driver.

Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
Thierry Reding authored and Thierry Reding committed Oct 16, 2013
1 parent 97c3843 commit 2b9b162
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/linux/pwm_backlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@

#include <linux/backlight.h>

/* TODO: convert to gpiod_*() API once it has been merged */
#define PWM_BACKLIGHT_GPIO_ACTIVE_LOW (1 << 0)

struct platform_pwm_backlight_data {
int pwm_id;
unsigned int max_brightness;
unsigned int dft_brightness;
unsigned int lth_brightness;
unsigned int pwm_period_ns;
unsigned int *levels;
int enable_gpio;
unsigned long enable_gpio_flags;
int (*init)(struct device *dev);
int (*notify)(struct device *dev, int brightness);
void (*notify_after)(struct device *dev, int brightness);
Expand Down

0 comments on commit 2b9b162

Please sign in to comment.