]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: amplifiers: ad8366: prepare for device-tree support
authorRodrigo Alencar <rodrigo.alencar@analog.com>
Mon, 16 Feb 2026 17:10:52 +0000 (17:10 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 21:00:58 +0000 (21:00 +0000)
commit314b184b8202563b41317132c8aeb79fc10e14f7
tree50a9ca8d0403ac816d5f9432522b081b437e4d0a
parentee4f8c56e46abd4bfeab1cee96cd391c0b7a3e4a
iio: amplifiers: ad8366: prepare for device-tree support

Drop switch case on the enum ID in favor of extended chip info table,
containing:
- gain_step, indicating with sign the start of the code range;
- num_channels, to indicate the number IIO channels;
- pack_code() function to describe how SPI buffer is populated;

Which allowed for a simplified read_raw() and write_raw() callbacks. The
probe() function was adjusted accordingly. The linux/array_size.h include
is removed as number of channels is provided by chip info table.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/amplifiers/ad8366.c