Re: [PATCH v3 01/10] iio: frequency: ad9910: powerdown fix

From: Jonathan Cameron

Date: Tue Nov 03 2026 - 19:22:11 EST


On Tue, 03 Nov 2026 11:52:57 -0300
Rodrigo Alencar via B4 Relay <devnull+rodrigo.alencar.analog.com@xxxxxxxxxx> wrote:

> From: Rodrigo Alencar <rodrigo.alencar@xxxxxxxxxx>
>
> 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.

Just to be absolutely sure I understand this right... The bug today
wastes power but otherwise doesn't break using the device?

I'm just trying to judge urgency of applying this. Is it fine
to go with the changes that follow later in the series or do
I need to rush it in, potentially delaying the rest.

Thanks

Jonathan

>
> Fixes: 22452fe6cd08 ("iio: frequency: ad9910: initial driver implementation")
> Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
> Signed-off-by: Rodrigo Alencar <rodrigo.alencar@xxxxxxxxxx>
> ---
> 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)
>