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:59 +0000 |
commit | 23a975d12e3453aac4e9a15048ba43a8989d3073 (patch) | |
tree | f0162d7118edfe154f283a4e2206f130ebd21bab /board/hammer | |
parent | 508e74c84334bc3d2118c7f333320a4f7292ea6f (diff) | |
download | chrome-ec-23a975d12e3453aac4e9a15048ba43a8989d3073.tar.gz |
i2c: Use declared initializers for i2c_ports: boards a-l
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: Ibced584424f1f64718fb55cec0c972dc939bec5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300661
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'board/hammer')
-rw-r--r-- | board/hammer/board.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/board/hammer/board.c b/board/hammer/board.c index b68498acfb..b9667a9916 100644 --- a/board/hammer/board.c +++ b/board/hammer/board.c @@ -90,11 +90,21 @@ void usb_spi_board_disable(struct usb_spi_config const *config) {} #ifdef CONFIG_I2C /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - {"master", I2C_PORT_MASTER, 400, - GPIO_MASTER_I2C_SCL, GPIO_MASTER_I2C_SDA}, + { + .name = "master", + .port = I2C_PORT_MASTER, + .kbps = 400, + .scl = GPIO_MASTER_I2C_SCL, + .sda = GPIO_MASTER_I2C_SDA + }, #ifdef BOARD_WAND - {"charger", I2C_PORT_CHARGER, 100, - GPIO_CHARGER_I2C_SCL, GPIO_CHARGER_I2C_SDA}, + { + .name = "charger", + .port = I2C_PORT_CHARGER, + .kbps = 100, + .scl = GPIO_CHARGER_I2C_SCL, + .sda = GPIO_CHARGER_I2C_SDA + }, #endif }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); |