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
  • Hi  ,

    The AD7768 driver should have a soft reset as well. In the current driver, the soft reset has to be sent manually via SPI or GPIO.

    I am checking on how to implement this and will get back to you soon.

    Thanks,
    Janine

  • 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

Reply
  • 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

Children