MLK-17108-2 staging: typec: support dead battery charging
authorJun Li <jun.li@nxp.com>
Thu, 18 Jan 2018 19:16:00 +0000 (03:16 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:53:55 +0000 (14:53 -0500)
commitb3a443bd84885f11dc44f9ea766357a9505b8313
tree3aec9d1e95a86522959e9fb8235c8d35629299fd
parent289a5e9f26788116aa82d2892b21e292e0e4e9e1
MLK-17108-2 staging: 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>
drivers/staging/typec/tcpm.c