summaryrefslogtreecommitdiff
path: root/board/atlas
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:59 +0000
commit23a975d12e3453aac4e9a15048ba43a8989d3073 (patch)
treef0162d7118edfe154f283a4e2206f130ebd21bab /board/atlas
parent508e74c84334bc3d2118c7f333320a4f7292ea6f (diff)
downloadchrome-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/atlas')
-rw-r--r--board/atlas/board.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/board/atlas/board.c b/board/atlas/board.c
index 4881ed6898..64d0789dd9 100644
--- a/board/atlas/board.c
+++ b/board/atlas/board.c
@@ -139,16 +139,41 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
/* I2C port map */
const struct i2c_port_t i2c_ports[] = {
- {"power", I2C_PORT_POWER, 100,
- GPIO_EC_I2C0_POWER_SCL, GPIO_EC_I2C0_POWER_SDA},
- {"tcpc0", I2C_PORT_TCPC0, 1000,
- GPIO_EC_I2C1_USB_C0_SCL, GPIO_EC_I2C1_USB_C0_SDA},
- {"tcpc1", I2C_PORT_TCPC1, 1000,
- GPIO_EC_I2C2_USB_C1_SCL, GPIO_EC_I2C2_USB_C1_SDA},
- {"sensor", I2C_PORT_SENSOR, 100,
- GPIO_EC_I2C3_SENSOR_3V3_SCL, GPIO_EC_I2C3_SENSOR_3V3_SDA},
- {"battery", I2C_PORT_BATTERY, 100,
- GPIO_EC_I2C4_BATTERY_SCL, GPIO_EC_I2C4_BATTERY_SDA},
+ {
+ .name = "power",
+ .port = I2C_PORT_POWER,
+ .kbps = 100,
+ .scl = GPIO_EC_I2C0_POWER_SCL,
+ .sda = GPIO_EC_I2C0_POWER_SDA
+ },
+ {
+ .name = "tcpc0",
+ .port = I2C_PORT_TCPC0,
+ .kbps = 1000,
+ .scl = GPIO_EC_I2C1_USB_C0_SCL,
+ .sda = GPIO_EC_I2C1_USB_C0_SDA
+ },
+ {
+ .name = "tcpc1",
+ .port = I2C_PORT_TCPC1,
+ .kbps = 1000,
+ .scl = GPIO_EC_I2C2_USB_C1_SCL,
+ .sda = GPIO_EC_I2C2_USB_C1_SDA
+ },
+ {
+ .name = "sensor",
+ .port = I2C_PORT_SENSOR,
+ .kbps = 100,
+ .scl = GPIO_EC_I2C3_SENSOR_3V3_SCL,
+ .sda = GPIO_EC_I2C3_SENSOR_3V3_SDA
+ },
+ {
+ .name = "battery",
+ .port = I2C_PORT_BATTERY,
+ .kbps = 100,
+ .scl = GPIO_EC_I2C4_BATTERY_SCL,
+ .sda = GPIO_EC_I2C4_BATTERY_SDA
+ },
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);