forked from torvalds/linux
Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
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>
- Loading branch information
1 parent
a3d5c47
commit f9d2d930e04a8ae3368545c472183e5085d0c687
Showing
1 changed file
with
99 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters