summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@google.com>2015-11-17 10:03:12 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-17 22:06:57 -0800
commit7f1baece0a5be8e7860cfe09bd94b39ffb3ba93c (patch)
tree2ab645dc23696c0fbb69a11708ce6618c3966051
parentedae3db119fae83a151400ae2142ad6805c71ad3 (diff)
downloadchrome-ec-7f1baece0a5be8e7860cfe09bd94b39ffb3ba93c.tar.gz
fusb302: Move i2c slave address defines to common header
BUG=None TEST=`make buildall -j` BRANCH=None Change-Id: I51000b3ad32ebef8d19a685b8adbbbe2a42301f5 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/312797 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r--board/snoball/board.c3
-rw-r--r--driver/tcpm/fusb302.h10
2 files changed, 11 insertions, 2 deletions
diff --git a/board/snoball/board.c b/board/snoball/board.c
index 33677d1ca1..a081bab8c3 100644
--- a/board/snoball/board.c
+++ b/board/snoball/board.c
@@ -9,6 +9,7 @@
#include "adc_chip.h"
#include "common.h"
#include "console.h"
+#include "fusb302.h"
#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
@@ -33,8 +34,6 @@ const struct i2c_port_t i2c_ports[] = {
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
-#define FUSB302_I2C_SLAVE_ADDR 0x44
-
const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
{STM32_I2C1_PORT, FUSB302_I2C_SLAVE_ADDR},
{STM32_I2C2_PORT, FUSB302_I2C_SLAVE_ADDR},
diff --git a/driver/tcpm/fusb302.h b/driver/tcpm/fusb302.h
index 45fa0f3362..1da1a6a0bf 100644
--- a/driver/tcpm/fusb302.h
+++ b/driver/tcpm/fusb302.h
@@ -10,6 +10,16 @@
#ifndef __CROS_EC_DRIVER_TCPM_FUSB302_H
#define __CROS_EC_DRIVER_TCPM_FUSB302_H
+/* I2C slave address varies by part number */
+/* FUSB302BUCX / FUSB302BMPX */
+#define FUSB302_I2C_SLAVE_ADDR 0x44
+/* FUSB302B01MPX */
+#define FUSB302_I2C_SLAVE_ADDR_B01 0x46
+/* FUSB302B10MPX */
+#define FUSB302_I2C_SLAVE_ADDR_B10 0x48
+/* FUSB302B11MPX */
+#define FUSB302_I2C_SLAVE_ADDR_B11 0x4A
+
/* Default retry count for transmitting */
#define PD_RETRY_COUNT 3