linux/drivers/iio/dac
Tuna Kılıç ef7707c1b7 iio: dac: mcp47a1: Allow full-scale output
The MCP47A1 has 64 resistors but exposes 65 wiper positions. The valid
DAC codes are 0 through 64, and code 64 selects VREF.

The driver currently advertises 0 through 63 and uses 64 as the length
argument to in_range(), which also rejects 64. Therefore userspace
cannot select full-scale output.

Advertise code 64 and make validation cover all 65 codes. Keep 64 as
the scale denominator because the output voltage is VREF multiplied by
the code and divided by 64.

Fixes: 350d1fb920 ("iio: dac: mcp47a1: add support for new device")
Signed-off-by: Tuna Kılıç <tuna@tunakilic.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Tested-by: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
History 2026-09-06 22:48:38 +01:00
..
ad3530r.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ad3552r-common.c iio: dac: ad3552r-hs: add debugfs reg access 2025-04-22 19:09:53 +01:00
ad3552r-hs.c IIO: 2nd set of fixes for the 7.2 cycle. 2026-08-19 09:43:39 +02:00
ad3552r-hs.h iio: dac: adi-axi-dac: add bus mode setup 2025-02-08 15:10:11 +00:00
ad3552r.c iio: dac: ad3552r: Use devm_mutex_init() 2026-04-27 09:58:22 +01:00
ad3552r.h iio: dac: ad3552r-hs: add debugfs reg access 2025-04-22 19:09:53 +01:00
ad5064.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5360.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5380.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5421.c iio: dac: ad5421: use int type to store negative error codes 2025-09-01 20:43:43 +01:00
ad5446-i2c.c IIO: 2nd set of fixes for the 7.2 cycle. 2026-08-19 09:43:39 +02:00
ad5446-spi.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ad5446.c iio: dac: ad5446: Fix coding style issues 2025-11-09 16:31:22 +00:00
ad5446.h iio: dac: ad5446: Refactor header inclusion 2025-11-09 16:30:47 +00:00
ad5449.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5504.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5592r-base.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
ad5592r-base.h iio: dac: ad5592r: Fix alignment for DMA safety 2022-06-14 11:53:16 +01:00
ad5592r.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ad5593r.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ad5624r.h iio: dac: ad5624r: Drop docs of missing members 2024-12-28 14:28:13 +00:00
ad5624r_spi.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5686-spi.c iio: dac: ad5686: extend device support with new parts 2026-07-27 22:13:08 +01:00
ad5686.c iio: dac: ad5686: extend device support with new parts 2026-07-27 22:13:08 +01:00
ad5686.h iio: dac: ad5686: extend device support with new parts 2026-07-27 22:13:08 +01:00
ad5696-i2c.c iio: dac: ad5686: extend device support with new parts 2026-07-27 22:13:08 +01:00
ad5706r.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ad5755.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5758.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ad5761.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5764.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5766.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad5770r.c iio: Drop unused assignment of spi_device_id driver data 2026-06-30 00:15:56 +01:00
ad5791.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad7293.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ad7303.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ad8460.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ad8801.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ad9739a.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
adi-axi-dac.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
cio-dac.c 1st set of IIO new device support, features and cleanups for the 6.4 cycle. 2023-04-12 09:45:34 +02:00
dpot-dac.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ds4424.c iio: Initialize i2c_device_id arrays using member names 2026-05-31 11:01:46 +01:00
Kconfig IIO new device support, features, cleanup for 7.3 2026-08-19 09:45:01 +02:00
lpc18xx_dac.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ltc1660.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ltc2632.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ltc2664.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ltc2688.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
m62332.c iio: dac: m62332: Fix regulator reference count imbalance 2026-07-11 23:33:52 +01:00
Makefile iio: dac: mcp47a1: add support for new device 2026-08-05 01:09:56 +01:00
max517.c iio: Initialize i2c_device_id arrays using member names 2026-05-31 11:01:46 +01:00
max5522.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
max5821.c Linux 7.1-rc6 2026-06-02 15:24:19 +01:00
max22007.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
mcf54415_dac.c iio: dac: add mcf54415 DAC 2026-07-01 18:58:22 +01:00
mcp47a1.c iio: dac: mcp47a1: Allow full-scale output 2026-09-06 22:48:38 +01:00
mcp47feb02.c Android/IIO bugfixes for 7.2-rc3 2026-07-12 12:37:28 -07:00
mcp4725.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
mcp4728.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
mcp4821.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
mcp4922.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
rohm-bd79703.c iio: dac: rohm-bd79703: Do not allow writing SCALE 2026-08-31 00:52:41 +01:00
stm32-dac-core.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
stm32-dac-core.h iio: stm32: Adopt SPDX identifier 2018-01-08 16:03:41 +01:00
stm32-dac.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ti-dac082s085.c Linux 7.2-rc2 2026-07-06 16:59:47 +01:00
ti-dac5571.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ti-dac7311.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
ti-dac7612.c iio: Initialize spi_device_id arrays using member names 2026-06-30 00:15:56 +01:00
vf610_dac.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00