summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2023-03-20 08:40:05 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-21 19:36:11 +0000
commitb77285b17f20800855b8d5ac472feefcf569b799 (patch)
tree03cf39366c1e16c01f26dd814e25d4a1e866bf21
parentb1baecf3df305ec7758d7b98e17e69a88926f028 (diff)
downloadchrome-ec-b77285b17f20800855b8d5ac472feefcf569b799.tar.gz
zephyr: ppc: Cleanup PPC chip macro
Move the separator from each individual PPC chip macro. This allows the same macro to be used outside an array definition. BUG=b:274126703 BRANCH=none TEST=zmake compare-builds Change-Id: I62307c5ba6c58f45566e2d65be491e56e9517fd9 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4354879 Tested-by: Madhu 🌱 <mparuchuri@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
-rw-r--r--zephyr/shim/include/usbc/ppc_aoz1380.h5
-rw-r--r--zephyr/shim/include/usbc/ppc_nx20p348x.h9
-rw-r--r--zephyr/shim/include/usbc/ppc_rt1739.h17
-rw-r--r--zephyr/shim/include/usbc/ppc_sn5s330.h9
-rw-r--r--zephyr/shim/include/usbc/ppc_syv682x.h5
-rw-r--r--zephyr/shim/src/ppc.c2
6 files changed, 25 insertions, 22 deletions
diff --git a/zephyr/shim/include/usbc/ppc_aoz1380.h b/zephyr/shim/include/usbc/ppc_aoz1380.h
index 1ff20b802f..d944fc8eac 100644
--- a/zephyr/shim/include/usbc/ppc_aoz1380.h
+++ b/zephyr/shim/include/usbc/ppc_aoz1380.h
@@ -8,4 +8,7 @@
#define AOZ1380_COMPAT aoz_aoz1380
/* Note: This chip has no i2c interface */
-#define PPC_CHIP_AOZ1380(id) { .drv = &aoz1380_drv },
+#define PPC_CHIP_AOZ1380(id) \
+ { \
+ .drv = &aoz1380_drv \
+ }
diff --git a/zephyr/shim/include/usbc/ppc_nx20p348x.h b/zephyr/shim/include/usbc/ppc_nx20p348x.h
index 2d36ab09f6..14336ff215 100644
--- a/zephyr/shim/include/usbc/ppc_nx20p348x.h
+++ b/zephyr/shim/include/usbc/ppc_nx20p348x.h
@@ -7,7 +7,8 @@
#define NX20P348X_COMPAT nxp_nx20p348x
-#define PPC_CHIP_NX20P348X(id) \
- { .i2c_port = I2C_PORT_BY_DEV(id), \
- .i2c_addr_flags = DT_REG_ADDR(id), \
- .drv = &nx20p348x_drv },
+#define PPC_CHIP_NX20P348X(id) \
+ { \
+ .i2c_port = I2C_PORT_BY_DEV(id), \
+ .i2c_addr_flags = DT_REG_ADDR(id), .drv = &nx20p348x_drv \
+ }
diff --git a/zephyr/shim/include/usbc/ppc_rt1739.h b/zephyr/shim/include/usbc/ppc_rt1739.h
index a736ce69e3..c740c1c43a 100644
--- a/zephyr/shim/include/usbc/ppc_rt1739.h
+++ b/zephyr/shim/include/usbc/ppc_rt1739.h
@@ -7,12 +7,11 @@
#define RT1739_PPC_COMPAT richtek_rt1739_ppc
-#define PPC_CHIP_RT1739(id) \
- { \
- .i2c_port = I2C_PORT_BY_DEV(id), \
- .i2c_addr_flags = DT_REG_ADDR(id), \
- .drv = &rt1739_ppc_drv, \
- .frs_en = COND_CODE_1( \
- DT_NODE_HAS_PROP(id, frs_en_gpio), \
- (GPIO_SIGNAL(DT_PHANDLE(id, frs_en_gpio))), (0)), \
- },
+#define PPC_CHIP_RT1739(id) \
+ { \
+ .i2c_port = I2C_PORT_BY_DEV(id), \
+ .i2c_addr_flags = DT_REG_ADDR(id), .drv = &rt1739_ppc_drv, \
+ .frs_en = COND_CODE_1( \
+ DT_NODE_HAS_PROP(id, frs_en_gpio), \
+ (GPIO_SIGNAL(DT_PHANDLE(id, frs_en_gpio))), (0)), \
+ }
diff --git a/zephyr/shim/include/usbc/ppc_sn5s330.h b/zephyr/shim/include/usbc/ppc_sn5s330.h
index 2b70d69e64..eef2fca843 100644
--- a/zephyr/shim/include/usbc/ppc_sn5s330.h
+++ b/zephyr/shim/include/usbc/ppc_sn5s330.h
@@ -8,7 +8,8 @@
#define SN5S330_COMPAT ti_sn5s330
#define SN5S330_EMUL_COMPAT cros_sn5s330_emul
-#define PPC_CHIP_SN5S330(id) \
- { .i2c_port = I2C_PORT_BY_DEV(id), \
- .i2c_addr_flags = DT_REG_ADDR(id), \
- .drv = &sn5s330_drv },
+#define PPC_CHIP_SN5S330(id) \
+ { \
+ .i2c_port = I2C_PORT_BY_DEV(id), \
+ .i2c_addr_flags = DT_REG_ADDR(id), .drv = &sn5s330_drv \
+ }
diff --git a/zephyr/shim/include/usbc/ppc_syv682x.h b/zephyr/shim/include/usbc/ppc_syv682x.h
index 9924e6da5e..87432c2b62 100644
--- a/zephyr/shim/include/usbc/ppc_syv682x.h
+++ b/zephyr/shim/include/usbc/ppc_syv682x.h
@@ -11,9 +11,8 @@
#define PPC_CHIP_SYV682X(id) \
{ \
.i2c_port = I2C_PORT_BY_DEV(id), \
- .i2c_addr_flags = DT_REG_ADDR(id), \
- .drv = &syv682x_drv, \
+ .i2c_addr_flags = DT_REG_ADDR(id), .drv = &syv682x_drv, \
.frs_en = COND_CODE_1( \
DT_NODE_HAS_PROP(id, frs_en_gpio), \
(GPIO_SIGNAL(DT_PHANDLE(id, frs_en_gpio))), (0)), \
- },
+ }
diff --git a/zephyr/shim/src/ppc.c b/zephyr/shim/src/ppc.c
index c15c6900b1..f86640540d 100644
--- a/zephyr/shim/src/ppc.c
+++ b/zephyr/shim/src/ppc.c
@@ -22,7 +22,7 @@
DT_HAS_COMPAT_STATUS_OKAY(SYV682X_EMUL_COMPAT)
#define PPC_CHIP_ENTRY(usbc_id, ppc_id, config_fn) \
- [USBC_PORT_NEW(usbc_id)] = config_fn(ppc_id)
+ [USBC_PORT_NEW(usbc_id)] = config_fn(ppc_id),
#define CHECK_COMPAT(compat, usbc_id, ppc_id, config_fn) \
COND_CODE_1(DT_NODE_HAS_COMPAT(ppc_id, compat), \