diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-11-08 10:10:23 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-11-11 23:47:05 +0000 |
commit | 33f29160a0caa776a5e6e341b30d915119f84f51 (patch) | |
tree | e512362fc4d59639e8fca9991dd82ec57aab6ac5 | |
parent | eb70d3cda72b3c1bb00fe24d4386288c2d4b114d (diff) | |
download | chrome-ec-33f29160a0caa776a5e6e341b30d915119f84f51.tar.gz |
Specify I2C channels physically, not arbitrarilytest-4824.B
In board.c, we initialize this struct:
struct i2c_port_t {
const char *name; /* Port name */
int port; /* Port */
int kbps; /* Speed in kbps */
};
extern const struct i2c_port_t i2c_ports[];
The port field refers to the physical I2C bus on the EC.
Meanwhile, in board.h, we've identified the bus where each I2C device is
attached:
Up until this CL, we've been picking one of those device-to-bus macros to
initialize port fields of the i2c_ports[] array. That's wrong and confusing.
This change specifies the physical channel with the physical number.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=manual
Renaming only. There should be no change in observed behavior.
Change-Id: I5427c26290572133f060b6cf0d9ebea5015adba1
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176176
Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
-rw-r--r-- | board/bds/board.c | 2 | ||||
-rw-r--r-- | board/bolt/board.c | 8 | ||||
-rw-r--r-- | board/falco/board.c | 8 | ||||
-rw-r--r-- | board/link/board.c | 8 | ||||
-rw-r--r-- | board/peppy/board.c | 6 | ||||
-rw-r--r-- | board/rambi/board.c | 6 | ||||
-rw-r--r-- | board/samus/board.c | 8 | ||||
-rw-r--r-- | board/slippy/board.c | 6 |
8 files changed, 19 insertions, 33 deletions
diff --git a/board/bds/board.c b/board/bds/board.c index e23b17c33a..90ac5eb946 100644 --- a/board/bds/board.c +++ b/board/bds/board.c @@ -34,7 +34,7 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - {"lightbar", I2C_PORT_LIGHTBAR, 400}, + {"lightbar", 5, 400}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/board/bolt/board.c b/board/bolt/board.c index 0bf1271253..3ed0443d18 100644 --- a/board/bolt/board.c +++ b/board/bolt/board.c @@ -203,11 +203,9 @@ BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - /* Note: battery and charger share a port. Only include it once in - * this list so we don't double-initialize it. */ - {"batt_chg", I2C_PORT_BATTERY, 100}, - {"lightbar", I2C_PORT_LIGHTBAR, 400}, - {"thermal", I2C_PORT_THERMAL, 100}, + {"batt_chg", 0, 100}, + {"lightbar", 1, 400}, + {"thermal", 5, 100}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/board/falco/board.c b/board/falco/board.c index 5d90ef3aa6..3b50447802 100644 --- a/board/falco/board.c +++ b/board/falco/board.c @@ -202,11 +202,9 @@ BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - /* Note: battery and charger share a port. Only include it once in - * this list so we don't double-initialize it. */ - {"batt_chg", I2C_PORT_BATTERY, 100}, - {"lvds", I2C_PORT_LVDS, 100}, - {"thermal", I2C_PORT_THERMAL, 100}, + {"batt_chg", 0, 100}, + {"lvds", 1, 100}, + {"thermal", 5, 100}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/board/link/board.c b/board/link/board.c index 0012a7bf7e..60b654c2b0 100644 --- a/board/link/board.c +++ b/board/link/board.c @@ -202,11 +202,9 @@ BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - /* Note: battery and charger share a port. Only include it once in - * this list so we don't double-initialize it. */ - {"batt_chg", I2C_PORT_BATTERY, 100}, - {"lightbar", I2C_PORT_LIGHTBAR, 400}, - {"thermal", I2C_PORT_THERMAL, 100}, + {"batt_chg", 0, 100}, + {"lightbar", 1, 400}, + {"thermal", 5, 100}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/board/peppy/board.c b/board/peppy/board.c index e6205e521b..11f4e44f5d 100644 --- a/board/peppy/board.c +++ b/board/peppy/board.c @@ -196,10 +196,8 @@ BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - /* Note: battery and charger share a port. Only include it once in - * this list so we don't double-initialize it. */ - {"batt_chg", I2C_PORT_BATTERY, 100}, - {"thermal", I2C_PORT_THERMAL, 100}, + {"batt_chg", 0, 100}, + {"thermal", 5, 100}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/board/rambi/board.c b/board/rambi/board.c index d20229ec5c..b1856b0d3a 100644 --- a/board/rambi/board.c +++ b/board/rambi/board.c @@ -173,10 +173,8 @@ BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - /* Note: battery and charger share a port. Only include it once in - * this list so we don't double-initialize it. */ - {"batt_chg", I2C_PORT_BATTERY, 100}, - {"thermal", I2C_PORT_THERMAL, 100}, + {"batt_chg", 0, 100}, + {"thermal", 5, 100}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/board/samus/board.c b/board/samus/board.c index d7f5b58e5f..74cc3bda07 100644 --- a/board/samus/board.c +++ b/board/samus/board.c @@ -219,11 +219,9 @@ BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - /* Note: battery and charger share a port. Only include it once in - * this list so we don't double-initialize it. */ - {"batt_chg", I2C_PORT_BATTERY, 100}, - {"lightbar", I2C_PORT_LIGHTBAR, 400}, - {"thermal", I2C_PORT_THERMAL, 100}, + {"batt_chg", 0, 100}, + {"lightbar", 1, 400}, + {"thermal", 5, 100}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/board/slippy/board.c b/board/slippy/board.c index 25ecb016aa..9a1fc697ed 100644 --- a/board/slippy/board.c +++ b/board/slippy/board.c @@ -194,10 +194,8 @@ BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - /* Note: battery and charger share a port. Only include it once in - * this list so we don't double-initialize it. */ - {"batt_chg", I2C_PORT_BATTERY, 100}, - {"thermal", I2C_PORT_THERMAL, 100}, + {"batt_chg", 0, 100}, + {"thermal", 5, 100}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); |