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

Top Replies

    •  Analog Employees 
    in reply to jay_col +4 verified

    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…

Parents Reply Children
  • 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.