iio: resolver: ad2s1210: add support for adi,fixed-mode
authorDavid Lechner <dlechner@baylibre.com>
Mon, 16 Oct 2023 13:54:22 +0000 (08:54 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 16 Nov 2023 19:10:25 +0000 (19:10 +0000)
commitf9b9ff95be8ce0e8becfd17b416b68d13915733d
treee7cdf75a69787b809bb4e06750e9532c0635b174
parent8a636db3aa57ed468b88804ecf27798df6c9c553
iio: resolver: ad2s1210: add support for adi,fixed-mode

It is possible to use the AD2S1210 with hardwired mode pins (A0 and A1).
According to the devicetree bindings, in this case the adi,fixed-mode
property will specify which of the 3 possible modes the mode pins are
hardwired for and the gpio-modes property is not allowed.

This adds support for the case where the mode pins are hardwired for
config mode. In this configuration, the position and value must be read
from the config register.

The case of hardwired position or velocity mode is not supported as
there would be no way to configure the device.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20231016135423.16808-1-dlechner@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/resolver/ad2s1210.c