As pd type can't equal to real_charger_type in discrete charging,
so need to add icl*vbus to report power max for showing turbopower
connected UI.
Change-Id: I16f4b559383f86eb38ec1b5e6cac09556d9dfada
Signed-off-by: mahj8 <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2154206
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reset charger configure and constraint for glink down, so that
AP will resend the charger configure and constraint to ADSP
battery management, otherwise uninitilized value of charger
configure and constraint will be used in ADSP side after ADSP
restart, and then power max value will use default value 0;
Change-Id: Ic29a61763c85be62102ecb0333ae7f03f79ac670
Signed-off-by: yanyh2 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2153260
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
when system into suspend. at this time running battery_work to
read the I2C that will make reading the i2c error.
so add cancle_delay_work when suspend, queue_delay_work when resume.
Change-Id: I7a39f8689b8b560ecfc04b40171bb59f20b6b57a
Signed-off-by: liuyc20 <liuyc20@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2152989
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Submit-Approved: Jira Key
Power supply is updated every 5 seconds, and firmware reading will be called every 5 seconds
The original firmware reading will pull the interrupt pin up and down
This operation will cause incorrect timing of wt6670, resulting in incorrect value read by wt6670
Change-Id: Ia4cfd37b8705ce2527fe6f6509a4b14b1eb8dd51
Signed-off-by: huaqin86 <huaqin86@motorola.com>
Reviewed-on: https://gerrit.mot.com/2153027
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
1. Update FOD gesture trigger in screen off mode.
2. Add FOD event support in screen on mode
Change-Id: I7ecbfdb4aff8eaf34e88247d91d08279edd018a6
Signed-off-by: Yan Zhang <zhangy26@motorola.com>
Reviewed-on: https://gerrit.mot.com/2152070
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wei Deng <dengwei1@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
From 8450 platform, Qcom doesn't support warmreset, so pstore memory
cannot work again. All persist memory data should be writtle into
memory.
Change-Id: I9f20a35b50a10c69b7df96037a27b965e130b5f9
Reviewed-on: https://gerrit.mot.com/2152098
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Add new pen status : PEN_STAT_CHARGE_DISABLED
it means the pen charging was disabled.
Change-Id: I784d770f34b1bbe1e8e34bf785810e180924de6d
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2151778
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
as the sc89890 datasheet,
the REG04 Icc - Fast Charge Current offset is 0ma, LSB is 60ma
the REG05 Itc - Tirckle Current offect is 60ma, LSB is 60ma
the REG05 Iterm - Termination Current offect is 30ma, LSB is 60ma
Change-Id: I6cd85cd48878492682c1c9802e5ce972e2db0664
Signed-off-by: liyiying <liyiying@wingtech.com>
Reviewed-on: https://gerrit.mot.com/2151683
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
during kernel boot up sequence, regulator framework has a delayed
workitem to cleanup all pre-enabled but not in use regulators,
as we want to keep the vbus on when otg device is plugged in before
kernel boots up, we need to use regulator interface to turn on the
related regulators, which in turn set the regulator as in use,
so the delayed workitem ignores the already engaged regulators.
Change-Id: I6baf4977768eb6837cd3b416a23c30fad5af789b
Reviewed-on: https://gerrit.mot.com/2151867
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Tested-by: Jira Key
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Submit-Approved: Jira Key
In some abnormal cases the soh=0 from the chip, that make the
bms_charge_counter&&bms_charge_full abnormal,then calculate the wrong
UI_SOC for battery.
if get soh=0; use old soh to aviod getting the wrong soc.
Change-Id: Ic7433d23c3162a96a40f9bc5e7043dcdfb42fb14
Signed-off-by: liuyc20 <liuyc20@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2151691
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
ocv_index is used for ocv_table parameter.
In some case read a invalid ocv_indes(65535/-13),then driver read the wrong
ocv parameter, that make checksum fail and exit the driver.
the ocv_index only 0~4 is valid, if read a invalid ocv_index,
using the default ocv_index to fix above issue.
Change-Id: I633aaa7f9abc4a98abb72cbec45025c8c52d5662
Signed-off-by: liuyc20 <liuyc20@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2151514
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
TP:
When exiting the stylus mode, the IC will send an abnormal reset
interrupt. At this time, the stylus will be enabled again,
but because the stylus clock is closed, the touch will not work.
Change-Id: Id1b393de2b2bee5b06e9d4f5b74dfd301be4547d
Reviewed-on: https://gerrit.mot.com/2150837
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
On user-debug build, use an orderly shutdown for factory kill instead
of a kernel power off. The orderly shutdown will attempt to call the
reboot binary from userspace first, and then fallback to kernel power
off if it fails.
Change-Id: Ia3d80b828670a5098afccbca2d934f9d32255a93
Signed-off-by: zhuwg1 <zhuwg1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2145390
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Hawao use 180 pull up and 39 pull down
hw design for vbus adc.
So we need to use specific sample ratio
to do the caculation.
This is just a debug modification to
accommodate evt/evt1 hw.
Change-Id: If062be5ac2f0586d39eb7115ab16f211c5c29d29
Signed-off-by: xieqiong2 <xieqiong2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2147468
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
Due to discrete main charger have no ibus adc
so limit main charger fixed input 300mA.
Change-Id: Ic762f33d91552c387aa27d6cbe8e4639b39df388
Signed-off-by: xuwei9 <xuwei9@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2150432
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Third charging ic IINLIM bits will be changed auto
when BC1.2 done. So we need to Ignore the PD
vote icl untill BC1.2 done.
Change-Id: I394f80b71c427e5b2a98b6012aeb7a852329ce4f
Signed-off-by: mahj8 <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2150599
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
1.what circumstances does this problem occur.
RD found sometimes the soc will jump as normal use
2. the rootcause of this issue.
the soc return value is not conform to the calculation method
3. how to fix this issue.
change the soc report way
Change-Id: I27032c5252d5ebe5ea005deac9e2e8403245e37f
Signed-off-by: liyiying <liyiying@wingtech.com>
Reviewed-on: https://gerrit.mot.com/2149683
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
start driver then update battery data was delayed 8s.
that is too late, it will cause UI can't get correct battery capacity.
so from 8s change to 50ms.
Change-Id: I3cfb510e222c1c937e02bc5bd8cd1d7a88c958f7
Signed-off-by: liuyc20 <liuyc20@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2149410
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
TP:
Record the value of the received mode from system and the value
successfully set to the touch IC.
Change-Id: Ie10f25be6d0d9fe9d21cf385a626496cc9aedfa5
Reviewed-on: https://gerrit.mot.com/2144916
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
Optimize turbo charging current
which can not reach 6A.
Change-Id: I443e9bb6ba5f051e7407fde26f611dd462de57e4
Signed-off-by: xuwei9 <xuwei9@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2146708
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
As bq25890H HW limit, some otg devices have high current pulse
when inserted. bq25890H trigger OTG OCP, so otg devices can't work.
So we config max boost current limit for bq25890H. For avoiding ibat
more than battery max discharging current, we add ibat monitor work.
Change-Id: If1d11fb47e26577055a181ea846c473f2cf73ec2
Signed-off-by: mahj8 <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2145129
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
some feature need to get current in real time
for rt9426a.
Change-Id: I28afc6471c771748db0edb7b8a433cfd9dc6c55a
Signed-off-by: mahj8 <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2146513
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
if the disable wakeup source is not avalible,
result the sleep state is not enter
Change-Id: Iaffb9bf70c574ce5dad5d1379be91159ef0e500b
Signed-off-by: qiurp1 <qiurp1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2145095
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jiyue Cui <cuijy2@lenovo.com>
Reviewed-by: Tao Sun <suntao2@motorola.com>
Submit-Approved: Jira Key
Opensource exfat-linux driver provide better performance
Comparing with the existing Moto exfat-nofuse
It could support various kernel versions l(CR) 5.4/4.19/4.14/4.9
Original source :https://github.com/arter97/exfat-linux.git
version 5.8-2arter97
This commit also integrates almost all the exfat upstream
changes from kernel 5.8-5.16 listed in:
https://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat.git/log/fs/exfat?h=exfat-for-5.16-rc1
Change-Id: I7c0db070ee33be8f7f24a42f987b4e825d957998
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/2137224
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xinmin Fu <fuxm1@motorola.com>
Reviewed-by: Chuanchun Zhu <zhucc2@motorola.com>
Reviewed-by: Xiaojun Ji <jixj@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
it should add device id detect before parse dtsi,
otherwise it will effect other fgauge boot time
Change-Id: If5d6e2de0a8783c40b4b60097baff1ffe3fa97e5
Reviewed-on: https://gerrit.mot.com/2144787
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key