iio: adc: meson: init voltage control bits
authorGeorge Stark <gnstark@sberdevices.ru>
Sat, 15 Jul 2023 11:06:00 +0000 (14:06 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 22 Jul 2023 16:58:23 +0000 (17:58 +0100)
commit90c6241860bf804c95aec02ed296898459720a7c
tree69db2fcf8bbe117948bf41c9e004e3ed3fbf4a0e
parentd1adcaf7a407fe3ba5607727244de98bb3abfbd2
iio: adc: meson: init voltage control bits

Define and init voltage configuration bits. Those bits are inited in
vendor boot code (bl2, bl33) already so do it in the driver to not depend
on other code.

Introduced bits:
REG11[0] - selects Vref. 0 - calibration voltage, 1 - VDDA. txlx and later
           SoCs support VDDA or calibration voltage as Vref, but others
           support only calibration voltage. For newer platforms vendor
   uses VDDA as default.
REG11[1] - reserved bit. g12a and later SoCs must write 1, others SoCs
           write 0.
REG11[5] - Vref voltage. 0 - 0.9v, 1 - 1.8v. g12a and later SoCs must
           write 0, others SoCs write 1.
REG11[6] - selects common-mode voltage, 0: from AVDD, 1: from Vref.
           g12a and later SoCs must write 0, others SoCs write 1.

Signed-off-by: George Stark <gnstark@sberdevices.ru>
Link: https://lore.kernel.org/r/20230715110654.6035-4-gnstark@sberdevices.ru
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/meson_saradc.c