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:56:03 +0000 |
commit | 262172c84b5d4a1688a9df806b3ec42ab40fb4a9 (patch) | |
tree | 1bc36b9cc7c4acb762845fd9a40bd906ecc30fee /board/oak | |
parent | 23a975d12e3453aac4e9a15048ba43a8989d3073 (diff) | |
download | chrome-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/oak')
-rw-r--r-- | board/oak/board.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/board/oak/board.c b/board/oak/board.c index e8eba6d45b..0275981446 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -97,8 +97,20 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - {"battery", I2C_PORT_BATTERY, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA}, - {"pd", I2C_PORT_PD_MCU, 1000, GPIO_I2C1_SCL, GPIO_I2C1_SDA} + { + .name = "battery", + .port = I2C_PORT_BATTERY, + .kbps = 100, + .scl = GPIO_I2C0_SCL, + .sda = GPIO_I2C0_SDA + }, + { + .name = "pd", + .port = I2C_PORT_PD_MCU, + .kbps = 1000, + .scl = GPIO_I2C1_SCL, + .sda = GPIO_I2C1_SDA + } }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); |