power: supply: axp20x_usb_power: use IIO channels when available
authorQuentin Schulz <quentin.schulz@free-electrons.com>
Fri, 27 Jan 2017 08:54:36 +0000 (09:54 +0100)
committerSebastian Reichel <sre@kernel.org>
Sun, 29 Jan 2017 22:15:17 +0000 (23:15 +0100)
commit33863c938caa2538397170f1a355885f1ea1564e
tree757c1a82857b7757260222d7674d40c269f22ac1
parent166e8dbd630af5248c66c29082480d3cc44da010
power: supply: axp20x_usb_power: use IIO channels when available

The X-Powers AXP20X PMIC exposes the current current and voltage
measures via an internal ADC.

This adds the possibility to read IIO channels directly for processed
values rather than reading the registers and computing the value.

For backward compatibility purpose, if the IIO driver is not compiled,
this driver will fall back on previous behaviour which is direct
register readings.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/axp20x_usb_power.c