For some charge pad, we need to get the result of iout
from cps4019 to judge its working status. So ibat could
not work in this scene. So we should change the current
result form ibat to iout.
Change-Id: Ie31b1308ecd59507208ad4ec9038e6e950bfef76
Reviewed-on: https://gerrit.mot.com/2330599
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
If vbus is absent, CPS4019 could not be accessed duel to loss of power.
So before power supply read operations, we should check vbus status.
If it is not exist, we should not access CPS4019.
Change-Id: I32bcdec8dd7aa9829a727ffb0205adaa04e185ba
Reviewed-on: https://gerrit.mot.com/2334726
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
The charger input current provides for both main
and flip battery charger, so there should be balance
between the two charger input in order to meet
the BC1.2 charger current spec:
SDP: 500/900mA
CDP: 1500mA
DCP: 1500mA
Change-Id: Idf52ec497a46a01340a8a96888148cc324858ad3
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2331227
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
In order to avoid battery over discharging when charger attached
in some cases with high system load or charging disabled in factory
mode.
Change-Id: If323b2a5c558c944ba85a33188235c58909b6ada
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2330746
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Fixed sensors active logic, data order and values range to match
sensor hub's expectations. Timeout timer is disabled due to the
panic it causes.
Change-Id: I2ceae34b7ecdac2f790593b6ff25ea8caa34fb12
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/2326249
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Sridhar Vashist <svashist@motorola.com>
Reviewed-by: Yinjun Chen <a7301c@motorola.com>
Submit-Approved: Jira Key
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