iio: addac: ad74413r: update channel function set
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 11 Sep 2023 14:29:50 +0000 (17:29 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 13 Sep 2023 19:00:50 +0000 (20:00 +0100)
commite670bfe2736d3bd4436d160d37544e029f2aa813
tree8428ec83d8f842b98d5c01e9f94b1dfd8886a4fa
parent22da192f43f7d302d02644efa192ba5a05d935c9
iio: addac: ad74413r: update channel function set

According to the datasheet switching to a new channel function implies
multiple steps.

All functions must be selected for a minimum of 130 μs before changing
to another function.
The DAC_CODEx registers are not reset by changing channel functions.
Prior to changing channel functions, it is recommended to set the DAC
code to 0x0000 via the DAC_CODEx registers. Set the channel function
to high impedance via the CH_FUNC_SETUPx registers before transitioning
to the new channel function. After the new channel function is configured,
it is recommended to wait 150 μs before updating the DAC code.

Even though the channel switch is done at only at probe, where a device
reset is performed, that does not guarantee that the steps prior
changing to new channel function should be neglected.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20230911142950.216687-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/addac/ad74413r.c