video/backlight-pwm: fix the value of 'brightness_max'.
The field pwm_backlight->backlight.brightness_max should be the maximum allowed brightness value for the backlight, not the max index of the array 'pwm_backlight->levels[]'. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
c27b1a93ce
commit
87c6a88f2a
|
@ -160,7 +160,7 @@ static int pwm_backlight_parse_dt(struct device_d *dev,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
pwm_backlight->backlight.brightness_default = value;
|
pwm_backlight->backlight.brightness_default = value;
|
||||||
pwm_backlight->backlight.brightness_max--;
|
pwm_backlight->backlight.brightness_max = pwm_backlight->scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
pwm_backlight->enable_gpio = of_get_named_gpio_flags(node, "enable-gpios", 0, &flags);
|
pwm_backlight->enable_gpio = of_get_named_gpio_flags(node, "enable-gpios", 0, &flags);
|
||||||
|
|
Loading…
Reference in New Issue