diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-10-04 11:28:48 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-07 16:20:59 +0000 |
commit | 57aaa0267ec042d8b36aacf5b3efba12df4e6ec2 (patch) | |
tree | fea9614f2048f9866b1f6333a534c15cab4056e0 /board/falco | |
parent | 616cc446e2cc8acb5506592ba1f965d4c06f9b2b (diff) | |
download | chrome-ec-57aaa0267ec042d8b36aacf5b3efba12df4e6ec2.tar.gz |
cleanup: Replace awkward I2C_PORTS_USED macro with constant
We only used I2C_PORTS_USED to iterate through the list of hardware ports
actually in use, but we defined it in board.h at the same place where we
matched particular I2C devices to the (possibly shared) buses they're on.
This CL makes I2C_PORTS_USED into a global constant, so it can be set
automatically where we initialize the ports, and doesn't have to be
related to the list of attached devices.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=manual
Build everything, run all tests, should still work.
Change-Id: I65f22f5cadfc4b3afe51af48faa5fb369bc3aa09
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171884
Diffstat (limited to 'board/falco')
-rw-r--r-- | board/falco/board.c | 2 | ||||
-rw-r--r-- | board/falco/board.h | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/board/falco/board.c b/board/falco/board.c index 71fd2acfa7..adc6cbddfb 100644 --- a/board/falco/board.c +++ b/board/falco/board.c @@ -198,7 +198,7 @@ const struct i2c_port_t i2c_ports[] = { {"lvds", I2C_PORT_LVDS, 100}, {"thermal", I2C_PORT_THERMAL, 100}, }; -BUILD_ASSERT(ARRAY_SIZE(i2c_ports) == I2C_PORTS_USED); +const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); /* Temperature sensors data; must be in same order as enum temp_sensor_id. */ const struct temp_sensor_t temp_sensors[] = { diff --git a/board/falco/board.h b/board/falco/board.h index 8575f50349..79d245dc43 100644 --- a/board/falco/board.h +++ b/board/falco/board.h @@ -55,8 +55,6 @@ enum module_id { #define I2C_PORT_CHARGER 0 #define I2C_PORT_LVDS 1 #define I2C_PORT_THERMAL 5 -/* Battery and charger share a port. Don't count it twice. */ -#define I2C_PORTS_USED 3 /* 13x8 keyboard scanner uses an entire GPIO bank for row inputs */ #define KB_SCAN_ROW_IRQ LM4_IRQ_GPIOK |