staging: typec: tcpm: explicit_contract is always established
authorBadhri Jagan Sridharan <badhri@google.com>
Thu, 17 Aug 2017 19:11:21 +0000 (12:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Aug 2017 22:57:17 +0000 (15:57 -0700)
commit8bf05746cffa34aab3e13e0f1c4c44d3e9cd395b
tree86134e700acca1e494a34c5845109c22902abc62
parentefd44cf468fe7e7ff9150dc52879426e0d0801eb
staging: typec: tcpm: explicit_contract is always established

While in SNK_READY state, the explicit_contract seems to be
set to true irrespective of whether an explicit contract
was established for the current connection. TCPM also seems
to report the pwr_opmode as TYPEC_PWR_MODE_PD always once
the port gets into SNK_READY state. This isn't completely
true as port gets into the SNK_READY state for non-pd
type-c ports as well.

This patch sets the explicit_contract flag only when
the PS_READY message is received and the vbus has been
detected by the port controller.

Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/typec/tcpm.c