diff options
-rw-r--r-- | driver/build.mk | 1 | ||||
-rw-r--r-- | driver/tcpm/ps8xxx.c | 14 | ||||
-rw-r--r-- | driver/tcpm/ps8xxx.h | 16 | ||||
-rw-r--r-- | include/config.h | 1 |
4 files changed, 25 insertions, 7 deletions
diff --git a/driver/build.mk b/driver/build.mk index 9b3b986e6a..498e31fe6b 100644 --- a/driver/build.mk +++ b/driver/build.mk @@ -115,6 +115,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 # USB mux high-level driver driver-$(CONFIG_USBC_SS_MUX)+=usb_mux.o diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c index c2e647e693..787489cf2a 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 fc474f6a2b..f030ea2724 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_USB_C2SS_EQ 0xE7 #define PS8XXX_REG_MUX_USB_C2SS_HS_THRESHOLD 0xE8 @@ -62,9 +63,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 8d29a7c95a..512972fbc7 100644 --- a/include/config.h +++ b/include/config.h @@ -3400,6 +3400,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 |