diff options
-rw-r--r-- | board/rambi/board.h | 1 | ||||
-rw-r--r-- | common/usb_port_power_smart.c | 12 | ||||
-rw-r--r-- | include/config.h | 6 |
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 |