diff options
-rw-r--r-- | common/usb_port_power_dumb.c | 4 | ||||
-rw-r--r-- | include/config.h | 6 | ||||
-rw-r--r-- | zephyr/Kconfig.usbc | 8 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
4 files changed, 22 insertions, 1 deletions
diff --git a/common/usb_port_power_dumb.c b/common/usb_port_power_dumb.c index be60f6727f..09c7e29033 100644 --- a/common/usb_port_power_dumb.c +++ b/common/usb_port_power_dumb.c @@ -26,7 +26,7 @@ static void usb_port_set_enabled(int port_id, int en) charge_mode[port_id] = en; } -static void usb_port_all_ports_on(void) +__maybe_unused static void usb_port_all_ports_on(void) { int i; for (i = 0; i < USB_PORT_COUNT; i++) @@ -143,6 +143,7 @@ static void usb_port_init(void) } DECLARE_HOOK(HOOK_INIT, usb_port_init, HOOK_PRIO_DEFAULT); +#ifndef CONFIG_USB_PORT_POWER_DUMB_CUSTOM_HOOK static void usb_port_startup(void) { /* Turn on USB ports on as we go into S0 from S5. */ @@ -156,3 +157,4 @@ static void usb_port_shutdown(void) usb_port_all_ports_off(); } DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, usb_port_shutdown, HOOK_PRIO_DEFAULT); +#endif /* CONFIG_USB_PORT_POWER_DUMB_CUSTOM_HOOK */ diff --git a/include/config.h b/include/config.h index 3f25fca6f3..9a04773412 100644 --- a/include/config.h +++ b/include/config.h @@ -4835,6 +4835,12 @@ #undef CONFIG_USB_PORT_POWER_DUMB /* + * Let board customize the timing to enable/disable usb port, instead + * of using the default S3 hook. + */ +#undef CONFIG_USB_PORT_POWER_DUMB_CUSTOM_HOOK + +/* * Support smart power control to the device's USB ports, using * dedicated power control chips. This potentially enables automatic * negotiation of supplying more power to peripherals. diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index 1aeb113eb3..60aaec31d6 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -23,6 +23,14 @@ config PLATFORM_EC_USB_PORT_POWER_DUMB implements the EC_CMD_USB_CHARGE_SET_MODE host command and provides a 'usbchargemode' console command. +config PLATFORM_EC_USB_PORT_POWER_DUMB_CUSTOM_HOOK + bool "Simple control of power to USB-A ports" + depends on PLATFORM_EC_USB_PORT_POWER_DUMB + default n + help + Enable this if your board does not want to use the default S3 hooks + from USB_PORT_POWER_DUMB. + menuconfig PLATFORM_EC_USBC bool "USB Type-C" default y if PLATFORM_EC_BATTERY diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 9ef652b6b1..ca93ba1b4a 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -713,6 +713,11 @@ #define CONFIG_USB_PORT_POWER_DUMB #endif +#undef CONFIG_USB_PORT_POWER_DUMB_CUSTOM_HOOK +#ifdef CONFIG_PLATFORM_EC_USB_PORT_POWER_DUMB_CUSTOM_HOOK +#define CONFIG_USB_PORT_POWER_DUMB_CUSTOM_HOOK +#endif + #undef CONFIG_BC12_DETECT_PI3USB9201 #ifdef CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201 #define CONFIG_BC12_DETECT_PI3USB9201 |