summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-01-06 15:02:10 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-01-07 02:52:59 +0000
commit07fa71e7cce83229facab9de31fbb28868bec154 (patch)
tree48cc8c745d32f2a28c3a5ba6650f24b256af97c2
parent9ccbedda19de14fbba47d5e4e97579f5b8573184 (diff)
downloadchrome-ec-07fa71e7cce83229facab9de31fbb28868bec154.tar.gz
rambi: Add config option for simplified USB power control
It will be used by all variants of Rambi, so #ifdef BOARD_RAMBI is too restrictive. BUG=chrome-os-partner:24864 BRANCH=rambi TEST=boot rambi 1.5 board; plug in USB mouse Change-Id: I0ff02077388a6c6621c5746a693dde894cf8ad77 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/181682 Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r--board/rambi/board.h1
-rw-r--r--common/usb_port_power_smart.c12
-rw-r--r--include/config.h6
3 files changed, 13 insertions, 6 deletions
diff --git a/board/rambi/board.h b/board/rambi/board.h
index e0bdc0b65a..73c9a503fb 100644
--- a/board/rambi/board.h
+++ b/board/rambi/board.h
@@ -35,6 +35,7 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_TMP432
#define CONFIG_USB_PORT_POWER_SMART
+#define CONFIG_USB_PORT_POWER_SMART_SIMPLE
#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
diff --git a/common/usb_port_power_smart.c b/common/usb_port_power_smart.c
index be4cf138a2..9a47d78326 100644
--- a/common/usb_port_power_smart.c
+++ b/common/usb_port_power_smart.c
@@ -32,11 +32,11 @@ static uint8_t charge_mode[USB_CHARGE_PORT_COUNT];
static void usb_charge_set_control_mode(int port_id, int mode)
{
-#ifdef BOARD_RAMBI
+#ifdef CONFIG_USB_PORT_POWER_SMART_SIMPLE
/*
- * Rambi has only a single shared control signal, so the last mode set
- * to either port wins. Also, only CTL1 can be set; the other pins
- * are hard-wired.
+ * One single shared control signal, so the last mode set to either
+ * port wins. Also, only CTL1 can be set; the other pins are
+ * hard-wired.
*/
gpio_set_level(GPIO_USB_CTL1, mode & 0x4);
#else
@@ -62,8 +62,8 @@ static void usb_charge_set_enabled(int port_id, int en)
static void usb_charge_set_ilim(int port_id, int sel)
{
-#ifdef BOARD_RAMBI
- /* Rambi has a shared ILIM_SEL signal too */
+#ifdef CONFIG_USB_PORT_POWER_SMART_SIMPLE
+ /* ILIM_SEL signal is shared too */
gpio_set_level(GPIO_USB_ILIM_SEL, sel);
#else
if (port_id == 0)
diff --git a/include/config.h b/include/config.h
index d4447ca6c9..4d4c908e01 100644
--- a/include/config.h
+++ b/include/config.h
@@ -734,6 +734,12 @@
*/
#undef CONFIG_USB_PORT_POWER_SMART
+/*
+ * Smart USB power control can use a full set of control signals to the USB
+ * port power chip, or a reduced set. If this is defined, use the reduced set.
+ */
+#undef CONFIG_USB_PORT_POWER_SMART_SIMPLE
+
/* Support the TSU6721 I2C smart switch */
#undef CONFIG_USB_SWITCH_TSU6721