diff options
author | Thierry Reding <treding@nvidia.com> | 2014-06-04 12:09:55 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-06-04 12:09:55 +0200 |
commit | 95c78747479a16317481c8cbac75b8c214c7979c (patch) | |
tree | 29fbac67de071b29c6bd3a6001b5fb86f2d689f8 | |
parent | c65cb03c5d75f1f5eb8399bed83ff590a44785c9 (diff) | |
parent | a08e2c98044bd544eda4e880244ef409cd15c7d4 (diff) |
Merge branch 'staging/pwm' into staging/master
-rw-r--r-- | Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt | 1 | ||||
-rw-r--r-- | drivers/video/backlight/pwm_bl.c | 9 | ||||
-rw-r--r-- | include/linux/pwm_backlight.h | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt index 764db86d441..65e001a1733 100644 --- a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt +++ b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt @@ -17,6 +17,7 @@ Optional properties: "pwms" property (see PWM binding[0]) - enable-gpios: contains a single GPIO specifier for the GPIO which enables and disables the backlight (see GPIO binding[1]) + - backlight-boot-off: keep the backlight disabled on boot [0]: Documentation/devicetree/bindings/pwm/pwm.txt [1]: Documentation/devicetree/bindings/gpio/gpio.txt diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 38ca88bc5c3..6b33d39e46c 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -148,6 +148,7 @@ static int pwm_backlight_parse_dt(struct device *dev, return -ENODEV; memset(data, 0, sizeof(*data)); + data->pwm_id = -1; /* determine the number of brightness levels */ prop = of_find_property(node, "brightness-levels", &length); @@ -179,6 +180,8 @@ static int pwm_backlight_parse_dt(struct device *dev, data->max_brightness--; } + data->boot_off = of_property_read_bool(node, "backlight-boot-off"); + return 0; } @@ -326,6 +329,12 @@ static int pwm_backlight_probe(struct platform_device *pdev) } bl->props.brightness = data->dft_brightness; + + if (data->boot_off) + bl->props.power = FB_BLANK_POWERDOWN; + else + bl->props.power = FB_BLANK_UNBLANK; + backlight_update_status(bl); platform_set_drvdata(pdev, bl); diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index efdd9227a49..1fc14989da4 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h @@ -15,6 +15,8 @@ struct platform_pwm_backlight_data { unsigned int *levels; /* TODO remove once all users are switched to gpiod_* API */ int enable_gpio; + bool boot_off; + int (*init)(struct device *dev); int (*notify)(struct device *dev, int brightness); void (*notify_after)(struct device *dev, int brightness); |