OSDN Git Service

power: smb-lib: cache USB Type-C status
authorAbhijeet Dharmapurikar <adharmap@codeaurora.org>
Mon, 17 Apr 2017 19:26:26 +0000 (12:26 -0700)
committerAbhijeet Dharmapurikar <adharmap@codeaurora.org>
Tue, 18 Apr 2017 00:35:46 +0000 (17:35 -0700)
commitfcc7e888ff106d5ac7b3e11dc96af9425cc36e6d
treed579263e2b055c4e53230d9ae648a0ef80d83ddc
parentfd0747e34a4fddf2ed14ddc1d9b83d637924504f
power: smb-lib: cache USB Type-C status

Currently the USB Type-C status is retrieved from the hardware in real
time. The Type-C change IRQ should trigger on every change of the Type-C
status, therefore it is not necessary to read the status registers
multiple times if a Type-C change IRQ has not triggered. Furthermore,
workarounds which force UFP/DFP mode, or disable Type-C altogether could
mislead the software into thinking a removal has happened.

Cache all of the USB Type-C status registers upon receiving a USB Type-C
change IRQ, and use the cached status where appropriate.

CRs-Fixed: 2020132
Change-Id: I99f2ff29633207898ae803672162db0c3cec80dc
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
drivers/power/supply/qcom/smb-lib.c
drivers/power/supply/qcom/smb-lib.h