iio: addac: ad74413r: add support for reset-gpio
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Tue, 15 Nov 2022 09:55:17 +0000 (10:55 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 23 Nov 2022 20:54:37 +0000 (20:54 +0000)
commitf237cf1914e24ebba88670ecc36e8209c888c9a2
tree0110cb81d0e16f9d45ff3279e8206140ff99f1d2
parent6aaf7045697aa93589bea1b33e751814b0776991
iio: addac: ad74413r: add support for reset-gpio

We have a board where the reset pin of the ad74412 is connected to a
gpio, but also pulled low (i.e., asserted) by default. Hence to get
the chip out of reset, the driver needs to know about that gpio and
deassert the reset signal before attempting to communicate with the
chip.

When a reset-gpio is given in device tree, use that instead of the
software reset. According to the data sheet, the two methods are
functionally equivalent.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lore.kernel.org/r/20221115095517.1008632-4-linux@rasmusvillemoes.dk
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/addac/ad74413r.c