Re: [PATCH v9 5/8] iio: adc: ad4030: Add SPI offload support
From: Andy Shevchenko
Date: Mon Feb 23 2026 - 10:15:23 EST
On Mon, Feb 23, 2026 at 12:08:52PM -0300, Marcelo Schmitt wrote:
> On 02/22, Jonathan Cameron wrote:
> > On Mon, 16 Feb 2026 12:00:39 -0300
> > Marcelo Schmitt <marcelo.schmitt@xxxxxxxxxx> wrote:
...
> > > + st->cnv_trigger = devm_pwm_get(dev, NULL);
> > > + if (IS_ERR(st->cnv_trigger))
> > > + return dev_err_probe(dev, PTR_ERR(st->cnv_trigger),
> > > + "Failed to get CNV PWM\n");
> > > +
> > > + /*
> > > + * Preemptively disable the PWM, since we only want to enable it with
> > > + * the buffer.
> > > + */
> > > + pwm_disable(st->cnv_trigger);
> >
> > Feels like there should really be a way to get a pwm disabled in one call
> > so there isn't an edge case of it being on briefly.
> > I'm a bit surprised it defaults to on. I guess this is because DT can provide
> > the parameters?
I believe it defaults to "as is". The immediate case (disregard to IIO) came
to my mind is PWM-based backlight. In such a case we most likely want to leave
the state as previous stage (FW, bootloader) left it in.
> Not really. DT doesn't specify any initial state for the PWM. It might, though,
> be left enabled if another device was using it previously. Not a thing I've
> ever seen during tests, but it may in theory happen.
>
> We may have devm_pwm_get_disabled(). In IIO, ad7625 and this ad4030 would be
> the users of such interface. Would you like me to propose that one?
Not sure it will be accepted by PWM maintainers, and personally I would be not
a fan of such a call. Sounds a bit confusing to me (however, we have IRQ flag
to not enable IRQs, which makes a lot of sense in comparison to other use
cases).
--
With Best Regards,
Andy Shevchenko