summaryrefslogtreecommitdiff
path: root/board/reef
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:36 +0000
commitcdc4811ebe80e0e7a0edeb093dc74b9d947290bb (patch)
tree09eba2a9ed32f68d83f22052863e69cbf676f6bb /board/reef
parentd4832f0d001fa567e633b9c37af2b78a38592403 (diff)
downloadchrome-ec-cdc4811ebe80e0e7a0edeb093dc74b9d947290bb.tar.gz
i2c: Use declared initializers for i2c_ports: reef 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: Iff4681dc3c750fe7acc0601983dde2fbbc06de38 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300187 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'board/reef')
-rw-r--r--board/reef/board.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/board/reef/board.c b/board/reef/board.c
index ed8e83d0a8..92ff6a7764 100644
--- a/board/reef/board.c
+++ b/board/reef/board.c
@@ -147,16 +147,41 @@ const struct pwm_t pwm_channels[] = {
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
const struct i2c_port_t i2c_ports[] = {
- {"tcpc0", NPCX_I2C_PORT0_0, 400,
- GPIO_EC_I2C_USB_C0_PD_SCL, GPIO_EC_I2C_USB_C0_PD_SDA},
- {"tcpc1", NPCX_I2C_PORT0_1, 400,
- GPIO_EC_I2C_USB_C1_PD_SCL, GPIO_EC_I2C_USB_C1_PD_SDA},
- {"accelgyro", I2C_PORT_GYRO, 400,
- GPIO_EC_I2C_GYRO_SCL, GPIO_EC_I2C_GYRO_SDA},
- {"sensors", NPCX_I2C_PORT2, 400,
- GPIO_EC_I2C_SENSOR_SCL, GPIO_EC_I2C_SENSOR_SDA},
- {"batt", NPCX_I2C_PORT3, 100,
- GPIO_EC_I2C_POWER_SCL, GPIO_EC_I2C_POWER_SDA},
+ {
+ .name = "tcpc0",
+ .port = NPCX_I2C_PORT0_0,
+ .kbps = 400,
+ .scl = GPIO_EC_I2C_USB_C0_PD_SCL,
+ .sda = GPIO_EC_I2C_USB_C0_PD_SDA
+ },
+ {
+ .name = "tcpc1",
+ .port = NPCX_I2C_PORT0_1,
+ .kbps = 400,
+ .scl = GPIO_EC_I2C_USB_C1_PD_SCL,
+ .sda = GPIO_EC_I2C_USB_C1_PD_SDA
+ },
+ {
+ .name = "accelgyro",
+ .port = I2C_PORT_GYRO,
+ .kbps = 400,
+ .scl = GPIO_EC_I2C_GYRO_SCL,
+ .sda = GPIO_EC_I2C_GYRO_SDA
+ },
+ {
+ .name = "sensors",
+ .port = NPCX_I2C_PORT2,
+ .kbps = 400,
+ .scl = GPIO_EC_I2C_SENSOR_SCL,
+ .sda = GPIO_EC_I2C_SENSOR_SDA
+ },
+ {
+ .name = "batt",
+ .port = NPCX_I2C_PORT3,
+ .kbps = 100,
+ .scl = GPIO_EC_I2C_POWER_SCL,
+ .sda = GPIO_EC_I2C_POWER_SDA
+ },
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);