diff options
| author | Oleksij Rempel <o.rempel@pengutronix.de> | 2026-02-10 16:51:07 +0300 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2026-03-22 15:43:48 +0300 |
| commit | 8d68801a696ce101349db6896c10afb5f8d1c228 (patch) | |
| tree | a01b9c580d605d78d329a3da68e3a1a8c249240a /include/linux/moduleloader.h | |
| parent | 1fa14dd130fae3feccdde112ed26f48042cf5d7b (diff) | |
| download | linux-8d68801a696ce101349db6896c10afb5f8d1c228.tar.xz | |
iio: dac: ds4424: support per-variant output range limits
The DS4402/DS4404 variants operate with a 5-bit resolution (31 steps),
whereas the DS4422/DS4424 support 7-bit (127 steps).
Previously, the driver enforced a hardcoded 7-bit mask (DS4424_DAC_MASK)
for all variants. This allowed users to write values exceeding the 5-bit
range to DS4402/DS4404 devices, resulting in silent truncation or
undefined behavior.
Add a `result_mask` field to the chip_info structure to define the valid
data range for each variant. Use this mask to:
1. Correctly mask register values in read_raw().
2. Return -EINVAL in write_raw() if the input value exceeds the
variant's capabilities.
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>
Diffstat (limited to 'include/linux/moduleloader.h')
0 files changed, 0 insertions, 0 deletions
