[PATCH v3 3/3] iio: dac: ltc2632: add support for LTC2654 DAC family

From: David Marinović

Date: Fri Mar 20 2026 - 11:16:22 EST


From: David Marinovic <david.marinovic@xxxxxxxx>

Add support for the Linear Technology LTC2654 quad DAC family.

The LTC2654 is a 4-channel, 16-/12-bit DAC with SPI interface,
sharing the same 24-bit SPI protocol as the existing LTC2632/
LTC2634/LTC2636 devices supported by this driver.

The 12-bit variants of LTC2654 reuse existing LTC2634 chip_info
structs as they are register-compatible.

Add support for the following variants:
- LTC2654L-16: 16-bit, 2.5V internal reference
- LTC2654L-12: 12-bit, 2.5V internal reference
- LTC2654H-16: 16-bit, 4.096V internal reference
- LTC2654H-12: 12-bit, 4.096V internal reference

Signed-off-by: David Marinovic <david.marinovic@xxxxxxxx>
---
drivers/iio/dac/ltc2632.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
index ca0b88285ce5..33b8ff78c6e3 100644
--- a/drivers/iio/dac/ltc2632.c
+++ b/drivers/iio/dac/ltc2632.c
@@ -58,8 +58,9 @@ static int ltc2632_spi_write(struct spi_device *spi,
* The input shift register is 24 bits wide.
* The next four are the command bits, C3 to C0,
* followed by the 4-bit DAC address, A3 to A0, and then the
- * 12-, 10-, 8-bit data-word. The data-word comprises the 12-,
- * 10-, 8-bit input code followed by 4, 6, or 8 don't care bits.
+ * 16-, 12-, 10-, 8-bit data-word. The data-word comprises the
+ * 16-, 12-, 10-, 8-bit input code followed by 0, 4, 6, or 8
+ * don't care bits.
*/
data = (cmd << 20) | (addr << 16) | (val << shift);
put_unaligned_be24(data, &msg[0]);
@@ -185,6 +186,7 @@ static const struct iio_chan_spec_ext_info ltc2632_ext_info[] = {
LTC2632_CHANNEL(7, _bits), \
}

+static DECLARE_LTC2632_CHANNELS(ltc2632x16, 16);
static DECLARE_LTC2632_CHANNELS(ltc2632x12, 12);
static DECLARE_LTC2632_CHANNELS(ltc2632x10, 10);
static DECLARE_LTC2632_CHANNELS(ltc2632x8, 8);
@@ -297,6 +299,18 @@ static const struct ltc2632_chip_info ltc2636h8_chip_info = {
.vref_mv = 4096,
};

+static const struct ltc2632_chip_info ltc2654l16_chip_info = {
+ .channels = ltc2632x16_channels,
+ .num_channels = 4,
+ .vref_mv = 2500,
+};
+
+static const struct ltc2632_chip_info ltc2654h16_chip_info = {
+ .channels = ltc2632x16_channels,
+ .num_channels = 4,
+ .vref_mv = 4096,
+};
+
static int ltc2632_probe(struct spi_device *spi)
{
struct ltc2632_state *st;
@@ -366,6 +380,10 @@ static const struct spi_device_id ltc2632_id[] = {
{ "ltc2636-h12", (kernel_ulong_t)&ltc2636h12_chip_info },
{ "ltc2636-h10", (kernel_ulong_t)&ltc2636h10_chip_info },
{ "ltc2636-h8", (kernel_ulong_t)&ltc2636h8_chip_info },
+ { "ltc2654-l16", (kernel_ulong_t)&ltc2654l16_chip_info },
+ { "ltc2654-l12", (kernel_ulong_t)&ltc2634l12_chip_info },
+ { "ltc2654-h16", (kernel_ulong_t)&ltc2654h16_chip_info },
+ { "ltc2654-h12", (kernel_ulong_t)&ltc2634h12_chip_info },
{ }
};
MODULE_DEVICE_TABLE(spi, ltc2632_id);
@@ -389,6 +407,8 @@ static const struct of_device_id ltc2632_of_match[] = {
{ .compatible = "lltc,ltc2636-h12", .data = &ltc2636h12_chip_info },
{ .compatible = "lltc,ltc2636-h10", .data = &ltc2636h10_chip_info },
{ .compatible = "lltc,ltc2636-h8", .data = &ltc2636h8_chip_info },
+ { .compatible = "lltc,ltc2654-l16", .data = &ltc2654l16_chip_info },
+ { .compatible = "lltc,ltc2654-h16", .data = &ltc2654h16_chip_info },
{ }
};
MODULE_DEVICE_TABLE(of, ltc2632_of_match);
@@ -404,5 +424,5 @@ static struct spi_driver ltc2632_driver = {
module_spi_driver(ltc2632_driver);

MODULE_AUTHOR("Maxime Roussin-Belanger <maxime.roussinbelanger@xxxxxxxxx>");
-MODULE_DESCRIPTION("LTC2632 DAC SPI driver");
+MODULE_DESCRIPTION("LTC2632/LTC2654 DAC SPI driver");
MODULE_LICENSE("GPL v2");
--
2.50.1