linux/drivers/iio/proximity
Stephen Boyd b8653aff1c iio: sx9310: Fix semtech,avg-pos-strength setting when > 16
This DT property can be 0, 16, and then 64, but not 32. The math here
doesn't recognize this slight bump in the power of 2 numbers and
translates a DT property of 64 into the register value '3' when it
really should be '2'. Fix it by subtracting one more if the number being
translated is larger than 31. Also use clamp() because we're here.

Cc: Daniel Campello <campello@chromium.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Evan Green <evgreen@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20201202200252.986230-1-swboyd@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-14 21:01:22 +00:00
..
as3935.c iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors 2020-09-21 18:41:33 +01:00
isl29501.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
Kconfig iio: proximity: Add driver support for vcnl3020 proximity sensor 2020-05-21 19:12:42 +01:00
Makefile iio: proximity: Add driver support for vcnl3020 proximity sensor 2020-05-21 19:12:42 +01:00
mb1232.c iio:proximity:mb1232: Fix timestamp alignment and prevent data leak. 2020-08-22 11:38:54 +01:00
ping.c iio: remove left-over parent assignments 2020-06-14 11:50:04 +01:00
pulsedlight-lidar-lite-v2.c iio:proximity:pulsedlight: Drop of_match_ptr protection 2020-09-21 18:41:33 +01:00
rfd77402.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
srf04.c Replace HTTP links with HTTPS ones: drivers/iio 2020-07-13 15:05:59 +01:00
srf08.c Replace HTTP links with HTTPS ones: drivers/iio 2020-07-13 15:05:59 +01:00
sx9310.c iio: sx9310: Fix semtech,avg-pos-strength setting when > 16 2021-01-14 21:01:22 +00:00
sx9500.c iio: Move attach/detach of the poll func to the core 2020-06-20 17:34:44 +01:00
vcnl3020.c iio: remove left-over parent assignments 2020-06-14 11:50:04 +01:00
vl53l0x-i2c.c iio: proximity: vl53l0x-i2c add i2c_device_id 2020-11-01 15:28:32 +00:00