]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: ltc2309: explicitly assign hex values to channel enums
authorKyle Hsieh <kylehsieh1995@gmail.com>
Wed, 25 Mar 2026 02:24:21 +0000 (10:24 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 25 Mar 2026 19:48:45 +0000 (19:48 +0000)
commit999ca38066302347c94fda49db7a33ce87def5b6
tree3d40cfe2d312a6c396384dd4739a2aa8e1e8d82f
parent732df35bbb94c06099cf8c64076233347b278516
iio: adc: ltc2309: explicitly assign hex values to channel enums

The current ltc2309_channels enum relies on implicit sequential
assignment. While this works for the 8-channel LTC2309, it is
not intuitive and makes it difficult to support other chips in
the same family that might have different bit mappings.

Explicitly assign hex values to the enum members based on the
channel selection bits defined in the datasheet. This improves
code readability and provides a consistent pattern for future
chip support.

Signed-off-by: Kyle Hsieh <kylehsieh1995@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ltc2309.c