summaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_fs.h
diff options
context:
space:
mode:
authorMatthias Kaehlcke <mka@chromium.org>2019-06-12 11:00:03 -0700
committerLee Jones <lee.jones@linaro.org>2019-06-27 07:09:05 +0100
commit73fbfc499448455f1e1c77717040e09e25f1d976 (patch)
tree52eda9b252823448aaaaf79db9379a2b896378c3 /include/linux/nfs_fs.h
parent98b7404eb7d64e55f8fdd419cb3965a8abf0e217 (diff)
downloadlinux-73fbfc499448455f1e1c77717040e09e25f1d976.tar.gz
linux-73fbfc499448455f1e1c77717040e09e25f1d976.tar.bz2
linux-73fbfc499448455f1e1c77717040e09e25f1d976.zip
backlight: pwm_bl: Fix heuristic to determine number of brightness levels
With commit 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of LED linearly to human eye") the number of set bits (aka hweight()) in the PWM period is used in the heuristic to determine the number of brightness levels, when the brightness table isn't specified in the DT. The number of set bits doesn't provide a reliable clue about the length of the period, instead change the heuristic to: nlevels = period / fls(period) Also limit the maximum number of brightness levels to 4096 to avoid excessively large tables. With this the number of levels increases monotonically with the PWM period, until the maximum of 4096 levels is reached: period (ns) # levels 100 16 500 62 1000 111 5000 416 10000 769 50000 3333 100000 4096 Fixes: 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of LED linearly to human eye") Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Acked-by: Daniel Thompson <daniel.thompson@linaro.org> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'include/linux/nfs_fs.h')
0 files changed, 0 insertions, 0 deletions