summaryrefslogtreecommitdiff
path: root/board/scout
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:56:03 +0000
commit262172c84b5d4a1688a9df806b3ec42ab40fb4a9 (patch)
tree1bc36b9cc7c4acb762845fd9a40bd906ecc30fee /board/scout
parent23a975d12e3453aac4e9a15048ba43a8989d3073 (diff)
downloadchrome-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/scout')
-rw-r--r--board/scout/board.c48
1 files changed, 42 insertions, 6 deletions
diff --git a/board/scout/board.c b/board/scout/board.c
index 69bee46cf9..b26f581f58 100644
--- a/board/scout/board.c
+++ b/board/scout/board.c
@@ -233,12 +233,48 @@ const struct pwm_t pwm_channels[] = {
/******************************************************************************/
/* I2C port map configuration */
const struct i2c_port_t i2c_ports[] = {
- {"ina", I2C_PORT_INA, 400, GPIO_I2C0_SCL, GPIO_I2C0_SDA},
- {"ppc0", I2C_PORT_PPC0, 400, GPIO_I2C1_SCL, GPIO_I2C1_SDA},
- {"scaler", I2C_PORT_SCALER, 400, GPIO_I2C2_SCL, GPIO_I2C2_SDA},
- {"tcpc0", I2C_PORT_TCPC0, 400, GPIO_I2C3_SCL, GPIO_I2C3_SDA},
- {"power", I2C_PORT_POWER, 400, GPIO_I2C5_SCL, GPIO_I2C5_SDA},
- {"eeprom", I2C_PORT_EEPROM, 400, GPIO_I2C7_SCL, GPIO_I2C7_SDA},
+ {
+ .name = "ina",
+ .port = I2C_PORT_INA,
+ .kbps = 400,
+ .scl = GPIO_I2C0_SCL,
+ .sda = GPIO_I2C0_SDA
+ },
+ {
+ .name = "ppc0",
+ .port = I2C_PORT_PPC0,
+ .kbps = 400,
+ .scl = GPIO_I2C1_SCL,
+ .sda = GPIO_I2C1_SDA
+ },
+ {
+ .name = "scaler",
+ .port = I2C_PORT_SCALER,
+ .kbps = 400,
+ .scl = GPIO_I2C2_SCL,
+ .sda = GPIO_I2C2_SDA
+ },
+ {
+ .name = "tcpc0",
+ .port = I2C_PORT_TCPC0,
+ .kbps = 400,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA
+ },
+ {
+ .name = "power",
+ .port = I2C_PORT_POWER,
+ .kbps = 400,
+ .scl = GPIO_I2C5_SCL,
+ .sda = GPIO_I2C5_SDA
+ },
+ {
+ .name = "eeprom",
+ .port = I2C_PORT_EEPROM,
+ .kbps = 400,
+ .scl = GPIO_I2C7_SCL,
+ .sda = GPIO_I2C7_SDA
+ },
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);