]> Gentwo Git Trees - linux/.git/commit
iio: adc: ad7124: Refuse invalid input specifiers
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Fri, 6 Dec 2024 17:28:34 +0000 (18:28 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 11 Dec 2024 19:20:47 +0000 (19:20 +0000)
commit9ecad7f404b57d8a544c3211cf87a6284e49f4fd
tree46bdaa3cfae25e44942325716f49a4ae9d9d3c8b
parentcc597af18092d0e84ccb108c8e4aa0beea26634d
iio: adc: ad7124: Refuse invalid input specifiers

The ad7124-4 has 8 analog inputs; the input select values 8 to 15 are
reserved and not to be used. These are fine for ad7124-8. For both
ad7124-4 and ad7124-8 values bigger than 15 are internal channels that
might appear as inputs in the channels specified in the device
description according to the description of commit f1794fd7bdf7 ("iio:
adc: ad7124: Remove input number limitation"), values bigger than 31
don't fit into the respective register bit field and the driver masked
them to smaller values.

Check for these invalid input specifiers and fail to probe if one is
found.

Fixes: f1794fd7bdf7 ("iio: adc: ad7124: Remove input number limitation")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/80e3bd629d2b755ab5e061c8731dafa57d08698a.1733504533.git.u.kleine-koenig@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7124.c