diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2017-05-30 13:48:22 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2017-08-07 17:11:28 +0100 |
commit | 2606706e4d7b89ebf13f35895a7dfe00e394e782 (patch) | |
tree | a3622ee9a4e84cc45fdc95eeda5e6905edb464fa /drivers/video/backlight | |
parent | de7389003ab77fc63296b2adee4cd9c48dc41d5a (diff) |
backlight: gpio_backlight: Delete pdata inversion
The option to invert the output of the GPIO (active low) is
not used by the only platform still using platform data to
set up a GPIO backlight (one SH board). Delete the option
as we do not expect to expand the use of board files for
this driver, and GPIO descriptors intrinsically keep track
of any signal inversion.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/gpio_backlight.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 5ffaff1e4142..e470da95d806 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -25,7 +25,6 @@ struct gpio_backlight { struct device *fbdev; struct gpio_desc *gpiod; - int active; int def_value; }; @@ -39,8 +38,7 @@ static int gpio_backlight_update_status(struct backlight_device *bl) bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) brightness = 0; - gpiod_set_value_cansleep(gbl->gpiod, - brightness ? gbl->active : !gbl->active); + gpiod_set_value_cansleep(gbl->gpiod, brightness); return 0; } @@ -69,8 +67,6 @@ static int gpio_backlight_probe_dt(struct platform_device *pdev, gbl->def_value = of_property_read_bool(np, "default-on"); flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; - /* GPIO descriptors keep track of inversion */ - gbl->active = 1; gbl->gpiod = devm_gpiod_get(dev, NULL, flags); if (IS_ERR(gbl->gpiod)) { @@ -121,15 +117,8 @@ static int gpio_backlight_probe(struct platform_device *pdev) unsigned long flags = GPIOF_DIR_OUT; gbl->fbdev = pdata->fbdev; - gbl->active = pdata->active_low ? 0 : 1; gbl->def_value = pdata->def_value; - - if (gbl->active) - flags |= gbl->def_value ? - GPIOF_INIT_HIGH : GPIOF_INIT_LOW; - else - flags |= gbl->def_value ? - GPIOF_INIT_LOW : GPIOF_INIT_HIGH; + flags |= gbl->def_value ? GPIOF_INIT_HIGH : GPIOF_INIT_LOW; ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags, pdata ? pdata->name : "backlight"); |