diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-14 10:34:33 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-14 10:34:33 -0800 |
commit | b14bf630be972aceb0c8981f9794e612cbb141f7 (patch) | |
tree | e0c50f281b671e816f609cda533507d228f1acd2 /drivers/video/backlight/gpio_backlight.c | |
parent | 7fdec82af6a9e190e53d07a1463d2a9ac49a8750 (diff) | |
parent | 60d613d6aef4ae49988eeb3ad38af948c561db1e (diff) |
Merge tag 'backlight-for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones:
Fix-ups:
- Take heed of GPIO default-on requests; gpio_backlight
- Enable DT probing; tps65217_bl
Bug Fixes:
- Free resources in error path; pwm_bl
- Fix uninitialised variable warning; adp8860_bl, adp8870_bl
- Protect unconditional DT look-ups from non-DT platforms; pwm_bl
- Fix backlight flicker; pwm_bl
* tag 'backlight-for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
backlight: pwm_bl: Free PWM requested by legacy API on error path
backlight: adp8860: Fix another uninitialized variable use
backlight: gpio-backlight: Use default-on on GPIO request
backlight: pwm_bl: Fix broken PWM backlight for non-dt platforms
backlight: tps65217_bl: Add MODULE_DEVICE_TABLE
backlight: pwm_bl: Avoid backlight flicker when probed from DT
backlight: adp88x0: Fix uninitialized variable use
Diffstat (limited to 'drivers/video/backlight/gpio_backlight.c')
-rw-r--r-- | drivers/video/backlight/gpio_backlight.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 5fbbc2ebdf93..18134416b154 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -89,6 +89,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) struct backlight_device *bl; struct gpio_backlight *gbl; struct device_node *np = pdev->dev.of_node; + unsigned long flags = GPIOF_DIR_OUT; int ret; if (!pdata && !np) { @@ -114,9 +115,12 @@ static int gpio_backlight_probe(struct platform_device *pdev) gbl->def_value = pdata->def_value; } - ret = devm_gpio_request_one(gbl->dev, gbl->gpio, GPIOF_DIR_OUT | - (gbl->active ? GPIOF_INIT_LOW - : GPIOF_INIT_HIGH), + if (gbl->active) + flags |= gbl->def_value ? GPIOF_INIT_HIGH : GPIOF_INIT_LOW; + else + flags |= gbl->def_value ? GPIOF_INIT_LOW : GPIOF_INIT_HIGH; + + ret = devm_gpio_request_one(gbl->dev, gbl->gpio, flags, pdata ? pdata->name : "backlight"); if (ret < 0) { dev_err(&pdev->dev, "unable to request GPIO\n"); |