summaryrefslogtreecommitdiff
path: root/zephyr/shim/include/usbc
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2022-07-27 12:54:18 +0200
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-05 16:15:24 +0000
commit9a86e5939514697873a56635447bf29787963f71 (patch)
tree2980c5cd84471c3a81747ffc3afd6de991672d67 /zephyr/shim/include/usbc
parentd407150b509ec87aec2b066bce95582a3180c9db (diff)
downloadchrome-ec-9a86e5939514697873a56635447bf29787963f71.tar.gz
zephyr: move tcpc nodes onto i2c buses
Move all tcpc nodes onto the i2c buses from named-usbc-port nodes. The change should simplify the upstream process of the tcpc chips drivers. BUG=b:240617928 TEST=zmake testall; make sure all TCPCs work by attaching a charger BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I9dfd1187fcb222df41bc3f129265e7dfd0e0c4eb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3797608 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Dawid Niedźwiecki <dn@semihalf.com>
Diffstat (limited to 'zephyr/shim/include/usbc')
-rw-r--r--zephyr/shim/include/usbc/tcpc_anx7447.h17
-rw-r--r--zephyr/shim/include/usbc/tcpc_ccgxxf.h17
-rw-r--r--zephyr/shim/include/usbc/tcpc_fusb302.h15
-rw-r--r--zephyr/shim/include/usbc/tcpc_it8xxx2.h2
-rw-r--r--zephyr/shim/include/usbc/tcpc_nct38xx.h17
-rw-r--r--zephyr/shim/include/usbc/tcpc_ps8xxx.h17
-rw-r--r--zephyr/shim/include/usbc/tcpc_rt1718s.h25
-rw-r--r--zephyr/shim/include/usbc/tcpci.h14
8 files changed, 56 insertions, 68 deletions
diff --git a/zephyr/shim/include/usbc/tcpc_anx7447.h b/zephyr/shim/include/usbc/tcpc_anx7447.h
index 7f5c0891f9..8342157827 100644
--- a/zephyr/shim/include/usbc/tcpc_anx7447.h
+++ b/zephyr/shim/include/usbc/tcpc_anx7447.h
@@ -9,13 +9,12 @@
#define ANX7447_TCPC_COMPAT anologix_anx7447_tcpc
#define TCPC_CONFIG_ANX7447(id) \
- { \
- .bus_type = EC_BUS_TYPE_I2C, \
- .i2c_info = { \
- .port = I2C_PORT(DT_PHANDLE(id, port)), \
- .addr_flags = DT_STRING_UPPER_TOKEN( \
- id, i2c_addr_flags), \
- }, \
- .drv = &anx7447_tcpm_drv, \
- .flags = DT_PROP(id, tcpc_flags), \
+ { \
+ .bus_type = EC_BUS_TYPE_I2C, \
+ .i2c_info = { \
+ .port = I2C_PORT_BY_DEV(id), \
+ .addr_flags = DT_REG_ADDR(id), \
+ }, \
+ .drv = &anx7447_tcpm_drv, \
+ .flags = DT_PROP(id, tcpc_flags), \
},
diff --git a/zephyr/shim/include/usbc/tcpc_ccgxxf.h b/zephyr/shim/include/usbc/tcpc_ccgxxf.h
index e19220d40e..e13598f4a2 100644
--- a/zephyr/shim/include/usbc/tcpc_ccgxxf.h
+++ b/zephyr/shim/include/usbc/tcpc_ccgxxf.h
@@ -9,13 +9,12 @@
#define CCGXXF_TCPC_COMPAT cypress_ccgxxf
#define TCPC_CONFIG_CCGXXF(id) \
- { \
- .bus_type = EC_BUS_TYPE_I2C, \
- .i2c_info = { \
- .port = I2C_PORT(DT_PHANDLE(id, port)), \
- .addr_flags = DT_STRING_UPPER_TOKEN( \
- id, i2c_addr_flags), \
- }, \
- .drv = &ccgxxf_tcpm_drv, \
- .flags = TCPC_FLAGS_TCPCI_REV2_0, \
+ { \
+ .bus_type = EC_BUS_TYPE_I2C, \
+ .i2c_info = { \
+ .port = I2C_PORT_BY_DEV(id), \
+ .addr_flags = DT_REG_ADDR(id), \
+ }, \
+ .drv = &ccgxxf_tcpm_drv, \
+ .flags = TCPC_FLAGS_TCPCI_REV2_0, \
},
diff --git a/zephyr/shim/include/usbc/tcpc_fusb302.h b/zephyr/shim/include/usbc/tcpc_fusb302.h
index 5333361929..c5f735bd18 100644
--- a/zephyr/shim/include/usbc/tcpc_fusb302.h
+++ b/zephyr/shim/include/usbc/tcpc_fusb302.h
@@ -9,12 +9,11 @@
#define FUSB302_TCPC_COMPAT fairchild_fusb302
#define TCPC_CONFIG_FUSB302(id) \
- { \
- .bus_type = EC_BUS_TYPE_I2C, \
- .i2c_info = { \
- .port = I2C_PORT(DT_PHANDLE(id, port)), \
- .addr_flags = DT_STRING_UPPER_TOKEN( \
- id, i2c_addr_flags), \
- }, \
- .drv = &fusb302_tcpm_drv, \
+ { \
+ .bus_type = EC_BUS_TYPE_I2C, \
+ .i2c_info = { \
+ .port = I2C_PORT_BY_DEV(id), \
+ .addr_flags = DT_REG_ADDR(id), \
+ }, \
+ .drv = &fusb302_tcpm_drv, \
},
diff --git a/zephyr/shim/include/usbc/tcpc_it8xxx2.h b/zephyr/shim/include/usbc/tcpc_it8xxx2.h
index f8f77a6d18..543290a893 100644
--- a/zephyr/shim/include/usbc/tcpc_it8xxx2.h
+++ b/zephyr/shim/include/usbc/tcpc_it8xxx2.h
@@ -6,7 +6,7 @@
#include <zephyr/devicetree.h>
#include "driver/tcpm/it8xxx2_pd_public.h"
-#define IT8XXX2_TCPC_COMPAT ite_it8xxx2_tcpc
+#define IT8XXX2_TCPC_COMPAT ite_it8xxx2_usbpd
#define TCPC_CONFIG_IT8XXX2(id) \
{ \
diff --git a/zephyr/shim/include/usbc/tcpc_nct38xx.h b/zephyr/shim/include/usbc/tcpc_nct38xx.h
index 377e19e63d..ebb0452f35 100644
--- a/zephyr/shim/include/usbc/tcpc_nct38xx.h
+++ b/zephyr/shim/include/usbc/tcpc_nct38xx.h
@@ -12,15 +12,14 @@
#define NCT38XX_TCPC_COMPAT nuvoton_nct38xx
#define TCPC_CONFIG_NCT38XX(id) \
- { \
- .bus_type = EC_BUS_TYPE_I2C, \
- .i2c_info = { \
- .port = I2C_PORT(DT_PHANDLE(id, port)), \
- .addr_flags = DT_STRING_UPPER_TOKEN( \
- id, i2c_addr_flags), \
- }, \
- .drv = &nct38xx_tcpm_drv, \
- .flags = DT_PROP(id, tcpc_flags), \
+ { \
+ .bus_type = EC_BUS_TYPE_I2C, \
+ .i2c_info = { \
+ .port = I2C_PORT_BY_DEV(id), \
+ .addr_flags = DT_REG_ADDR(id), \
+ }, \
+ .drv = &nct38xx_tcpm_drv, \
+ .flags = DT_PROP(id, tcpc_flags), \
},
/**
diff --git a/zephyr/shim/include/usbc/tcpc_ps8xxx.h b/zephyr/shim/include/usbc/tcpc_ps8xxx.h
index 379b041e8e..43f8fee9d5 100644
--- a/zephyr/shim/include/usbc/tcpc_ps8xxx.h
+++ b/zephyr/shim/include/usbc/tcpc_ps8xxx.h
@@ -9,13 +9,12 @@
#define PS8XXX_COMPAT parade_ps8xxx
#define TCPC_CONFIG_PS8XXX(id) \
- { \
- .bus_type = EC_BUS_TYPE_I2C, \
- .i2c_info = { \
- .port = I2C_PORT(DT_PHANDLE(id, port)), \
- .addr_flags = DT_STRING_UPPER_TOKEN( \
- id, i2c_addr_flags), \
- }, \
- .drv = &ps8xxx_tcpm_drv, \
- .flags = DT_PROP(id, tcpc_flags), \
+ { \
+ .bus_type = EC_BUS_TYPE_I2C, \
+ .i2c_info = { \
+ .port = I2C_PORT_BY_DEV(id), \
+ .addr_flags = DT_REG_ADDR(id), \
+ }, \
+ .drv = &ps8xxx_tcpm_drv, \
+ .flags = DT_PROP(id, tcpc_flags), \
},
diff --git a/zephyr/shim/include/usbc/tcpc_rt1718s.h b/zephyr/shim/include/usbc/tcpc_rt1718s.h
index 7da7427a98..4374fb5be6 100644
--- a/zephyr/shim/include/usbc/tcpc_rt1718s.h
+++ b/zephyr/shim/include/usbc/tcpc_rt1718s.h
@@ -8,20 +8,13 @@
#define RT1718S_TCPC_COMPAT richtek_rt1718s_tcpc
-/*
- * Currently, the clang-format will force the back-slash at col:81. Enable
- * format after we fix the issue.
- */
-/* clang-format off */
-#define TCPC_CONFIG_RT1718S(id) \
- { \
- .bus_type = EC_BUS_TYPE_I2C, \
- .i2c_info = { \
- .port = I2C_PORT(DT_PHANDLE(id, port)), \
- .addr_flags = DT_STRING_UPPER_TOKEN( \
- id, i2c_addr_flags), \
- }, \
- .drv = &rt1718s_tcpm_drv, \
- .flags = DT_PROP(id, tcpc_flags), \
+#define TCPC_CONFIG_RT1718S(id) \
+ { \
+ .bus_type = EC_BUS_TYPE_I2C, \
+ .i2c_info = { \
+ .port = I2C_PORT_BY_DEV(id), \
+ .addr_flags = DT_REG_ADDR(id), \
+ }, \
+ .drv = &rt1718s_tcpm_drv, \
+ .flags = DT_PROP(id, tcpc_flags), \
},
-/* clang-format on */
diff --git a/zephyr/shim/include/usbc/tcpci.h b/zephyr/shim/include/usbc/tcpci.h
index f65b6b7717..159e85ee27 100644
--- a/zephyr/shim/include/usbc/tcpci.h
+++ b/zephyr/shim/include/usbc/tcpci.h
@@ -10,11 +10,11 @@
#define TCPCI_COMPAT cros_ec_tcpci
#define TCPC_CONFIG_TCPCI(id) \
- { \
- .bus_type = EC_BUS_TYPE_I2C, \
- .i2c_info = { \
- .port = I2C_PORT(DT_PHANDLE(id, port)), \
- .addr_flags = DT_PROP(id, i2c_addr_flags), \
- }, \
- .drv = &tcpci_tcpm_drv, \
+ { \
+ .bus_type = EC_BUS_TYPE_I2C, \
+ .i2c_info = { \
+ .port = I2C_PORT_BY_DEV(id), \
+ .addr_flags = DT_REG_ADDR(id), \
+ }, \
+ .drv = &tcpci_tcpm_drv, \
},