summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-11-19 15:42:27 -0700
committerCommit Bot <commit-bot@chromium.org>2021-11-30 23:56:13 +0000
commiteebfdd14859dbeaa464c9bdcfa6b6c67a5289353 (patch)
tree42aabe3a784dad83113b9117f047b091dafeff5c
parent262172c84b5d4a1688a9df806b3ec42ab40fb4a9 (diff)
downloadchrome-ec-eebfdd14859dbeaa464c9bdcfa6b6c67a5289353.tar.gz
i2c: Use declared initializers for bitbang ports
Convert all instances of i2c_bitbang_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: If7d578dc2bc5ef1f7c5dc424ceb3193cd98f7a69 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300663 Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--board/burnet/board.c9
-rw-r--r--board/damu/board.c9
-rw-r--r--board/fennel/board.c9
-rw-r--r--board/jacuzzi/board.c9
-rw-r--r--board/kappa/board.c9
-rw-r--r--board/kodama/board.c9
-rw-r--r--board/makomo/board.c9
-rw-r--r--board/munna/board.c9
-rw-r--r--board/stern/board.c9
-rw-r--r--board/willow/board.c9
-rw-r--r--test/i2c_bitbang.c8
11 files changed, 87 insertions, 11 deletions
diff --git a/board/burnet/board.c b/board/burnet/board.c
index 24438342d5..fbb531fef1 100644
--- a/board/burnet/board.c
+++ b/board/burnet/board.c
@@ -87,7 +87,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 2,
+ .kbps = 100,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/board/damu/board.c b/board/damu/board.c
index 075894f954..b5867377a5 100644
--- a/board/damu/board.c
+++ b/board/damu/board.c
@@ -85,7 +85,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 2,
+ .kbps = 100,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/board/fennel/board.c b/board/fennel/board.c
index 71d4e066b2..60024e7a9f 100644
--- a/board/fennel/board.c
+++ b/board/fennel/board.c
@@ -86,7 +86,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 2,
+ .kbps = 100,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c
index e3afa51a1d..f31f712386 100644
--- a/board/jacuzzi/board.c
+++ b/board/jacuzzi/board.c
@@ -95,7 +95,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 2,
+ .kbps = 100,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/board/kappa/board.c b/board/kappa/board.c
index 80f4a2522a..f3c17f32c3 100644
--- a/board/kappa/board.c
+++ b/board/kappa/board.c
@@ -83,7 +83,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 2,
+ .kbps = 100,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/board/kodama/board.c b/board/kodama/board.c
index 230f0eb880..5ecfc794f5 100644
--- a/board/kodama/board.c
+++ b/board/kodama/board.c
@@ -81,7 +81,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 2,
+ .kbps = 100,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/board/makomo/board.c b/board/makomo/board.c
index d248a2a667..8f9dbdc12c 100644
--- a/board/makomo/board.c
+++ b/board/makomo/board.c
@@ -84,7 +84,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 2,
+ .kbps = 100,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/board/munna/board.c b/board/munna/board.c
index 0bd90d0747..4e8f19eb8b 100644
--- a/board/munna/board.c
+++ b/board/munna/board.c
@@ -85,7 +85,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 3, 100, GPIO_I2C4_SCL, GPIO_I2C4_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 3,
+ .kbps = 100,
+ .scl = GPIO_I2C4_SCL,
+ .sda = GPIO_I2C4_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/board/stern/board.c b/board/stern/board.c
index 979fd3da3f..d6006eecc0 100644
--- a/board/stern/board.c
+++ b/board/stern/board.c
@@ -85,7 +85,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 2,
+ .kbps = 100,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/board/willow/board.c b/board/willow/board.c
index 169173c143..c5de7d2d95 100644
--- a/board/willow/board.c
+++ b/board/willow/board.c
@@ -82,7 +82,14 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"battery", 2, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA, .drv = &bitbang_drv},
+ {
+ .name = "battery",
+ .port = 2,
+ .kbps = 100,
+ .scl = GPIO_I2C3_SCL,
+ .sda = GPIO_I2C3_SDA,
+ .drv = &bitbang_drv
+ },
};
const unsigned int i2c_bitbang_ports_used = ARRAY_SIZE(i2c_bitbang_ports);
diff --git a/test/i2c_bitbang.c b/test/i2c_bitbang.c
index ab1136a922..dd84c0b83a 100644
--- a/test/i2c_bitbang.c
+++ b/test/i2c_bitbang.c
@@ -11,7 +11,13 @@
#include "util.h"
const struct i2c_port_t i2c_bitbang_ports[] = {
- {"", 0, 100, GPIO_I2C_SCL, GPIO_I2C_SDA}
+ {
+ .name = "",
+ .port = 0,
+ .kbps = 100,
+ .scl = GPIO_I2C_SCL,
+ .sda = GPIO_I2C_SDA
+ }
};
const unsigned int i2c_bitbang_ports_used = 1;