power: supply: axp288_fuel_gauge: Move the AXP20X_CC_CTRL check together with the...
authorHans de Goede <hdegoede@redhat.com>
Sun, 1 Aug 2021 13:31:04 +0000 (15:31 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 5 Aug 2021 16:54:52 +0000 (18:54 +0200)
commit964b3e9b02bd89a17fdd108a2ecb053beba2b43f
treec4efde6066558c05c16ad8faeb41fddc5ec5a4c9
parent394088f0b0668a1972b35fb25c54dedd1e89da7e
power: supply: axp288_fuel_gauge: Move the AXP20X_CC_CTRL check together with the other checks

The I2C-bus to the XPower AXP288 is shared between the Linux kernel and
the SoCs P-Unit. The P-Unit has a semaphore which the kernel must "lock"
before it may use the bus. If not explicitly taken by the I2C-driver,
then this semaphore is automatically taken by the I2C-bus-driver for
each I2C-transfer.

Move the AXP20X_CC_CTRL check done in probe() together with the other
register-accesses done in probe, so that we can take the semaphore once
for the entire set of register-accesses.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/axp288_fuel_gauge.c