summaryrefslogtreecommitdiff
path: root/board/poppy
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-11-18 16:54:54 -0700
committerCommit Bot <commit-bot@chromium.org>2021-11-30 23:56:03 +0000
commit262172c84b5d4a1688a9df806b3ec42ab40fb4a9 (patch)
tree1bc36b9cc7c4acb762845fd9a40bd906ecc30fee /board/poppy
parent23a975d12e3453aac4e9a15048ba43a8989d3073 (diff)
downloadchrome-ec-262172c84b5d4a1688a9df806b3ec42ab40fb4a9.tar.gz
i2c: Use declared initializers for i2c_ports: boards m-z
Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ib4ff8cfd7bd8090c45d8804f0bebcb2426f3cc7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300662 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board/poppy')
-rw-r--r--board/poppy/board.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/board/poppy/board.c b/board/poppy/board.c
index 2124faa421..9dc0250e80 100644
--- a/board/poppy/board.c
+++ b/board/poppy/board.c
@@ -179,11 +179,41 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
/* I2C port map */
const struct i2c_port_t i2c_ports[] = {
- {"tcpc", NPCX_I2C_PORT0_0, 400, GPIO_I2C0_0_SCL, GPIO_I2C0_0_SDA},
- {"als", NPCX_I2C_PORT0_1, 400, GPIO_I2C0_1_SCL, GPIO_I2C0_1_SDA},
- {"charger", NPCX_I2C_PORT1, 100, GPIO_I2C1_SCL, GPIO_I2C1_SDA},
- {"pmic", NPCX_I2C_PORT2, 400, GPIO_I2C2_SCL, GPIO_I2C2_SDA},
- {"accelgyro", NPCX_I2C_PORT3, 400, GPIO_I2C3_SCL, GPIO_I2C3_SDA},
+ {
+ .name = "tcpc",
+ .port = NPCX_I2C_PORT0_0,
+ .kbps = 400,
+ .scl = GPIO_I2C0_0_SCL,
+ .sda = GPIO_I2C0_0_SDA
+ },
+ {
+ .name = "als",
+ .port = NPCX_I2C_PORT0_1,
+ .kbps = 400,
+ .scl = GPIO_I2C0_1_SCL,
+ .sda = GPIO_I2C0_1_SDA
+ },
+ {
+ .name = "charger",
+ .port = NPCX_I2C_PORT1,
+ .kbps = 100,
+ .scl = GPIO_I2C1_SCL,
+ .sda = GPIO_I2C1_SDA
+ },
+ {
+ .name = "pmic",
+ .port = NPCX_I2C_PORT2,
+ .kbps = 400,
+ .scl = GPIO_I2C2_SCL,
+ .sda = GPIO_I2C2_SDA
+ },
+ {
+ .name = "accelgyro",
+ .port = NPCX_I2C_PORT3,
+ .kbps = 400,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA
+ },
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);