diff options
author | Keith Short <keithshort@chromium.org> | 2021-11-18 16:54:54 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-30 23:55:40 +0000 |
commit | 5e751370559ed41302a06c2b664c0f47f7f1bb89 (patch) | |
tree | 819fa1900ca57cfb728ff5dc211573d6b1a4ffc7 /board/npcx7_evb/board.c | |
parent | cdc4811ebe80e0e7a0edeb093dc74b9d947290bb (diff) | |
download | chrome-ec-5e751370559ed41302a06c2b664c0f47f7f1bb89.tar.gz |
i2c: Use declared initializers for i2c_ports: eval boards
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: Ib6f4bd684f76a34a74ddd8f476c78223b8ccf2bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300659
Reviewed-by: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'board/npcx7_evb/board.c')
-rw-r--r-- | board/npcx7_evb/board.c | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/board/npcx7_evb/board.c b/board/npcx7_evb/board.c index 9ddaf9bd51..7909668d2c 100644 --- a/board/npcx7_evb/board.c +++ b/board/npcx7_evb/board.c @@ -82,11 +82,41 @@ BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT); /******************************************************************************/ /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - {"master0-0", NPCX_I2C_PORT0_0, 100, GPIO_I2C0_SCL0, GPIO_I2C0_SDA0}, - {"master1-0", NPCX_I2C_PORT1_0, 100, GPIO_I2C1_SCL0, GPIO_I2C1_SDA0}, - {"master2-0", NPCX_I2C_PORT2_0, 100, GPIO_I2C2_SCL0, GPIO_I2C2_SDA0}, - {"master3-0", NPCX_I2C_PORT3_0, 100, GPIO_I2C3_SCL0, GPIO_I2C3_SDA0}, - {"master7-0", NPCX_I2C_PORT7_0, 100, GPIO_I2C7_SCL0, GPIO_I2C7_SDA0}, + { + .name = "master0-0", + .port = NPCX_I2C_PORT0_0, + .kbps = 100, + .scl = GPIO_I2C0_SCL0, + .sda = GPIO_I2C0_SDA0 + }, + { + .name = "master1-0", + .port = NPCX_I2C_PORT1_0, + .kbps = 100, + .scl = GPIO_I2C1_SCL0, + .sda = GPIO_I2C1_SDA0 + }, + { + .name = "master2-0", + .port = NPCX_I2C_PORT2_0, + .kbps = 100, + .scl = GPIO_I2C2_SCL0, + .sda = GPIO_I2C2_SDA0 + }, + { + .name = "master3-0", + .port = NPCX_I2C_PORT3_0, + .kbps = 100, + .scl = GPIO_I2C3_SCL0, + .sda = GPIO_I2C3_SDA0 + }, + { + .name = "master7-0", + .port = NPCX_I2C_PORT7_0, + .kbps = 100, + .scl = GPIO_I2C7_SCL0, + .sda = GPIO_I2C7_SDA0 + }, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); |