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:26 +0000 |
commit | d4832f0d001fa567e633b9c37af2b78a38592403 (patch) | |
tree | 93660f36648bbcde1d310c4f56314b67519c044f /board/coachz | |
parent | 793adf40240c93b49ab87dd04e94ab37ce594f3f (diff) | |
download | chrome-ec-d4832f0d001fa567e633b9c37af2b78a38592403.tar.gz |
i2c: Use declared initializers for i2c_ports: trogdor 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: Ibecd375996b92119eca35721d084c35b6e4e6f1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300186
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'board/coachz')
-rw-r--r-- | board/coachz/board.c | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/board/coachz/board.c b/board/coachz/board.c index 81a749c1d1..01c4d85b95 100644 --- a/board/coachz/board.c +++ b/board/coachz/board.c @@ -191,18 +191,48 @@ static void ks_interrupt(enum gpio_signal s) /* I2C port map */ const struct i2c_port_t i2c_ports[] = { - {"power", I2C_PORT_POWER, 100, GPIO_EC_I2C_POWER_SCL, - GPIO_EC_I2C_POWER_SDA}, - {"tcpc0", I2C_PORT_TCPC0, 1000, GPIO_EC_I2C_USB_C0_PD_SCL, - GPIO_EC_I2C_USB_C0_PD_SDA}, - {"tcpc1", I2C_PORT_TCPC1, 1000, GPIO_EC_I2C_USB_C1_PD_SCL, - GPIO_EC_I2C_USB_C1_PD_SDA}, - {"wlc", I2C_PORT_WLC, 400, GPIO_EC_I2C_WLC_SCL, - GPIO_EC_I2C_WLC_SDA}, - {"eeprom", I2C_PORT_EEPROM, 400, GPIO_EC_I2C_EEPROM_SCL, - GPIO_EC_I2C_EEPROM_SDA}, - {"sensor", I2C_PORT_SENSOR, 400, GPIO_EC_I2C_SENSOR_SCL, - GPIO_EC_I2C_SENSOR_SDA}, + { + .name = "power", + .port = I2C_PORT_POWER, + .kbps = 100, + .scl = GPIO_EC_I2C_POWER_SCL, + .sda = GPIO_EC_I2C_POWER_SDA + }, + { + .name = "tcpc0", + .port = I2C_PORT_TCPC0, + .kbps = 1000, + .scl = GPIO_EC_I2C_USB_C0_PD_SCL, + .sda = GPIO_EC_I2C_USB_C0_PD_SDA + }, + { + .name = "tcpc1", + .port = I2C_PORT_TCPC1, + .kbps = 1000, + .scl = GPIO_EC_I2C_USB_C1_PD_SCL, + .sda = GPIO_EC_I2C_USB_C1_PD_SDA + }, + { + .name = "wlc", + .port = I2C_PORT_WLC, + .kbps = 400, + .scl = GPIO_EC_I2C_WLC_SCL, + .sda = GPIO_EC_I2C_WLC_SDA + }, + { + .name = "eeprom", + .port = I2C_PORT_EEPROM, + .kbps = 400, + .scl = GPIO_EC_I2C_EEPROM_SCL, + .sda = GPIO_EC_I2C_EEPROM_SDA + }, + { + .name = "sensor", + .port = I2C_PORT_SENSOR, + .kbps = 400, + .scl = GPIO_EC_I2C_SENSOR_SCL, + .sda = GPIO_EC_I2C_SENSOR_SDA + }, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); |