RE: [PATCH v4 3/8] iio: imu: adis: Add optional post_reset_setup callback

From: Sabau, Radu bogdan

Date: Mon Oct 26 2026 - 05:53:25 EST


> -----Original Message-----
> From: Jonathan Cameron <jic23@xxxxxxxxxx>
> Sent: Monday, October 26, 2026 1:52 AM

...

> > * @self_test_reg: Register address to request self test command
> > * @self_test_no_autoclear: True if device's self-test needs clear of ctrl reg
> > + * @post_reset_setup: Optional device-specific hook called after reset,
> > + * before self-test. Not all ADIS devices need extra bring-up
> > + * between reset and self-test (SPI mode locking, status or
> > + * bootloader checks, pin or burst-mode configuration, etc.) -
> > + * only called when set. Must return 0 on success, a negative
> > + * error code otherwise.
>
> Trivial but I wonder if this naming focuses unnecessarily on bit being
> after reset. Maybe simply calling it init() would be enough with
> assumption that any intialization is always after reset if there
> is one done?
>

Totally agree - renaming it to init() for v5.

> > * @self_test: Optional device-specific self-test override. When set,
> > * it is called instead of the generic mask-write/sleep/
> > * check-status sequence. The callback owns its own pass/fail
> > @@ -88,6 +94,7 @@ struct adis_data {
> > unsigned int self_test_mask;
> > unsigned int self_test_reg;
> > bool self_test_no_autoclear;
> > + int (*post_reset_setup)(struct adis *adis);
> > int (*self_test)(struct adis *adis);
> > const struct adis_timeout *timeouts;
> >
> >