Post Go back to editing

ad7768 soft reset

Category: Software
Product Number: ad7768
Software Version: linux master

The ad7768-1 driver performs a soft reset here: https://github.com/analogdevicesinc/linux/blob/6bb2ef19eae7b4ebda9978ee75d67ceadcd31cd6/drivers/iio/adc/ad7768-1.c#L684C33-L684C54

The ad7768 driver doesn't seem to do the same.  Is that really the case and if so, is there a way to trigger a soft reset besides manually sending it via spi or gpio?

Thread Notes

Parents Reply Children
  • After posting this I realized its very similar to a previous question I asked here:  ad7768 eval start_n pin  and here  AD7768 GPIO controller seems unused 

    The HDL design for this chip has a gpio controller.  I think the no-os version of the driver uses this controller to config start and reset on the chip.  I think maybe this is an oversight in the linux driver which is likely supposed to issue a reset via SPI during the driver probe.

  • Hi  ,

    Upon reviewing the ad7768 driver, I observed the presence of the .debugfs_reg_access function, facilitating communication with the register through IIO attributes.

    For reading, the command is structured as follows:
    iio_attr -D ad7768 direct_reg_access 0x1d

    Regarding the write operation, initiating a software reset necessitates two writes to the SPI_RESET [1:0] bits. The sequence involves setting the bits initially to '11' and subsequently to '10' for the reset to take effect:
    iio_attr -D ad7768 direct_reg_access 0x3
    iio_attr -D ad7768 direct_reg_access 0x2
    ```

    Let me know if this works for you.

    Regards,
    Michelle

  • Thanks, this is a good workaround.

    I noticed that in later versions of the driver there are now bindings to map the gpio-based reset_n pin.  It's now documented in the devicetree bindings for the ad7768.