All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Marinović" <david.marinovic@pupin.rs>
To: jic23@kernel.org
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] iio: dac: ltc2632: add support for LTC2654 DAC family
Date: Tue, 10 Mar 2026 16:29:48 +0100	[thread overview]
Message-ID: <82ba84f98db9c32d3fc4efd7ef6697a2@pupin.rs> (raw)
In-Reply-To: <5d4fb8998d9634c3e5a8ed17b80dae07@pupin.rs>


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.

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@pupin.rs>
---
  drivers/iio/dac/ltc2632.c | 47 ++++++++++++++++++++++++++++++++++++---
  1 file changed, 44 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
index 105f939f7e54..05d3bf65399f 100644
--- a/drivers/iio/dac/ltc2632.c
+++ b/drivers/iio/dac/ltc2632.c
@@ -67,6 +67,10 @@ enum ltc2632_supported_device_ids {
         ID_LTC2636H12,
         ID_LTC2636H10,
         ID_LTC2636H8,
+       ID_LTC2654L16,
+       ID_LTC2654L12,
+       ID_LTC2654H16,
+       ID_LTC2654H12
  };

  static int ltc2632_spi_write(struct spi_device *spi,
@@ -79,8 +83,8 @@ 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]);
@@ -206,6 +210,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);
@@ -301,6 +306,26 @@ static const struct ltc2632_chip_info 
ltc2632_chip_info_tbl[] = {
                 .num_channels   = 8,
                 .vref_mv        = 4096,
         },
+       [ID_LTC2654L16] =  {
+               .channels       = ltc2632x16_channels,
+               .num_channels   = 4,
+               .vref_mv        = 2500,
+       },
+       [ID_LTC2654L12] = {
+               .channels       = ltc2632x12_channels,
+               .num_channels   = 4,
+               .vref_mv        = 2500,
+       },
+       [ID_LTC2654H16] = {
+               .channels       = ltc2632x16_channels,
+               .num_channels   = 4,
+               .vref_mv        = 4096,
+       },
+       [ID_LTC2654H12] =  {
+               .channels       = ltc2632x12_channels,
+               .num_channels   = 4,
+               .vref_mv        = 4096,
+       },
  };

  static int ltc2632_probe(struct spi_device *spi)
@@ -372,6 +397,10 @@ static const struct spi_device_id ltc2632_id[] = {
         { "ltc2636-h12", 
(kernel_ulong_t)&ltc2632_chip_info_tbl[ID_LTC2636H12] },
         { "ltc2636-h10", 
(kernel_ulong_t)&ltc2632_chip_info_tbl[ID_LTC2636H10] },
         { "ltc2636-h8", 
(kernel_ulong_t)&ltc2632_chip_info_tbl[ID_LTC2636H8] },
+       { "ltc2654-l16", 
(kernel_ulong_t)&ltc2632_chip_info_tbl[ID_LTC2654L16] },
+       { "ltc2654-l12", 
(kernel_ulong_t)&ltc2632_chip_info_tbl[ID_LTC2654L12] },
+       { "ltc2654-h16", 
(kernel_ulong_t)&ltc2632_chip_info_tbl[ID_LTC2654H16] },
+       { "ltc2654-h12", 
(kernel_ulong_t)&ltc2632_chip_info_tbl[ID_LTC2654H12] },
         { }
  };
  MODULE_DEVICE_TABLE(spi, ltc2632_id);
@@ -431,6 +460,18 @@ static const struct of_device_id ltc2632_of_match[] 
= {
         }, {
                 .compatible = "lltc,ltc2636-h8",
                 .data = &ltc2632_chip_info_tbl[ID_LTC2636H8]
+       }, {
+               .compatible = "lltc,ltc2654-l16",
+               .data = &ltc2632_chip_info_tbl[ID_LTC2654L16]
+       }, {
+               .compatible = "lltc,ltc2654-l12",
+               .data = &ltc2632_chip_info_tbl[ID_LTC2654L12]
+       }, {
+               .compatible = "lltc,ltc2654-h16",
+               .data = &ltc2632_chip_info_tbl[ID_LTC2654H16]
+       }, {
+               .compatible = "lltc,ltc2654-h12",
+               .data = &ltc2632_chip_info_tbl[ID_LTC2654H12]
         },
         { }
  };
@@ -447,5 +488,5 @@ static struct spi_driver ltc2632_driver = {
  module_spi_driver(ltc2632_driver);

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




-------- Original Message --------
Subject: [PATCH 0/2] iio: dac: ltc2632: add support for LTC2654 DAC 
family
Date: 10.03.2026 16:27
 From: David Marinović <david.marinovic@pupin.rs>
To: jic23@kernel.org

This patch series adds support for the Linear Technology LTC2654
quad DAC family to the existing ltc2632 driver.

The LTC2654 shares the same 24-bit SPI protocol as the existing
LTC2632/2634/2636 devices, requiring minimal additions to the
driver.

The LTC2654L-16 variant has been tested on a Phytec phyCORE-STM32MP1
board with the DAC connected via SPI1. The driver probes successfully
and all 4 channels are accessible via the IIO sysfs interface.

Patch 1 adds the driver support.
Patch 2 updates the DT bindings documentation.

David Marinovic (2):
   iio: dac: ltc2632: add support for LTC2654 DAC family
   dt-bindings: iio: dac: ltc2632: add LTC2654 compatible strings

Signed-off-by: David Marinovic <david.marinovic@pupin.rs>

  reply	other threads:[~2026-03-10 15:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 15:27 [PATCH 0/2] iio: dac: ltc2632: add support for LTC2654 DAC family David Marinović
2026-03-10 15:29 ` David Marinović [this message]
2026-03-11 12:18   ` [PATCH 1/2] " Andy Shevchenko
2026-03-10 15:32 ` [PATCH 2/2] dt-bindings: iio: dac: ltc2632: add LTC2654 compatible strings David Marinović
2026-03-11 13:03   ` Krzysztof Kozlowski
2026-03-11 13:04   ` Krzysztof Kozlowski
2026-03-18 13:57 ` [PATCH v2 0/3] iio: dac: ltc2632: add support for LTC2654 DAC family David Marinović
2026-03-18 13:57   ` [PATCH 1/3] iio: dac: ltc2632: drop enum and use individual chip_info objects David Marinović
2026-03-18 14:57     ` Andy Shevchenko
2026-03-18 13:57   ` [PATCH 2/3] dt-bindings: iio: dac: ltc2632: add LTC2654 compatible strings David Marinović
2026-03-18 17:38     ` Conor Dooley
2026-03-18 13:57   ` [PATCH 3/3] iio: dac: ltc2632: add support for LTC2654 DAC family David Marinović
2026-03-20 15:09   ` [PATCH v3 0/3] " David Marinović
2026-03-20 15:09     ` [PATCH v3 1/3] iio: dac: ltc2632: drop enum and use individual chip_info objects David Marinović
2026-03-20 15:09     ` [PATCH v3 2/3] dt-bindings: iio: dac: ltc2632: add LTC2654 compatible strings David Marinović
2026-03-20 17:20       ` Conor Dooley
2026-03-21 15:39         ` Jonathan Cameron
2026-03-20 15:09     ` [PATCH v3 3/3] iio: dac: ltc2632: add support for LTC2654 DAC family David Marinović
2026-03-21 15:38       ` Jonathan Cameron
2026-03-21 15:30     ` [PATCH v3 0/3] " Jonathan Cameron
2026-03-21 15:41     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=82ba84f98db9c32d3fc4efd7ef6697a2@pupin.rs \
    --to=david.marinovic@pupin.rs \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.