From: Kim Seer Paller <kimseer.paller@analog.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<devicetree@vger.kernel.org>,
Kim Seer Paller <kimseer.paller@analog.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: [PATCH v6 0/3] Add driver for AD3530R and AD3531R DACs
Date: Fri, 25 Apr 2025 20:54:45 +0800 [thread overview]
Message-ID: <20250425-togreg-v6-0-47b6f9878ae5@analog.com> (raw)
The AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel) are
low-power, 16-bit, buffered voltage output DACs with software-
programmable gain controls, providing full-scale output spans of 2.5V or
5V for reference voltages of 2.5V. These devices operate from a single
2.7V to 5.5V supply and are guaranteed monotonic by design. The "R"
variants include a 2.5V, 5ppm/°C internal reference, which is disabled
by default.
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
---
Changes in v6:
ad3530r:
- Drop reviewer's tag, a re-review might be required due to changes.
- Add includes: dev_printk.h, array_size.h, sysfs.h, kstrtox.h, types.h,
and err.h.
- Add AD3530R_OP_MODE_CHAN_MSK() macro to drop using chan->address.
- Update logic to explicitly set operating modes for all 4 fields of the
register.
- Update naming to use _mV for proper spelling.
- Assign pdmode separately before shifting for powerdown.
- Replace U16_MAX with a hardware-defined limit using GENMASK().
- Replace hardcoded delays with USEC_PER_MSEC.
- Update `vref / 1000` to use MILLI.
- Simplify logic of setting vref to 0 when it's -ENODEV and directly
check the value, removing the need for an additional boolean variable.
- Link to v5: https://lore.kernel.org/r/20250421-togreg-v5-0-94341574240f@analog.com
Changes in v5:
ad3530r:
- Replace return value to -ENODEV if no external and internal reference
found.
- Replace device_property_present() with device_property_read_bool() for
flag handling.
- Simplify vref_mv calculation by using range_multiplier directly.
- Change ldac GPIO initial state as it is toggled high to low later.
- Drop linux/kernel.h include.
- Add reviewer's tag.
- Link to v4: https://lore.kernel.org/r/20250412-togreg-v4-0-cb9e5309b99d@analog.com
Changes in v4:
Bindings:
- Add ad3531/ad3531r datasheet link.
- Add reviewer's tag.
ad3530r:
- Add commit description for unimplemented MUXOUT ADC monitoring feature.
- Use a DMA-safe buffer for bulk register read/write.
- Inline the AD3530R_CHAN_EXT_INFO macro for the "powerdown" attribute
since it is only used once.
- Use enum ad3530r_mode for powerdown_mode.
- Refactor ad3530r_set_dac_powerdown() use chan->address for bitmask
calculations and add helper variables.
- Simplify single-bit configuration with regmap_set_bits().
- Add .max_register for regmap_config.
- Rework regulator handling and move ad3530r_setup() after enabling the
regulators.
- Link to v3: https://lore.kernel.org/r/20250403-togreg-v3-0-d4b06a4af5a9@analog.com
Changes in v3:
- Drop ABI docs.
Bindings:
- Drop reviewer's tag.
- Update commit message.
- Add non-r variants to compatible list.
- Add io-channels property to enable ADC channel support for MUXOUT
readings.
- Switch to unevaluatedProperties: false.
ad3530r:
- Update commit message.
- Drop spi field from ad3530r_state and use regmap to retrieve the device
pointer.
- Update mutex lock comment and use devm_mutex_init().
- Fix LDAC gpio pulse logic.
- Replace usleep_range() with fsleep().
- Use sizeof(reg_val) instead of hardcoded value in regmap_bulk_read.
- Drop reporting of zero offset.
- Add internal_ref_support chip_info parameter and modify reference
handling.
- Link to v2: https://lore.kernel.org/r/20250324-togreg-v2-0-f211d781923e@analog.com
Changes in v2:
Bindings:
- Updated commit message.
- Changed adi,double-output-range to adi,range-double property.
ad3530r:
- Changed data type to __be16 to resolve sparse warnings related to
type mismatches.
- Link to v1: https://lore.kernel.org/r/20250319-togreg-v1-0-d8244a502f2c@analog.com
---
Kim Seer Paller (3):
iio: ABI: add new DAC powerdown mode
dt-bindings: iio: dac: Add adi,ad3530r.yaml
iio: dac: ad3530r: Add driver for AD3530R and AD3531R
Documentation/ABI/testing/sysfs-bus-iio | 2 +
.../devicetree/bindings/iio/dac/adi,ad3530r.yaml | 100 ++++
MAINTAINERS | 8 +
drivers/iio/dac/Kconfig | 11 +
drivers/iio/dac/Makefile | 1 +
drivers/iio/dac/ad3530r.c | 515 +++++++++++++++++++++
6 files changed, 637 insertions(+)
---
base-commit: b475195fecc79a1a6e7fb0846aaaab0a1a4cb2e6
change-id: 20250319-togreg-fc6a0af961ed
Best regards,
--
Kim Seer Paller <kimseer.paller@analog.com>
next reply other threads:[~2025-04-25 12:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-25 12:54 Kim Seer Paller [this message]
2025-04-25 12:54 ` [PATCH v6 1/3] iio: ABI: add new DAC powerdown mode Kim Seer Paller
2025-04-25 12:54 ` [PATCH v6 2/3] dt-bindings: iio: dac: Add adi,ad3530r.yaml Kim Seer Paller
2025-04-25 12:54 ` [PATCH v6 3/3] iio: dac: ad3530r: Add driver for AD3530R and AD3531R Kim Seer Paller
2025-04-25 16:48 ` David Lechner
2025-04-26 12:49 ` 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=20250425-togreg-v6-0-47b6f9878ae5@analog.com \
--to=kimseer.paller@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox