When CLI touch wake irq triggerd to wake up kernel,add a wake lock
for it in case kernel suspend before resume.
Change-Id: I47f045f6d53cbe9e491922e60799c2e831e14ce2
Signed-off-by: Wenge Zhu <zhuwg1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2326776
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: litong <litong20@motorola.com>
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
As vbus remove and type-c cable still inserted at BSP test, the
CC voltage transfer to VBUS pin, the vbus pin voltage range is 0~1.25V
frequent switch. So the interrupt of vbus under 0.8V is triggered frequently.
So disable this interrupt when vbus remove.
Change-Id: Ibfc26ed1e7db2c1031ac27642aa38a2dcb120f92
Signed-off-by: Haijian Ma <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2325805
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
The fg psy may be created later than sgm4154x charger probe
and the fg psy event will be missing according to current
psy filter condition in psy notify call.
In order to fix this, use the fg psy name directly for
psy check, and not check the fg psy pointer.
Change-Id: I6ca888864045c0f523bfbef9f30411567214d995
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2326012
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
1.If touch wait kernel wake up timed out, we must reset IC or just need
to read out data from IC via I2C interface when I2C is ready to let IC
pull up the INT,if we can not wait I2C ready finally, single tap will
not be available at this time sleep state, display on/off once will
restore it.
2.Disable watchdog work to ping IC when IC is on SLEEPING and SLEEP_ON
state.
Change-Id: I10106ef993ddb8270293c3defd4002e6cda6e9b5
Signed-off-by: Wenge Zhu <zhuwg1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2324444
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: litong <litong20@motorola.com>
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
In order to avoid battery over voltage and current
during charging or over current in discharging
add threshold to trigger the protection based on
battery voltage and current.
Change-Id: I2c9329a181ba9dd814d6e48a5e0f9c8e7f9d5147
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2322540
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Tested-by: Jira Key
Submit-Approved: Jira Key
When the battery charging is halt under chargable
condition, reset the battery charging to recover it.
Put the charger in HIZ mode if the battery is absent
or OTG is enabled to prevent battery charging by
boost power.
Mot-CRs-fixed: (CR)
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Change-Id: I7631a7fdd2329c108d1dc2bd3d341775a194ccb8
Reviewed-on: https://gerrit.mot.com/2321180
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
When the battery charging is halt under chargable
condition, reset the battery charging to recover it.
Put the charger in HIZ mode if the battery is absent
or OTG is enabled to prevent battery charging by
boost power.
Change-Id: I435bcb751d22ef2ac515aa15bb63e423dfdc4cb6
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2320930
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Schedule the heartbeat work to update the battery properties
if read current_now.
Change-Id: I47cdd15911219ce8af268a23acefd4980c081b45
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2316770
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
As it turned out nFAULT signal drops for about 200us every time BOOST_EN
enabled. Arming IRQ after SLEEP signal allowing for avoiding false
fault interrupts
Change-Id: I947839591e7c6bff2231bb8e39ae8b6fdd5c2ab7
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/2317946
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Qing Chang <qing@motorola.com>
Submit-Approved: Jira Key
Felix has 2 motors. Thus nFAULT signal can be raised individually
for each motor. If both motors consistently failing any further
motor communications must be suppressed to avoid mechanical damage
Change-Id: I11eec76eea7b056bfa93ebe19e7bb81fe823abd2
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/2299699
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Qing Chang <qing@motorola.com>
Submit-Approved: Jira Key
Add battery OVP and OCP for battery charging
to workaroud the CE certification.
Change-Id: I2004e4a280cf2e5e8ce0d19c501e4a338e45d500
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2316155
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 factory tcmd init depends on the usbnet description sysfs
node when tcmd start up, so create it as early as possible to
avoid tcmd fails to get usbnet description.
Change-Id: Ie2946efe49ffa5815504bd45734c3538bee15a1f
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2311260
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Add and remove the sysfs files when usbnet configures the
ip by host PC.
When this sysfs files are ready, it means ip config received
from host PC and the phone can configure the network interface.
Change-Id: I2dabc4693d5e698e0c4853d0fa9d06e454ba7875
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2306945
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Always power on eSE to avoid eSE not open
issue
Change-Id: I46c9697fb329eb259759d2c461eec8cfd5782cf7
Signed-off-by: zhuangnk1 <zhuangnk1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2307741
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Tao Sun <suntao2@motorola.com>
Submit-Approved: Jira Key
Set charging status to discharging if charger absent
in case FG report confused status.
Change-Id: I95194b19750eb5af422ebb05f5937ca18a15a61c
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2301533
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
the first_batt_param_ver and second_batt_param_ver maybe different.
so we need match battery_id && param_ver when update parameter.
Change-Id: I474d711b9d83286ed6c5e1c1a19ae3d30e2b1319
Signed-off-by: liuyc20 <liuyc20@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2291391
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
get charge counter value from flip fg and assign this value
to batt_chg_counter of battery info struct.
Change-Id: I4356f928217dc2806fc722d2e8d9e7ff1da755d6
Reviewed-on: https://gerrit.mot.com/2300250
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Don't enable main charger termination when slave cp
disabled, because main cp also work well, it will load
to main charger termination.
Change-Id: Idce843eaede60120963efdee92746b3d15c98742
Signed-off-by: Haijian Ma <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2298500
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
For some authen tests, charging parameters may need to be changed
as requirement. And for original designation, these ops interfaces only
work in factory mode. So we need to export them in normal mode.
Change-Id: I4ed54474fb6f8e0a164231d8919bc0f385954bd5
Reviewed-on: https://gerrit.mot.com/2299683
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
For some reasons, WLC authen test may upgrade FW without
fw version changed. So we add force flag for fw upgrade interface,
to let it could be applied in authen test.
Change-Id: I964984b4dd81e750e17ac23bfe0a5e9cf70a109f
Reviewed-on: https://gerrit.mot.com/2296260
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
keep irq always wake up
can get I2C message from irq
Change-Id: Ie338aec3f3caf90cd910b87ebbfc5089d7ceb7d1
Signed-off-by: zhangjun10 <zhangj10@motorola.com>
Reviewed-on: https://gerrit.mot.com/2298808
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
It gets incorrect paired_ichg value before setting to make a wrong
decision on charging current setting.
This issue may cause battery charging out of controlling of battery
charging policy.
Change-Id: If5ed84d5cebc231ecda70dcb919b76c681f52d84
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2298136
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
if plug in usb slowly, wt6670 will output float or sdp type
recheck charge type if detect float or sdp
Change-Id: I316d05a5178e4e6f5a3140ba6adf3e4a0c19e987
Signed-off-by: longc102 <longc102@motorola.com>
Reviewed-on: https://gerrit.mot.com/2295174
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Qiong Xie <xieq2@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key