summaryrefslogtreecommitdiff
path: root/driver/tcpm
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2021-04-15 12:20:51 -0700
committerCommit Bot <commit-bot@chromium.org>2021-04-20 02:04:31 +0000
commita6f791ada46d9dbcbaf334672fafca8da9535834 (patch)
treede56182e26364c7d45b43719ef1e2cdfcbd564f4 /driver/tcpm
parent748deb2db0ecc013c04c72768fd99467d5ddec6f (diff)
downloadchrome-ec-a6f791ada46d9dbcbaf334672fafca8da9535834.tar.gz
TCPC: Cleanup: Enable PPC from PD or Power MUX
Some PD chips have integrated SRC FET and control the SRC/SINK FET from GPIOs hence cleaned up the code to enable Power Path Control from either from PD or from Power MUX. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I77f96b681fd2e5fca35bce425e4bd5ec87d5ccfd Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2828980 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/tcpm')
-rw-r--r--driver/tcpm/anx7447.c2
-rw-r--r--driver/tcpm/mt6370.c2
-rw-r--r--driver/tcpm/nct38xx.c4
-rw-r--r--driver/tcpm/ps8xxx.c2
-rw-r--r--driver/tcpm/rt1715.c2
-rw-r--r--driver/tcpm/tcpci.c6
-rw-r--r--driver/tcpm/tusb422.c2
7 files changed, 12 insertions, 8 deletions
diff --git a/driver/tcpm/anx7447.c b/driver/tcpm/anx7447.c
index 2f679193ec..9458ee8c94 100644
--- a/driver/tcpm/anx7447.c
+++ b/driver/tcpm/anx7447.c
@@ -825,7 +825,7 @@ const struct tcpm_drv anx7447_tcpm_drv = {
.drp_toggle = anx7447_tcpc_drp_toggle,
#endif
.get_chip_info = &tcpci_get_chip_info,
-#ifdef CONFIG_USBC_PPC
+#ifdef CONFIG_USB_PD_PPC
.set_snk_ctrl = &tcpci_tcpm_set_snk_ctrl,
.set_src_ctrl = &tcpci_tcpm_set_src_ctrl,
#endif
diff --git a/driver/tcpm/mt6370.c b/driver/tcpm/mt6370.c
index 2adaac1901..100a4d9eeb 100644
--- a/driver/tcpm/mt6370.c
+++ b/driver/tcpm/mt6370.c
@@ -211,7 +211,7 @@ const struct tcpm_drv mt6370_tcpm_drv = {
.drp_toggle = &tcpci_tcpc_drp_toggle,
#endif
.get_chip_info = &tcpci_get_chip_info,
-#ifdef CONFIG_USBC_PPC
+#ifdef CONFIG_USB_PD_PPC
.set_snk_ctrl = &tcpci_tcpm_set_snk_ctrl,
.set_src_ctrl = &tcpci_tcpm_set_src_ctrl,
#endif
diff --git a/driver/tcpm/nct38xx.c b/driver/tcpm/nct38xx.c
index 061af3662d..5d2be3ad2f 100644
--- a/driver/tcpm/nct38xx.c
+++ b/driver/tcpm/nct38xx.c
@@ -172,6 +172,7 @@ static int nct38xx_tcpm_set_cc(int port, int pull)
return tcpci_tcpm_set_cc(port, pull);
}
+#ifdef CONFIG_USB_PD_PPC
static int nct38xx_tcpm_set_snk_ctrl(int port, int enable)
{
int rv;
@@ -191,6 +192,7 @@ static int nct38xx_tcpm_set_snk_ctrl(int port, int enable)
return tcpci_tcpm_set_snk_ctrl(port, enable);
}
+#endif
static void nct38xx_tcpc_alert(int port)
{
@@ -271,7 +273,7 @@ const struct tcpm_drv nct38xx_tcpm_drv = {
#ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
.drp_toggle = &tcpci_tcpc_drp_toggle,
#endif
-#ifdef CONFIG_USBC_PPC
+#ifdef CONFIG_USB_PD_PPC
.get_snk_ctrl = &tcpci_tcpm_get_snk_ctrl,
.set_snk_ctrl = &nct38xx_tcpm_set_snk_ctrl,
.get_src_ctrl = &tcpci_tcpm_get_src_ctrl,
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c
index dfcede84e2..14581a346b 100644
--- a/driver/tcpm/ps8xxx.c
+++ b/driver/tcpm/ps8xxx.c
@@ -730,7 +730,7 @@ const struct tcpm_drv ps8xxx_tcpm_drv = {
#ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
.drp_toggle = &ps8xxx_tcpc_drp_toggle,
#endif
-#ifdef CONFIG_USBC_PPC
+#ifdef CONFIG_USB_PD_PPC
.set_snk_ctrl = &tcpci_tcpm_set_snk_ctrl,
.set_src_ctrl = &tcpci_tcpm_set_src_ctrl,
#endif
diff --git a/driver/tcpm/rt1715.c b/driver/tcpm/rt1715.c
index 4e557d7808..ed3d283bc9 100644
--- a/driver/tcpm/rt1715.c
+++ b/driver/tcpm/rt1715.c
@@ -251,7 +251,7 @@ const struct tcpm_drv rt1715_tcpm_drv = {
#ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
.drp_toggle = &tcpci_tcpc_drp_toggle,
#endif
-#ifdef CONFIG_USBC_PPC
+#ifdef CONFIG_USB_PD_PPC
.set_snk_ctrl = &tcpci_tcpm_set_snk_ctrl,
.set_src_ctrl = &tcpci_tcpm_set_src_ctrl,
#endif
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index 24a24d45df..64707c67df 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -574,7 +574,7 @@ int tcpci_tcpm_set_polarity(int port, enum tcpc_cc_polarity polarity)
? MASK_SET : MASK_CLR);
}
-#ifdef CONFIG_USBC_PPC
+#ifdef CONFIG_USB_PD_PPC
int tcpci_tcpm_get_snk_ctrl(int port, bool *sinking)
{
int rv;
@@ -1780,8 +1780,10 @@ const struct tcpm_drv tcpci_tcpm_drv = {
.drp_toggle = &tcpci_tcpc_drp_toggle,
#endif
.get_chip_info = &tcpci_get_chip_info,
-#ifdef CONFIG_USBC_PPC
+#ifdef CONFIG_USB_PD_PPC
+ .get_snk_ctrl = &tcpci_tcpm_get_snk_ctrl,
.set_snk_ctrl = &tcpci_tcpm_set_snk_ctrl,
+ .get_src_ctrl = &tcpci_tcpm_get_src_ctrl,
.set_src_ctrl = &tcpci_tcpm_set_src_ctrl,
#endif
#ifdef CONFIG_USB_PD_TCPC_LOW_POWER
diff --git a/driver/tcpm/tusb422.c b/driver/tcpm/tusb422.c
index 7910b8b2de..f2a4ec2fb3 100644
--- a/driver/tcpm/tusb422.c
+++ b/driver/tcpm/tusb422.c
@@ -180,7 +180,7 @@ const struct tcpm_drv tusb422_tcpm_drv = {
#ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
.drp_toggle = &tusb422_tcpc_drp_toggle,
#endif
-#ifdef CONFIG_USBC_PPC
+#ifdef CONFIG_USB_PD_PPC
.set_snk_ctrl = &tcpci_tcpm_set_snk_ctrl,
.set_src_ctrl = &tcpci_tcpm_set_src_ctrl,
#endif