Add a bit mask to enable workarounds only if they are needed for a
particular hardware revision.
Change-Id: Ibd9a896ff6746a48ddab249d7c8ab762ed3c2fbe
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Currently the SOC in userspace is not being updated with the latest SOC
from the fuel gauge. Add power supply changed events when the delta SOC
interrupt fires, empty SOC interrupt fires, or when the charging status
changes to full.
Change-Id: I4bbf404639a97dcc443c9ecc8391623e2fff13fd
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
The fuel gauge can count the number of times the battery has charged
across a particular SOC range. Enable it.
Change-Id: I5adc7c2fca73aad765062360cf560eae2eee7d1e
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
The SOC range is divided into buckets. Whenever the battery is charged
across a bucket we increment the counter for that bucket. These cycle
counters are exposed through the "cycle_counter" property, and buckets
are selected by modifying the "cycle_counter_id" property.
Change-Id: I923c657132d071eff4b5bc61c00fb90de8dde62c
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Currently userspace will be notified whenever the Type-C changed
interrupt fires. The charging status reflects whether or not the charger
has a valid input power source. The valid input power source status
follows vbus and not the Type-C changed logic, so in some cases the
charging status may not yet be updated when the userpace is notified
that the USB power supply has changed.
Send a USB power supply changed event when both the Type-C changed
interrupt fires, and the USB plugin interrupt fires.
Change-Id: I50cdd8c706b10f08dc7f322ea02358f3dbce521e
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
This DT bindings documentation snapshot is taken as of msm-3.18
'commit b428af643156 ("power: qpnp-fg: configure thermal coefficients based on battery type")'
While at it, change the name used in the documentation from
Qualcomm to Qualcomm Technologies, Inc.
CRs-Fixed: 1068593
Change-Id: Ib359e41b7381149a270a5772540bbc80f920919f
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
There are some encoding changes to the following configurations
in pmi8998 SRAM. Update them.
For both v1.1 and v2.0,
- No sign bit for charge termination current
For v2.0,
- 6 bit encoding for empty voltage and vbatt_low
While at it, fix the SRAM byte location from byte 2 to byte 3 for
configuring empty voltage threshold in pmi8998v2.0.
CRs-Fixed: 1068592
Change-Id: I3a301aed1b23ab78aa86b24c11eb750502adab2f
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
healthd expects battery voltage, current, temperature, and technology from
the battery power supply. Add them.
Change-Id: I85f589030903ead938af2712875eb5daa81710d9
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
The fuel gauge has several algorithm flags which are useful for
debugging. Add a debugfs file called alg_flags to expose them.
Change-Id: Ibeeea88e2e0745e98e8bfdfa3e086263d82e7bac
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>