]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: iio: ad5933: Correct settling cycles encoding per datasheet
authorGabriel Shahrouzi <gshahrouzi@gmail.com>
Sun, 20 Apr 2025 01:30:09 +0000 (21:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:26 +0000 (11:05 +0100)
commit2ec9fda98d1a043f8e0369dc56deb45554462db6
tree45de8811bc0f4dfcf2526b74f701ca110361d6b9
parent9da3e442714f7f4393ff01c265c4959c03e88c2f
staging: iio: ad5933: Correct settling cycles encoding per datasheet

commit 60638e2a2d4bc03798f00d5ab65ce9b83cb8b03b upstream.

The AD5933 datasheet (Table 13) lists the maximum cycles to be 0x7FC
(2044).

Clamp the user input to the maximum effective value of 0x7FC cycles.

Fixes: f94aa354d676 ("iio: impedance-analyzer: New driver for AD5933/4 Impedance Converter, Network Analyzer")
Cc: stable@vger.kernel.org
Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://patch.msgid.link/20250420013009.847851-1-gshahrouzi@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/impedance-analyzer/ad5933.c