summaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight-pwm.c
Commit message (Collapse)AuthorAgeFilesLines
* video: backlight: add slew time parameterLucas Stach2018-06-211-0/+1
| | | | | | | | | | | | 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>
* remove checks for xzalloc() returning NULLUwe Kleine-König2017-09-261-2/+0
| | | | | | | 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>
* video: backlight: fix the value of 'brightness_max'Sascha Hauer2016-08-291-1/+3
| | | | | | | | | 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>
* video/backlight-pwm: properly handle the case of an empty ↵iw3gtf@arcor.de2016-07-151-7/+13
| | | | | | | | | | | | | | | '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>
* video/backlight-pwm: code readability improvement.iw3gtf@arcor.de2016-07-151-6/+5
| | | | | | | 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>
* video/backlight-pwm: fix the value of 'brightness_max'.iw3gtf@arcor.de2016-07-151-1/+1
| | | | | | | | 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>
* video/backlight-pwm: fixed a loop index going out of range.iw3gtf@arcor.de2016-07-151-1/+1
| | | | | | | | 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>
* video: pwm-backlight: Honour discrete brightness levels from dtSascha Hauer2015-11-231-7/+20
| | | | | | | | | 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>
* video: backlight-pwm: Add regulator supportSascha Hauer2015-10-011-0/+13
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: backlight-pwm: Add error messageSascha Hauer2015-10-011-1/+3
| | | | | | Inform the user when we can't find a pwm for the backlight driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: Add PWM backlight supportSascha Hauer2015-06-121-0/+199
This adds a backlight driver for backlights controlled by a PWM. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>