The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add driver for DAC8163:
@ 2026-08-02 16:07 Lukas Metz
  2026-08-02 16:07 ` [PATCH v3 1/2] dt-bindings: iio: dac: Add DAC8163 Lukas Metz
  2026-08-02 16:07 ` [PATCH v3 2/2] iio: dac: dac8163: Add driver for DAC8163 Lukas Metz
  0 siblings, 2 replies; 8+ messages in thread
From: Lukas Metz @ 2026-08-02 16:07 UTC (permalink / raw)
  To: Jonathan Cameron, Siratul Islam, David Lechner, Nuno Sá,
	Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-kernel, linux-iio, devicetree, Lukas Metz

This series adds an IIO driver for the Texas Instruments DAC7562, DAC7563,
DAC8162, DAC8163, DAC8562, and DAC8563 dual-channel voltage-output DACs.

These devices are pin-compatible 12-, 14-, and 16-bit variants sharing the
same 24-bit SPI command interface. Each device provides two independently
addressable output channels and includes a 2.5 V, 4 ppm/°C internal
reference that can be enabled via device tree, or an external reference
supplied through a regulator. The register and command structure differs
from already existing drivers which makes adding a new driver a
reasonable choice in my opinion.

The driver supports:
 - All six device variants via a shared chip info table
 - DAC updates in synchronous mode
 - Configurable internal or external voltage reference
 - Optional LDAC GPIO which has to be asserted permanently when using
   synchronous updates.
 - IIO_CHAN_INFO_RAW and IIO_CHAN_INFO_SCALE attributes per channel

Datasheet (DAC8163):
  https://www.ti.com/lit/gpn/dac8163

The driver was tested with a DAC8163 on a custom STM32MP157F board with
external reference enabled.

Signed-off-by: Lukas Metz <lukas.metz@gmx.net>
---
Changes in v3:
- add trailing comma to non-terminator entries as pointed out by Andy
  Shevchenko
- add select REGMAP_SPI to Kconfig entry as per Siratul Islam
- rename clr-gpios to clear-gpios and correct description as per Conor
  Dooley and David Lechner
- align mask macros as per Siratul Islam
- add macros for dac resolution as per Siratul Islam
- remove errno.h include as per Andy Shevchenko
- extend top level bindings description to explain why none of the devices
  are fallback compatible as suggested by Conor Dooley and David Lechner
- split function parameters logically when adding linebreaks as per Andy
  Shevchenko
- make use of dev_err_probe as suggested by Siratul Islam
- enable avdd regulator before the vrefin regulator to ensure a save
  powerup as suggested by sashiko
- enclose case statements in brackets as per Siratul Islam
- add select REGMAP_SPI to Kconfig entry as per Siratul Islam
- remove CMD_SET macro to avoid putting FIELD_PREP in a macro as per
  David Lechner
- remove mod_devicetable include as per Uwe Klein-Koenig
- define separate reg_default and regmap_config structures for each
  compatible and add regmap_config to the device info, see discussion
  with Siratul Islam and Jonathan Cameron
- Link to v2: https://patch.msgid.link/20260708-dac8163-work-v2-0-3acd1bf20182@gmx.net

Changes in v2:
- add reg_defaults to initialize the output registers based on
  the device (dacxxx2 resets to 0, dacxxx3 resets to mid-scale)
- add variable gain to dac8163_state struct to report correct scale when
  internal reference is used (the device sets the gain register to 2
  when the internal reference is selected)
- do a full reset of the device when probing to ensure we have a known
  device state as pointed out by Jonathan Cameron
- use devm* calls where possible and omit remove callback
- make use of regmap and remove now unneeded things like manual locking
  and caching of output register values (thanks to Andy Shevchenko,
  David Lechner and others for the hint)
- remove internal_reference property
- add missing headers as suggested by Siratul Islam
- remove debug print from dac8163_write_raw (per Andy Shevchenko and
  David Lechner)
- switch ldac-gpio polarity for consistency with datasheet (as per David
  Lechner)
- rename dt properties ti,loaddacs-gpios to ldac-gpios and vref-supply to
  vrefin-supply
- add required spi property spi-cpha to binding (the device only works
  in spi mode 1 and 3)
- add missing spi properties spi-max-frequency and spi-rx-bus-width to
  binding
- add avdd-supply to binding and enable it in the driver (thanks to
  David Lechner)
- add clr-gpios to binding although not yet supported by the driver
- add nullptr check after calling spi_get_device_match_data (thanks to
  Andy Shevchenko for pointing this out)
- add comment for permanent ldac assertion
- switch to GPL-2.0-or-later
- return -ERANGE when raw write is out of range
- use named structures instead of chip_info array
- rename driver identifiers from dacxx6x to dac8163 and partly remove
  vendor prefix as suggested by David Lechner and Siratul Islam
- remove redundant call to gpiod_set_value
- Link to v1: https://patch.msgid.link/20260623-dac8163-work-v1-0-5b508158faa0@gmx.net

---
Lukas Metz (2):
      dt-bindings: iio: dac: Add DAC8163
      iio: dac: dac8163: Add driver for DAC8163

 .../devicetree/bindings/iio/dac/ti,dac8163.yaml    |  87 ++++
 MAINTAINERS                                        |   7 +
 drivers/iio/dac/Kconfig                            |  16 +
 drivers/iio/dac/Makefile                           |   1 +
 drivers/iio/dac/ti-dac8163.c                       | 449 +++++++++++++++++++++
 5 files changed, 560 insertions(+)
---
base-commit: 76b6720279964612111352ca5d09f5bd61e41ce4
change-id: 20260413-dac8163-work-2138a775b515

Best regards,
--  
Lukas <lukas.metz@gmx.net>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-08-03  8:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-02 16:07 [PATCH v3 0/2] Add driver for DAC8163: Lukas Metz
2026-08-02 16:07 ` [PATCH v3 1/2] dt-bindings: iio: dac: Add DAC8163 Lukas Metz
2026-08-02 16:19   ` David Lechner
2026-08-02 18:55   ` Jonathan Cameron
2026-08-02 16:07 ` [PATCH v3 2/2] iio: dac: dac8163: Add driver for DAC8163 Lukas Metz
2026-08-02 17:19   ` David Lechner
2026-08-02 19:05     ` Jonathan Cameron
2026-08-03  8:28     ` Siratul Islam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox