RE: [PATCH v11 2/6] iio: adc: ad4691: add initial driver for AD4691 family
From: Sabau, Radu bogdan
Date: Mon May 18 2026 - 11:12:20 EST
> -----Original Message-----
> From: Jonathan Cameron <jic23@xxxxxxxxxx>
> Sent: Sunday, May 17, 2026 2:53 PM
...
> > +static int ad4691_reset(struct ad4691_state *st)
> > +{
> > + struct device *dev = regmap_get_device(st->regmap);
> > + struct reset_control *rst;
> > +
> > + rst = devm_reset_control_get_optional_exclusive(dev, NULL);
> > + if (IS_ERR(rst))
> > + return dev_err_probe(dev, PTR_ERR(rst), "Failed to get
> reset\n");
> > +
> > + if (rst) {
> > + /*
> > + * Assert the reset line before sleeping to guarantee a proper
> > + * reset pulse on every probe, including driver reloads where
> > + * the line may already be deasserted (reset_control_put()
> does
> > + * not re-assert on release).
> > + * devm_reset_control_get_optional_exclusive_deasserted()
> cannot
> > + * be used because it deasserts immediately without delay; the
> > + * datasheet (Table 5) requires a ≥300 µs reset pulse width
> > + * before deassertion.
> > + */
> > + reset_control_assert(rst);
> > + fsleep(300);
> > + return reset_control_deassert(rst);
> Sashiko makes the reasonable point that we'd kind of expect some time
> between
> that pin dropping the device out of reset and it being able to respond. If it
> really is that quick - then add a comment.
>
> https://urldefense.com/v3/__https://sashiko.dev/*/patchset/20260515-
> ad4692-multichannel-sar-adc-driver-v11-0-
> eab27d852ac2*40analog.com__;IyU!!A3Ni8CS0y2Y!5I5rXG5US4TFIZ_cAbgcy
> gH-_Cbt6wLDZ5jVeBiPSDg5KuzEZT-CMN4Z3aFYYVXH6Kx4f2ClJcbr9w$
> > + }
> > +
> > + /* No hardware reset available, fall back to software reset. */
> > + return regmap_write(st->regmap, AD4691_SPI_CONFIG_A_REG,
> > + AD4691_SW_RESET);
> Same applies here.
>
He is right. And also I think I misread the datasheet, the 300us should happen
after deassertion and actual RESETL time is 10ns minimum which would be
covered by the overhead itself.
I think the reason to why this was never a problem while testing is because
300us is the recommended time and the minimum one could be much lower
than this, so successful probe was nothing but luck on my end.
I will make sure to update the function accordingly.