OSDN Git Service

power: add charging current limitting
authorDemon Singur <demonsingur@gmail.com>
Sat, 24 Mar 2018 17:27:51 +0000 (17:27 +0000)
committerArian <arian.kulmer@web.de>
Tue, 19 Nov 2019 15:24:31 +0000 (16:24 +0100)
commit8c48c2d683f6a631b8aa52a10177fc3e8847af72
treeedb8249ff89606567efe5633ac818de6a77cfe6c
parent26250d715869b2e5de06820c7c5debe7343288a1
power: add charging current limitting

Charging at 3200mA while using the phone makes it quite hot.
Decrease the charging current to ~1600mA to prevent bad user
experience and complaints.

After 90 seconds with screen on, vote USB ICL to lower current
to 1600mA.
After 5 seconds with screen off, unvote USB ICL so the current
goes back to 3200mA.

Also, add compatibility with stock hvdcp service that writes to
the system_temp_level property to trigger thermal throttling.

Values taken from MIUI kernel, rewritten to look better and avoid
locking in framebuffer notifiers.

Change-Id: Iedf2789304356221283472ba242211d3ea6256d8
drivers/power/supply/qcom/qpnp-smb2.c
drivers/power/supply/qcom/smb-lib.c
drivers/power/supply/qcom/smb-lib.h