]> git.ipfire.org Git - thirdparty/linux.git/commit
iio: dac: ds4424: use device match data for chip info
authorOleksij Rempel <o.rempel@pengutronix.de>
Tue, 10 Feb 2026 13:51:03 +0000 (14:51 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 22 Mar 2026 12:43:22 +0000 (12:43 +0000)
commit37840446078b47e49ea97dd2a6f20cb5ecd44483
tree7d1d8ec9ded33199ed95c021e29ae3f317bcb9b6
parentd2d5a6cb288ad3d9fb327feb39f478dc40ec9f9c
iio: dac: ds4424: use device match data for chip info

Refactor the driver to use device match data instead of checking ID enums
in a switch statement.

Define a `ds4424_chip_info` structure to hold variant-specific attributes
(currently just the channel count) and attach it directly to the I2C and
OF device ID tables.

This simplifies the probe function and makes it easier to add support for
new variants like DS4402/DS4404.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ds4424.c