FOD will turn on/off frequently, msleep will take longer delay than
expected, use mdelay to optimize the power up time.
Change-Id: I9c4d23f0c3b98713eeee7bb1393106ebac507af4
Signed-off-by: Yan Zhang <zhangy26@motorola.com>
Reviewed-on: https://gerrit.mot.com/2157879
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Adding a node to the power supply will affect the IIC timing,
adding to the IIO system file path is not fixed,
so add the node to the proc
Change-Id: Ib4842d6eaf37daf53e9c6bdb2a8f5d2a90694c38
Signed-off-by: huaqin87 <huaqin87@motorola.com>
Reviewed-on: https://gerrit.mot.com/2157051
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
1. remove pm_wakeup on fg_update_work_func, becase update_work will be cancle
when the device into suspend.
2. Relax the unseal state determination criteria, and the unseal only determines the bit0
3. update Correct unknown error. about writing rt9426a_reg_swindows value,
moto did not use this function
Change-Id: I38e2acd5b11fb78e722b6cb86e192ac389057705
Signed-off-by: liuyc20 <liuyc20@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2156775
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
when system suspend and then inserted charger, the system
can't wake up and update charger info.
Change-Id: Idb69dfc330b93d5929ce1b10b5c95491d6997aff
Signed-off-by: mahj8 <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2155893
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
As in some case charging type detected error, so optimize
sgm41542 charging type detected.
Change-Id: Iad9608794ff0cf9116295037f6bacdfc1bdd619a
Signed-off-by: mahj8 <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2154824
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This reverts commit c36e4a8eb858da064615bbfa7941312fe2d82c5b.
The node /sys/class/power_supply/QC3P/firmware_num that reads the 6670
firmware cannot be placed under the power supply,because the battery
service obtains information every 5s, which leads to the need to read
the version number every 5s,which will affect the bus timing on the IIC,
Which will affect the identification of the charger type
Change-Id: I0bbcc6419caf2e340a1ae6e951fe2bd32643b0a2
Signed-off-by: huaqin86 <huaqin86@motorola.com>
Reviewed-on: https://gerrit.mot.com/2154893
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ying Xu <xuying9@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
add qc3p charger type at bq2589x charger ic.
it will not charger icon if not have charger type
Change-Id: I950fd7e9fc9855f27174e58fce81a9e5c654f3c8
Signed-off-by: wutao <huaqin89@motorola.com>
Reviewed-on: https://gerrit.mot.com/2154583
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
Submit-Approved: Jira Key
add qc3p charger type at sgm4154x charger ic.
it will not charger icon if not have charger type
Change-Id: I2c62c685a347dee2e35e3e8b545ac4d3e0a16941
Signed-off-by: wutao <huaqin89@motorola.com>
Reviewed-on: https://gerrit.mot.com/2154578
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Submit-Approved: Jira Key
don't report usb type before rerun apsd done, to avoid input current
limit auto changed to 500ma by charger IC.
Change-Id: If148bded78a3ae8a628353ca70c7fa15f2b1363c
Signed-off-by: mahj8 <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2154207
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
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