iio/adc: ingenic: add JZ4760B support to the sadc driver
authorChristophe Branchereau <cbranchereau@gmail.com>
Mon, 26 Jul 2021 08:20:32 +0000 (10:20 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 31 Jul 2021 17:14:53 +0000 (18:14 +0100)
commitbf1b2418c2f56a81f405925b10a02c25681179cd
treecae61268a413cd0e0115ac7f45c4d9c48fe3d7de
parentb9e9bdd425a3c99e15f5dfd465bef936130b7491
iio/adc: ingenic: add JZ4760B support to the sadc driver

The JZ4760B variant differs slightly from the JZ4760: it has a bit called VBAT_SEL in the CFG register.

In order to correctly sample the battery voltage on existing handhelds using this SOC, the bit must be cleared.

We leave the possibility to set the bit, by using the "ingenic,use-internal-divider" in the devicetree.

Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
Link: https://lore.kernel.org/r/20210726082033.351533-5-cbranchereau@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ingenic-adc.c