summaryrefslogtreecommitdiff
path: root/LICENSES
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-08-01 16:31:02 +0300
committerSebastian Reichel <sebastian.reichel@collabora.com>2021-08-05 19:54:52 +0300
commitc371d4491ba6356d5e437bd8cc8a72797f3e93bd (patch)
tree36334d7facd1a4515e3ab2a81cd54e1d853c1fa9 /LICENSES
parent7eef3e663834476946ecd4a43b4e1a2cb2bc9884 (diff)
downloadlinux-c371d4491ba6356d5e437bd8cc8a72797f3e93bd.tar.xz
power: supply: axp288_fuel_gauge: Only read PWR_OP_MODE, FG_LOW_CAP_REG regs once
Accessing registers on the AXP288 is quite expensive, so we should avoid doing unnecessary accesses. The FG_LOW_CAP_REG never changes underneath us, so we only need to read it once. Devices with an AXP288 do not have user-replace (let alone hot-swappable) batteries and the only bit we care about in the PWR_OP_MODE register is the CHRG_STAT_BAT_PRESENT bit, so we can get away with only reading the PWR_OP_MODE register once too. Note that the FG_LOW_CAP_REG is not marked volatile in the regmap, so we were effectively already reading it once. This change makes this explicit, this is done as preparation of a further patch which moves all remaining register accesses in fuel_gauge_get_property() out of that function. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'LICENSES')
0 files changed, 0 insertions, 0 deletions