MLK-17108-2 usb: typec: support dead battery charging
authorJun Li <jun.li@nxp.com>
Wed, 9 Jan 2019 09:52:23 +0000 (15:22 +0530)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commit84de39ffad3cebd9b3569c941ebf64a8a9bba1d8
treee898461f90924b9ee693bc39b8188775c13402c3
parent39d859b9f942750a6eb58883d651c4f27bb0c4d2
MLK-17108-2 usb: typec: support dead battery charging

If the vbus is aready on and remote cc state is Rp while typec init, we
think it's a dead battery case, this needs the PD session already setup
by bootloader,  so kernel can negotiate a new power session by soft reset,
this patch use the exsiting flag vbus_never_low as boot from dead battery
flag, but update the condition of setting it: not only check vbus, also
the cc status to make sure remote is a power source, if yes, bypass the
vbus sink disable. If the vbus is from local, we will still disable vbus
charge so original code intention is kept.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
drivers/usb/typec/tcpm.c