aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-05-30 07:48:22 -0400
committerLee Jones <lee.jones@linaro.org>2017-08-07 12:11:28 -0400
commit2606706e4d7b89ebf13f35895a7dfe00e394e782 (patch)
treea3622ee9a4e84cc45fdc95eeda5e6905edb464fa
parentde7389003ab77fc63296b2adee4cd9c48dc41d5a (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>
-rw-r--r--drivers/video/backlight/gpio_backlight.c15
-rw-r--r--include/linux/platform_data/gpio_backlight.h1
2 files changed, 2 insertions, 14 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 {
25 struct device *fbdev; 25 struct device *fbdev;
26 26
27 struct gpio_desc *gpiod; 27 struct gpio_desc *gpiod;
28 int active;
29 int def_value; 28 int def_value;
30}; 29};
31 30
@@ -39,8 +38,7 @@ static int gpio_backlight_update_status(struct backlight_device *bl)
39 bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) 38 bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
40 brightness = 0; 39 brightness = 0;
41 40
42 gpiod_set_value_cansleep(gbl->gpiod, 41 gpiod_set_value_cansleep(gbl->gpiod, brightness);
43 brightness ? gbl->active : !gbl->active);
44 42
45 return 0; 43 return 0;
46} 44}
@@ -69,8 +67,6 @@ static int gpio_backlight_probe_dt(struct platform_device *pdev,
69 67
70 gbl->def_value = of_property_read_bool(np, "default-on"); 68 gbl->def_value = of_property_read_bool(np, "default-on");
71 flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; 69 flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
72 /* GPIO descriptors keep track of inversion */
73 gbl->active = 1;
74 70
75 gbl->gpiod = devm_gpiod_get(dev, NULL, flags); 71 gbl->gpiod = devm_gpiod_get(dev, NULL, flags);
76 if (IS_ERR(gbl->gpiod)) { 72 if (IS_ERR(gbl->gpiod)) {
@@ -121,15 +117,8 @@ static int gpio_backlight_probe(struct platform_device *pdev)
121 unsigned long flags = GPIOF_DIR_OUT; 117 unsigned long flags = GPIOF_DIR_OUT;
122 118
123 gbl->fbdev = pdata->fbdev; 119 gbl->fbdev = pdata->fbdev;
124 gbl->active = pdata->active_low ? 0 : 1;
125 gbl->def_value = pdata->def_value; 120 gbl->def_value = pdata->def_value;
126 121 flags |= gbl->def_value ? GPIOF_INIT_HIGH : GPIOF_INIT_LOW;
127 if (gbl->active)
128 flags |= gbl->def_value ?
129 GPIOF_INIT_HIGH : GPIOF_INIT_LOW;
130 else
131 flags |= gbl->def_value ?
132 GPIOF_INIT_LOW : GPIOF_INIT_HIGH;
133 122
134 ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags, 123 ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags,
135 pdata ? pdata->name : "backlight"); 124 pdata ? pdata->name : "backlight");
diff --git a/include/linux/platform_data/gpio_backlight.h b/include/linux/platform_data/gpio_backlight.h
index 5ae0d9c80d4d..683d90453c41 100644
--- a/include/linux/platform_data/gpio_backlight.h
+++ b/include/linux/platform_data/gpio_backlight.h
@@ -14,7 +14,6 @@ struct gpio_backlight_platform_data {
14 struct device *fbdev; 14 struct device *fbdev;
15 int gpio; 15 int gpio;
16 int def_value; 16 int def_value;
17 bool active_low;
18 const char *name; 17 const char *name;
19}; 18};
20 19