diff options
author | Hans de Goede <hdegoede@redhat.com> | 2021-08-01 15:31:02 +0200 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2021-08-05 18:54:52 +0200 |
commit | c371d4491ba6356d5e437bd8cc8a72797f3e93bd (patch) | |
tree | 36334d7facd1a4515e3ab2a81cd54e1d853c1fa9 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 7eef3e663834476946ecd4a43b4e1a2cb2bc9884 (diff) |
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 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions