OSDN Git Service

qcom-charger: Don't automatically set USB_PD type when PD_ACTIVE=1
authorJack Pham <jackp@codeaurora.org>
Mon, 23 May 2016 18:15:15 +0000 (11:15 -0700)
committerKyle Yan <kyan@codeaurora.org>
Thu, 26 May 2016 22:27:09 +0000 (15:27 -0700)
commit3aff97c7a3edd1dfe51f3e0d24a4fc36197bfbe0
treeef42854c2fa27ace27d981dd5b68b7ac6adbb7b8
parent090978665c83f6e271556569c113b15e4f028d60
qcom-charger: Don't automatically set USB_PD type when PD_ACTIVE=1

The POWER_SUPPLY_PROP_PD_ACTIVE property is intended to be a flag
set whenever the PD PHY is in use. But this includes attempts to
establish communication, which may involve trying to perform a hard
reset to see if the port partner responds. Thus updating the
psy_desc.type field to 'USB_PD' right when PD_ACTIVE=1 is premature
as the port partner may not be PD-capable and it could be un-set.
Instead allow the PD driver to directly update POWER_SUPPLY_PROP_TYPE
only after it is sure PD communication has succeeded.

Change-Id: Iae6804bcb3121e0852ec5d14d0939623b97a6e67
Signed-off-by: Jack Pham <jackp@codeaurora.org>
drivers/power/qcom-charger/qpnp-smb2.c
drivers/power/qcom-charger/smb-lib.c