summaryrefslogtreecommitdiff
path: root/drivers/power/reset/piix4-poweroff.c
diff options
context:
space:
mode:
authorKate Hsuan <hpa@redhat.com>2021-10-12 13:45:45 +0800
committerSebastian Reichel <sebastian.reichel@collabora.com>2021-10-12 15:21:15 +0200
commited229454856e565c5a7d3287cbc63f2cf077b34f (patch)
tree1a38d26ef82cbc5b41b264d30be49d374a64b3ca /drivers/power/reset/piix4-poweroff.c
parenta3d5c47c328a8002cb748d293fdcaef0c752bcdf (diff)
power: supply: axp288-charger: Optimize register reading method
The original implementation access the charger the same register value several times to get the charger status, such as online, enabled, and bus limits. It takes a long time and bandwidth for every "status get" operation.  To reduce the access of the register and save bandwidth, this commit integrated every read operation into only one "register value get"  operation and cache them in the variables. Once the "get properties" is requested from the user space, the cached information can be returned immediately. I2C access between Linux kernel and P-Unit is improved by explicitly taking semaphore once for the entire set of register accesses in the new axp288_charger_usb_update_property() function. The I2C-Bus to the XPower AXP288 is shared between the Linux kernel and 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. In other words, the semaphore will be locked and released several times for entire set of register accesses. Signed-off-by: Kate Hsuan <hpa@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/reset/piix4-poweroff.c')
0 files changed, 0 insertions, 0 deletions