summaryrefslogtreecommitdiff
path: root/driver/ppc/syv682x.h
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2020-02-07 15:50:17 -0700
committerCommit Bot <commit-bot@chromium.org>2020-02-14 04:09:01 +0000
commit4f748cf760dcc57b628f08ef705701235cb6c842 (patch)
treec72bc9fc42d654a14ea6bd3c26a2c43766b8ede5 /driver/ppc/syv682x.h
parentd595bddb4c6576c9f5611d3a42c71424ebd3c1d7 (diff)
downloadchrome-ec-4f748cf760dcc57b628f08ef705701235cb6c842.tar.gz
syv682x: Enable smart discharge mode
The SYV682A device provides a smart discharge mode that automatically discharges VBUS and VCHG when the channel is shutdown. This works better than the manual dicharge mode which must be explicitly cleared after the discharge completes. This change also adds BUSY detection to the driver and performs a register reset during initialization. BUG=b:148870148, b:148467221 BRANCH=none TEST=make buildall TEST=Verify connection of SRC devices start battery charging, including DRP devices. TEST=Verify SNK devices are detected and reported by the kernel TEST=Measture VBUS discharge times of 20 ms when disconnecting both SNK and SRC devices. TEST=Write non-default value in SYV682 register, reboot EC, verify register updates to default plus EC changes. Change-Id: I54a5367924f3ae5adc473cb4b0a11789476e7bc3 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051311 Reviewed-by: caveh jalali <caveh@chromium.org>
Diffstat (limited to 'driver/ppc/syv682x.h')
-rw-r--r--driver/ppc/syv682x.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/driver/ppc/syv682x.h b/driver/ppc/syv682x.h
index 4a76659f41..1bb2be4f5c 100644
--- a/driver/ppc/syv682x.h
+++ b/driver/ppc/syv682x.h
@@ -42,6 +42,8 @@
#define SYV682X_CONTROL_2_FDSG BIT(0)
/* Control Register 3 */
+#define SYV682X_BUSY BIT(7)
+#define SYV682X_RST_REG BIT(0)
#define SYV682X_OVP_MASK 0x70
#define SYV682X_OVP_BIT_SHIFT 4
#define SYV682X_OVP_06_0 0