summaryrefslogtreecommitdiff
path: root/board/quackingstick
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:55:26 +0000
commitd4832f0d001fa567e633b9c37af2b78a38592403 (patch)
tree93660f36648bbcde1d310c4f56314b67519c044f /board/quackingstick
parent793adf40240c93b49ab87dd04e94ab37ce594f3f (diff)
downloadchrome-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/quackingstick')
-rw-r--r--board/quackingstick/board.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/board/quackingstick/board.c b/board/quackingstick/board.c
index 11fbb6cb12..3ab1d69c2e 100644
--- a/board/quackingstick/board.c
+++ b/board/quackingstick/board.c
@@ -102,14 +102,34 @@ static void board_connect_c0_sbu(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},
- {"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 = "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);