From ef0c2265d73004860a7b18ae5e0f9cb1accfb869 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Thu, 6 Jun 2019 15:35:11 -0600 Subject: soc/intel/common/block/xhci: Add API to disable USB devices Add API to disable USB devices that are not present but are configured in the device tree either after probing the concerned port status or as explicitly configured by the variants. BUG=None BRANCH=octopus TEST=Boot to ChromeOS. Change-Id: Ied12faabee1b8c096f2b27de89ab42ee8be5d94d Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://review.coreboot.org/c/coreboot/+/33377 Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/include/intelblocks/xhci.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/soc/intel/common/block/include/intelblocks') diff --git a/src/soc/intel/common/block/include/intelblocks/xhci.h b/src/soc/intel/common/block/include/intelblocks/xhci.h index 492c32a002..dd95bfb024 100644 --- a/src/soc/intel/common/block/include/intelblocks/xhci.h +++ b/src/soc/intel/common/block/include/intelblocks/xhci.h @@ -56,4 +56,21 @@ void soc_xhci_init(struct device *dev); */ const struct xhci_usb_info *soc_get_xhci_usb_info(void); +/** + * usb_xhci_disable_unused() - Disable unused USB devices + * @ext_usb_xhci_en_cb: Callback function to be invoked, supplied by mainboard, + * to identify the status of externally visible USB ports. + * (Return true if port is present, false if port is absent) + * + * This function is used to disable unused USB devices/ports that are configured + * in the device tree. For the internal USB ports, the connect status of the port + * is probed from the XHCI controller block and the port is disabled if it is not + * connected. For the external USB ports, the mainboard provides the connect status + * of the concerned port depending on the variants and their SKUs. If the mainboard + * supplied callback function is NULL, then all the externally visible USB devices + * in the device tree are enabled. + */ +void usb_xhci_disable_unused(bool (*ext_usb_xhci_en_cb)(unsigned int port_type, + unsigned int port_id)); + #endif /* SOC_INTEL_COMMON_BLOCK_XHCI_H */ -- cgit v1.2.3