struct device *fbdev;
struct gpio_desc *gpiod;
- int active;
int def_value;
};
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;
}
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)) {
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");