| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the backlight implementation stretches a brightness change over
a period of 100ms. While this is a fine default for PWM backlights, a user
might wish to change this slew time to meet other constraints or even
completely disable it for some backlight devices.
Add a parameter and provide the default value from the backlight device.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
xzalloc() either returns memory or panics, so checking for NULL is useless.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
Fixes: 87c6a88 video/backlight-pwm: fix the value of 'brightness_max'.
brightness_max should really contain the number of brightness steps, so
the number of elements in the brightness array.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'brightness-levels' in the device tree.
In case of an empty 'brightness-levels' array in the device tree or
a non empty one but containing only zeros the value of
'pwm_backlight->scale' would remain 0 possibly causing a division by zero
in the function compute_duty_cycle().
To fix it we check the computed value in case we actually have a 'brightness-levels'
array in the device tree otherwise we implicitly assume a simple array
of the form { 0, 1, 2, ..., 100 } and set the scale to 100.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
We use the local variable 'length' instead of the lengthy
'pwm_backlight->backlight.brightness_max' within pwm_backlight_parse_dt().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
In the function pwm_backlight_parse_dt() the last iteration of the for
loop accessed memory past the end of the array 'pwm_backlight->levels[]'
because of a wrong test ( '<=' instead of '<').
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
If probed from device tree we have an array of pwm duty cycle levels
in the brightness-levels property. Although the driver parsed the property,
the values have been ignored. Make use of these flags so that the driver
can work for example with inverted PWMs.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
| |
Inform the user when we can't find a pwm for the backlight driver.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
This adds a backlight driver for backlights controlled by a PWM.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|