summaryrefslogtreecommitdiff
path: root/common/usb_port_power_smart.c
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 /common/usb_port_power_smart.c
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>
Diffstat (limited to 'common/usb_port_power_smart.c')
-rw-r--r--common/usb_port_power_smart.c12
1 files changed, 6 insertions, 6 deletions
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)