The paths and interfaces for qcom scm call on kernel 4.x and kernel 5.x are
different, considering that different platform use different kernels, so
workaround here for compatibility.
Change-Id: I1a52e58be740799587a8ec924a5fd76d8f69a018
Signed-off-by: linyx10 <linyx10@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1885962
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jefferson Rodrigo Capovilla <jeffecap@motorola.com>
Reviewed-by: Binsheng Que <quebs2@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
when User attaches a 45W charger, the UI : 45W Hyper charging
In kernel space, driver module report "Hyper" to user space
when the 45w charger adapter connected
and report "Super" to user space when the 27w charger connected
/sys/class/power_supply/battery/charger_rate
Change-Id: I54041e6289fcea3808c1270bc70f2022c8d840cf
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1450586
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893600
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
In defender Project, there are two fuel gauge(bq27426, qpnp-qg),
sometimes, the soc 99% lasted for long time after recharging.
the battery status was NOT_CHARGING, because the current has been
terminated.
in that case, force it report 100%
Change-Id: I9b851ac7a7e3776730be386420ea974c15cbe321
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1443240
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893598
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
the pmic current would be limit when 45w pd charger connect,
and must clear the pmic limit setting after PD power removed.
Change-Id: I814e2825ca29c0975542bda0dcc72f6571ea437a
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1439744
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893582
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Under the parallel charging framework, the battery status should be
determined by all charging IC status, and not only from pmic charging
Change-Id: Idc85e8b96c1ff854f42f321e8e7b7a4c5ec55f6c
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1435998
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893580
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
-1, define a last chrg step flag.
-2, Disable charger pump IC at PM_STATE_ENTRY.
-3, Add second search cycle in mmi_find_chrg_step
-4, clear the batt_curr_roof and pd_constant_power_cnt
when switch the state machine work
Change-Id: I1156b8168c387ae2edf88052e9251302ef899ae1
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1429346
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893575
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
-1, Set the initial PD current to 2A.
-2, filter out the wrong PD request power for selecting PD charger.
-3, clear the pps result history after error pd result handing
-4, detect the pd constant power state, and avoid to excessive
boost vbus
Change-Id: I158a68c2907af42c07cd408ce162b528b3e39f10
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1428520
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893572
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Under certain condition, the PD adapter would be instability,
and the sm work who responsible for the entire charging policy
might exited abnormally.
improve the synchronous processing.
Change-Id: I87bb51a4b69178f9eb40d6519328975203027c7e
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1427554
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893556
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Redefine the charger device error type,
In some case, the output of PD adapter is not stable,
It would cause the UCP or OCP occurs on the bq2597x,
Add a recovery handling to response to this issue.
Change-Id: I9350df26252483b5c9010c9ef27d0364b59d57b2
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1427195
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893555
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Commit a copy of the bq25890 driver from the core
kernel drivers. We will need to make changes.
Change-Id: I5c5dfe19e19bec4f3c1ae4f24e6947213894604e
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1888564
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
Guard unofficial battery properties by the kernel version,
as we cannot modify newer version of the kernel to comply
with the GKI.
Change-Id: I1446789cd91813eaeccaac733db7ac11fa50176b
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1888563
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
USB charger absence will assert during USB enumeration on
bootup with USB connected, so it will trigger the factory
kill power off unexpectedly in factory mode.
To avoid this issue, consider the charger as present as long
as the charger type is not unknown at the same time.
Change-Id: I96a04cc96536a63936c69946c507198d933ef560
Signed-off-by: yanyh2 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1891779
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
- After the firmware is reset due to some exceptions, restore
the state of charger, stylus, palm, edge rejection.
- Filtering repeated commands of edge rejection.
Change-Id: Ie7076e1908ef528787d20dfe8970d9568636f114
Signed-off-by: wengjun1 <wengjun1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1886971
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wei Deng <dengwei1@motorola.com>
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Add an option to let us start with the factory kill disable
parameter enabled. There is currently and issue where usb
will disconnect and reconnect causing factory mode to
power off even with a cable.
Change-Id: Ia5fa306201af3b84be8dd54261511ad9889e6ad7
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1886184
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
If we happen to suspend during the sx933x_reinitialize
function, we may fail to write all i2c commands successfully
and may not fully recover.
Make sure the task has completed before suspend, and
restart it on resume.
Change-Id: I196d2f2de6fe905de86f82bc17da1d142b57de1a
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1884313
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
Update the Trustonic TEE driver module with the version available in
kinibi drop 410a-V107. This version contains the official patch to
correctly select the silver CPU cores. A workaround was done in (CR),
entitled "Force Trustonic TEE schedule run in Silver cores" and is being
reverted in this change.
Kinibi version t-base-QC8996-Android-410a-V107-20200907_110712_11106-Oem
Change-Id: I7d974f17e133b04f0f11c5622ef3fc0f6b92e494
Reviewed-on: https://gerrit.mot.com/1878314
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Mark Reed <mreed@motorola.com>
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
Added grouping for if condition
in switch case to avoid -Wmisleading-indentation warning from
GCC 4.8.3.
warning: misleading indentation; statement
is not part of the previous 'if' [-Wmisleading-indentation] error,
forbidden warning: synaptics_dsx_i2c.c:2896
Change-Id: Ib52c5ac2d507165468e826bc57ba0edb8ef0e96c
Signed-off-by: maheshmk <maheshmk@motorola.com>
Reviewed-on: https://gerrit.mot.com/1880925
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Srihari Sathyanarayana <sriharis@motorola.com>
Reviewed-by: Kanagarathina Kalathi <kalath(CR)@motorola.com>
Reviewed-by: Vijayakumar Gn <vijaygn@motorola.com>
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
Driver only has to manipulate with regulator reference counter when
it loads or unloads. Adding a new function that will take care of
this in probe and driver remove function. Leaving power function
operating with regulators' state only.
Change-Id: I3ef8b5a8b31ec336f1d1707069ab6330a5c5bb37
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1870282
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: litong <litong20@motorola.com>
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key