summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@chromium.org>2019-12-16 21:44:21 -0800
committerCommit Bot <commit-bot@chromium.org>2020-09-01 12:42:24 +0000
commit904f7a3b9e4454b6cbb23829e6f813692b7087ee (patch)
tree0ffffea582b36c365e0c5f0cf2b15bc8a8a39858
parent689e8cdc09254072c0dface2954bc6e87f5ceaf7 (diff)
downloadchrome-ec-904f7a3b9e4454b6cbb23829e6f813692b7087ee.tar.gz
ps8xxx: add support for the ps8815
this adds support for the ps8815 variant of the parade TCPC. this chip is very similar to its predecessors like the ps8751 and ps8805 and can be supported by the same driver. at this point, the TCPM can talk to the chip but we don't properly detect chargers - the CC line states seem wrong and CC status changes do not trigger an ALERT in the ps8815. BRANCH=none BUG=b:144397088,b:147459088 TEST=EC detects the chip on boot. Change-Id: If86abd1fa21cf8f33f28c4ce89050b29e9408532 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1969524 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2315963 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Marco Chen <marcochen@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org>
-rw-r--r--driver/build.mk1
-rw-r--r--driver/tcpm/ps8xxx.c14
-rw-r--r--driver/tcpm/ps8xxx.h16
-rw-r--r--include/config.h1
4 files changed, 25 insertions, 7 deletions
diff --git a/driver/build.mk b/driver/build.mk
index 5b82ffc95e..37fd046201 100644
--- a/driver/build.mk
+++ b/driver/build.mk
@@ -114,6 +114,7 @@ driver-$(CONFIG_USB_PD_TCPM_ANX7688)+=tcpm/anx7688.o
driver-$(CONFIG_USB_PD_TCPM_ANX7447)+=tcpm/anx7447.o
driver-$(CONFIG_USB_PD_TCPM_PS8751)+=tcpm/ps8xxx.o
driver-$(CONFIG_USB_PD_TCPM_PS8805)+=tcpm/ps8xxx.o
+driver-$(CONFIG_USB_PD_TCPM_PS8815)+=tcpm/ps8xxx.o
driver-$(CONFIG_USB_PD_TCPM_TUSB422)+=tcpm/tusb422.o
# USB mux high-level driver
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c
index 9cb6e46017..722ee74f16 100644
--- a/driver/tcpm/ps8xxx.c
+++ b/driver/tcpm/ps8xxx.c
@@ -9,6 +9,7 @@
* Supported TCPCs:
* - PS8751
* - PS8805
+ * - PS8815
*/
#include "common.h"
@@ -19,7 +20,8 @@
#include "usb_pd.h"
#if !defined(CONFIG_USB_PD_TCPM_PS8751) && \
- !defined(CONFIG_USB_PD_TCPM_PS8805)
+ !defined(CONFIG_USB_PD_TCPM_PS8805) && \
+ !defined(CONFIG_USB_PD_TCPM_PS8815)
#error "Unsupported PS8xxx TCPC."
#endif
@@ -168,6 +170,7 @@ static int ps8xxx_get_chip_info(int port, int live,
}
+#if defined(CONFIG_USB_PD_TCPM_PS8751) || defined(CONFIG_USB_PD_TCPM_PS8805)
/*
* DCI is enabled by default and burns about 40 mW when the port is in
* USB2 mode or when a C-to-A dongle is attached, so force it off.
@@ -190,6 +193,15 @@ static int ps8xxx_addr_dci_disable(int port, int i2c_addr, int i2c_reg)
}
return EC_SUCCESS;
}
+#endif /* CONFIG_USB_PD_TCPM_PS8751 || CONFIG_USB_PD_TCPM_PS8805 */
+
+#ifdef CONFIG_USB_PD_TCPM_PS8815
+static int ps8xxx_dci_disable(int port)
+{
+ /* DCI is disabled on the ps8815 */
+ return EC_SUCCESS;
+}
+#endif /* CONFIG_USB_PD_TCPM_PS8815 */
#ifdef CONFIG_USB_PD_TCPM_PS8805
static int ps8xxx_dci_disable(int port)
diff --git a/driver/tcpm/ps8xxx.h b/driver/tcpm/ps8xxx.h
index 99ba60d43c..dd05eb247a 100644
--- a/driver/tcpm/ps8xxx.h
+++ b/driver/tcpm/ps8xxx.h
@@ -41,6 +41,10 @@
#define PS8XXX_REG_MUX_USB_DCI_CFG_MODE_MASK 0xC0
#define PS8XXX_REG_MUX_USB_DCI_CFG_MODE_OFF 0x80
+#define MUX_IN_HPD_ASSERTION_REG 0xD0
+#define IN_HPD (1 << 0)
+#define HPD_IRQ (1 << 1)
+
#if defined(CONFIG_USB_PD_TCPM_PS8751)
/* Vendor defined registers */
#define PS8XXX_PRODUCT_ID 0x8751
@@ -48,9 +52,6 @@
#define FW_VER_REG 0x90
#define PS8XXX_REG_VENDOR_ID_L 0x00
#define PS8XXX_REG_VENDOR_ID_H 0x01
-#define MUX_IN_HPD_ASSERTION_REG 0xD0
-#define IN_HPD (1 << 0)
-#define HPD_IRQ (1 << 1)
#define PS8XXX_REG_MUX_DP_EQ_CONFIGURATION 0xD3
#define PS8XXX_REG_MUX_DP_OUTPUT_CONFIGURATION 0xD4
#define PS8XXX_REG_MUX_USB_C2SS_EQ 0xE7
@@ -63,9 +64,12 @@
#define PS8805_P1_REG_MUX_USB_DCI_CFG 0x4B
#define FW_VER_REG 0x82
-#define MUX_IN_HPD_ASSERTION_REG 0xD0
-#define IN_HPD (1 << 0)
-#define HPD_IRQ (1 << 1)
+
+#elif defined(CONFIG_USB_PD_TCPM_PS8815)
+/* Vendor defined registers */
+#define PS8XXX_PRODUCT_ID 0x8815
+
+#define FW_VER_REG 0x82
#endif
diff --git a/include/config.h b/include/config.h
index c554b4acb8..6ae4a4cc80 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3301,6 +3301,7 @@
#undef CONFIG_USB_PD_TCPM_ANX7688
#undef CONFIG_USB_PD_TCPM_PS8751
#undef CONFIG_USB_PD_TCPM_PS8805
+#undef CONFIG_USB_PD_TCPM_PS8815
#undef CONFIG_USB_PD_TCPM_MT6370
#undef CONFIG_USB_PD_TCPM_TUSB422