summaryrefslogtreecommitdiff
path: root/board/bds
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-05-17 12:19:11 -0700
committerRandall Spangler <rspangler@chromium.org>2012-05-17 12:22:39 -0700
commit39149579a47f274b0a4326a8828f35bfc2a59837 (patch)
tree43863041d75c804e7fd4970879abc7c71cf2bc9d /board/bds
parent103e055ddac9b3810d74be1336e61ecbebb4fd6d (diff)
downloadchrome-ec-39149579a47f274b0a4326a8828f35bfc2a59837.tar.gz
Add a list of I2C ports
This cleans up I2C init and debug commands across boards. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=on link and bds: i2cscan lightbar run powerbtn (to power on system) temps (to read i2c temp sensors) battery (to read battery) charger (to read charger) Change-Id: If3fb0cdb8d3178592bf68cbb2e72bc4b7f71dec5
Diffstat (limited to 'board/bds')
-rw-r--r--board/bds/board.c14
-rw-r--r--board/bds/board.h10
2 files changed, 12 insertions, 12 deletions
diff --git a/board/bds/board.c b/board/bds/board.c
index b9c6ee564d..50c4a079e9 100644
--- a/board/bds/board.c
+++ b/board/bds/board.c
@@ -4,16 +4,16 @@
*/
/* Stellaris EKB-LM4F-EAC board-specific configuration */
+#include "adc.h"
#include "board.h"
#include "gpio.h"
+#include "i2c.h"
+#include "lm4_adc.h"
#include "registers.h"
#include "util.h"
-#include "lm4_adc.h"
-#include "adc.h"
/* ADC channels. Must be in the exactly same order as in enum adc_channel. */
-const struct adc_t adc_channels[ADC_CH_COUNT] =
-{
+const struct adc_t adc_channels[ADC_CH_COUNT] = {
/* EC internal temperature is calculated by
* 273 + (295 - 450 * ADC_VALUE / ADC_READ_MAX) / 2
* = -225 * ADC_VALUE / ADC_READ_MAX + 420.5
@@ -32,6 +32,12 @@ const struct adc_t adc_channels[ADC_CH_COUNT] =
};
+/* I2C ports */
+const struct i2c_port_t i2c_ports[I2C_PORTS_USED] = {
+ {"lightbar", I2C_PORT_LIGHTBAR, 400},
+};
+
+
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[GPIO_COUNT] = {
{"RECOVERYn", LM4_GPIO_D, (1<<1), GPIO_PULL_UP, NULL},
diff --git a/board/bds/board.h b/board/bds/board.h
index b570dfdeb3..dd4d887ad0 100644
--- a/board/bds/board.h
+++ b/board/bds/board.h
@@ -16,15 +16,9 @@ enum adc_channel
};
/* I2C ports */
-#define I2C_PORT_BATTERY 5 // port 0 / PB2:3 on Link, open on badger
-#define I2C_PORT_CHARGER 5 // port 1 / PA6:7 on Link, user LED on badger
-#define I2C_PORT_THERMAL 5 // port 5 / PB6:7 on link, but PG6:7 on badger
#define I2C_PORT_LIGHTBAR 5 // port 5 / PA6:7 on link, but PG6:7 on badger
-/* I2C port speeds in kbps. All the same because they all share a port */
-#define I2C_SPEED_BATTERY 400
-#define I2C_SPEED_CHARGER 400
-#define I2C_SPEED_LIGHTBAR 400
-#define I2C_SPEED_THERMAL 400
+/* Number of I2C ports used */
+#define I2C_PORTS_USED 1
/* GPIO signal list */
enum gpio_signal {