From: Rodrigo Alencar via B4 Relay <devnull+rodrigo.alencar.analog.com@kernel.org>
To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux@analog.com, devicetree@vger.kernel.org,
linux-pwm@vger.kernel.org, linux-doc@vger.kernel.org,
Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Cc: "Olivier Moysan" <olivier.moysan@foss.st.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Uwe Kleine-König" <ukleinek@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Rodrigo Alencar" <rodrigo.alencar@analog.com>
Subject: [PATCH v2 01/10] iio: frequency: ad9910: powerdown fix
Date: Thu, 22 Oct 2026 12:18:59 -0300 [thread overview]
Message-ID: <20261022-ad9910-backend-support-v2-1-0ff7f0bff326@analog.com> (raw)
In-Reply-To: <20261022-ad9910-backend-support-v2-0-0ff7f0bff326@analog.com>
From: Rodrigo Alencar <rodrigo.alencar@analog.com>
Enable the software powerdown on all the applicable CFR1 register bits at
once with an IO update.
It turns out that DIGITAL and REFCLK_INPUT powerdown do need an IO update
when enabling the powerdown, but that is not the case when powering it up
again. It is an asymmetric behavior, which was observed while profiling
power consumption in the lab.
Fixes: 22452fe6cd08 ("iio: frequency: ad9910: initial driver implementation")
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
---
drivers/iio/frequency/ad9910.c | 26 ++++++++------------------
1 file changed, 8 insertions(+), 18 deletions(-)
diff --git a/drivers/iio/frequency/ad9910.c b/drivers/iio/frequency/ad9910.c
index 04a4e184b873..8bc24d0b7442 100644
--- a/drivers/iio/frequency/ad9910.c
+++ b/drivers/iio/frequency/ad9910.c
@@ -621,26 +621,16 @@ static int ad9910_sw_powerdown_set(struct ad9910_state *st, bool enable)
if (ad9910_sw_powerdown_get(st) == enable)
return 0;
- /*
- * When powering down, the DAC and AUX_DAC (SW1) must be powered down
- * first, as they require an I/O update to take effect. The opposite is
- * true when powering up, the DAC and AUX_DAC must be powered up last,
- * i.e., after the DIGITAL and REFCLK_INPUT (SW0) power up.
- */
- if (enable) {
- ret = ad9910_reg32_update(st, AD9910_REG_CFR1,
- AD9910_CFR1_SW1_POWER_DOWN_MSK,
- AD9910_CFR1_SW1_POWER_DOWN_MSK,
- true);
- if (ret)
- return ret;
-
+ if (enable)
return ad9910_reg32_update(st, AD9910_REG_CFR1,
- AD9910_CFR1_SW0_POWER_DOWN_MSK,
- AD9910_CFR1_SW0_POWER_DOWN_MSK,
- false);
- }
+ AD9910_CFR1_SW_POWER_DOWN_MSK,
+ AD9910_CFR1_SW_POWER_DOWN_MSK,
+ true);
+ /*
+ * When powering up, the DIGITAL and REFCLK_INPUT (SW0) must be powered
+ * up first, as they do not require an I/O update to take effect.
+ */
ret = ad9910_reg32_update(st, AD9910_REG_CFR1,
AD9910_CFR1_SW0_POWER_DOWN_MSK, 0, false);
if (ret)
--
2.43.0
next prev parent reply other threads:[~2026-10-22 15:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 15:18 [PATCH v2 00/10] iio: frequency: ad9910: add IIO backend support Rodrigo Alencar via B4 Relay
2026-10-22 15:18 ` Rodrigo Alencar via B4 Relay [this message]
2026-10-22 15:19 ` [PATCH v2 02/10] iio: backend: add devm_iio_backend_get_optional() Rodrigo Alencar via B4 Relay
2026-10-22 15:19 ` [PATCH v2 03/10] dt-bindings: iio: frequency: add adi,ad9910-axi-backend Rodrigo Alencar via B4 Relay
2026-10-22 18:38 ` Conor Dooley
2026-10-23 11:15 ` Rodrigo Alencar
2026-10-23 17:39 ` Conor Dooley
2026-10-22 15:19 ` [PATCH v2 04/10] dt-bindings: iio: frequency: ad9910: add io-backends property Rodrigo Alencar via B4 Relay
2026-10-22 15:19 ` [PATCH v2 05/10] iio: frequency: ad9910: move channel indexes into a shared header Rodrigo Alencar via B4 Relay
2026-10-22 15:19 ` [PATCH v2 06/10] iio: frequency: ad9910: add axi backend driver Rodrigo Alencar via B4 Relay
2026-10-26 0:29 ` Jonathan Cameron
2026-10-30 12:05 ` Nuno Sá
2026-10-22 15:19 ` [PATCH v2 07/10] iio: frequency: ad9910: support drctl control Rodrigo Alencar via B4 Relay
2026-10-23 10:40 ` Rodrigo Alencar
2026-10-23 14:48 ` Nuno Sá
2026-10-22 15:19 ` [PATCH v2 08/10] iio: frequency: ad9910: support iio backend Rodrigo Alencar via B4 Relay
2026-10-30 12:05 ` Nuno Sá
2026-10-22 15:19 ` [PATCH v2 09/10] iio: ABI: add integration_time for output channels Rodrigo Alencar via B4 Relay
2026-10-22 15:19 ` [PATCH v2 10/10] docs: iio: ad9910: document DRCTL pin control Rodrigo Alencar via B4 Relay
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=20261022-ad9910-backend-support-v2-1-0ff7f0bff326@analog.com \
--to=devnull+rodrigo.alencar.analog.com@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=jonathan.cameron@oss.qualcomm.com \
--cc=krzk+dt@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=rdunlap@infradead.org \
--cc=robh@kernel.org \
--cc=rodrigo.alencar@analog.com \
--cc=skhan@linuxfoundation.org \
--cc=ukleinek@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
all inboxes | Powered by JetHome®