backlight: pwm_bl: Set scale type for brightness curves specified in the DT
authorMatthias Kaehlcke <mka@chromium.org>
Tue, 9 Jul 2019 19:00:07 +0000 (12:00 -0700)
committerLee Jones <lee.jones@linaro.org>
Mon, 2 Sep 2019 14:55:15 +0000 (15:55 +0100)
commitc0b64faf0fe6ca2574a00faed1ae833130db4e08
treef5aa40f18d08c3a944ad2005b65c3a0f7de39383
parent511a204638d7d750f859c332635d09f38273b4f0
backlight: pwm_bl: Set scale type for brightness curves specified in the DT

Check if a brightness curve specified in the device tree is linear or
not and set the corresponding property accordingly. This makes the
scale type available to userspace via the 'scale' sysfs attribute.

To determine if a curve is linear it is compared to a interpolated linear
curve between min and max brightness. The curve is considered linear if
no value deviates more than +/-5% of ${brightness_range} from their
interpolated value.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/pwm_bl.c