From 89afb1f3d46ec9060807542cea9e130a0e7302dd Mon Sep 17 00:00:00 2001 From: Edward Hill Date: Tue, 17 Mar 2020 20:26:14 -0600 Subject: usb_port_power: move usb_port_enable[] to header BUG=b:150349225 BRANCH=none TEST=none Signed-off-by: Edward Hill Change-Id: I0342239dacf3bfb5f50e5fe873805921fa4723a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108332 Reviewed-by: Denis Brockus Reviewed-by: Paul Ma Tested-by: Paul Ma Commit-Queue: Denis Brockus --- common/acpi.c | 4 ---- common/usb_port_power_dumb.c | 4 ---- common/usb_port_power_smart.c | 6 ------ include/usb_charge.h | 10 ++++++++++ 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/common/acpi.c b/common/acpi.c index 87e9c4fd27..3413a44e81 100644 --- a/common/acpi.c +++ b/common/acpi.c @@ -50,10 +50,6 @@ static int current_dptf_profile = DPTF_PROFILE_DEFAULT; #endif -#ifdef CONFIG_USB_PORT_POWER_DUMB -extern const int usb_port_enable[USB_PORT_COUNT]; -#endif - /* * Keep a read cache of four bytes when burst mode is enabled, which is the * size of the largest non-string memmap data type. diff --git a/common/usb_port_power_dumb.c b/common/usb_port_power_dumb.c index 5cdf6005a6..4275f2d90e 100644 --- a/common/usb_port_power_dumb.c +++ b/common/usb_port_power_dumb.c @@ -18,11 +18,7 @@ #define CPUTS(outstr) cputs(CC_USBCHARGE, outstr) #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) -#define USB_SYSJUMP_TAG 0x5550 /* "UP" - Usb Port */ -#define USB_HOOK_VERSION 1 - static uint8_t charge_mode[USB_PORT_COUNT]; -extern const int usb_port_enable[USB_PORT_COUNT]; static void usb_port_set_enabled(int port_id, int en) { diff --git a/common/usb_port_power_smart.c b/common/usb_port_power_smart.c index 59474ff7fe..170180cbab 100644 --- a/common/usb_port_power_smart.c +++ b/common/usb_port_power_smart.c @@ -18,9 +18,6 @@ #define CPUTS(outstr) cputs(CC_USBCHARGE, outstr) #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) -#define USB_SYSJUMP_TAG 0x5550 /* "UP" - Usb Port */ -#define USB_HOOK_VERSION 1 - #ifndef CONFIG_USB_PORT_POWER_SMART_DEFAULT_MODE #define CONFIG_USB_PORT_POWER_SMART_DEFAULT_MODE USB_CHARGE_MODE_SDP2 #endif @@ -32,9 +29,6 @@ struct charge_mode_t { static struct charge_mode_t charge_mode[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT]; -/* GPIOs to enable/disable USB ports. Board specific. */ -extern const int usb_port_enable[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT]; - #ifdef CONFIG_USB_PORT_POWER_SMART_CDP_SDP_ONLY /* * If we only support CDP and SDP, the control signals are hard-wired so diff --git a/include/usb_charge.h b/include/usb_charge.h index 867a6e4ba6..7445e7b0ab 100644 --- a/include/usb_charge.h +++ b/include/usb_charge.h @@ -16,6 +16,16 @@ /* USB charger minimum current */ #define USB_CHARGER_MIN_CURR_MA 500 +#define USB_SYSJUMP_TAG 0x5550 /* "UP" - Usb Port */ +#define USB_HOOK_VERSION 1 + +/* GPIOs to enable/disable USB ports. Board specific. */ +#ifdef CONFIG_USB_PORT_POWER_SMART +extern const int usb_port_enable[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT]; +#elif defined(CONFIG_USB_PORT_POWER_DUMB) +extern const int usb_port_enable[USB_PORT_COUNT]; +#endif + /** * Set USB charge mode for the port. * -- cgit v1.2.1