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
This commit is contained in:
Bill Richardson
2013-10-04 11:28:48 -07:00
committed by chrome-internal-fetch
parent 616cc446e2
commit 57aaa0267e
32 changed files with 26 additions and 47 deletions

View File

@@ -21,6 +21,7 @@ struct i2c_port_t {
};
extern const struct i2c_port_t i2c_ports[];
extern const unsigned int i2c_ports_used;
/* Flags for i2c_xfer() */
#define I2C_XFER_START (1 << 0) /* Start smbus session from idle state */