From c119910eee4efaaaa395a76cbf0ef653d16bd760 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 14 Jan 2021 14:09:05 -0700 Subject: zephyr: Allow enabling USB-A charging Add options to enable (slow) charging through any USB-A ports present on the device. This can be useful if the USB-C ports are in use, or when a USB-C cable is not available. BUG=b:175434113 BRANCH=none TEST=make BOARD=volteer -j30 With a zephyr-chrome CL, build volteer on zephyr Signed-off-by: Simon Glass Change-Id: Idc17c98c305201c63dddb6c6c0abef0f640c5f59 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2631094 Reviewed-by: Jack Rosenthal Reviewed-by: Keith Short --- zephyr/Kconfig.usbc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'zephyr/Kconfig.usbc') diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index 3c3e6d206c..fae6b0f92b 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -2,6 +2,27 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +# TODO(sjg): Not USB-C: perhaps we should have a 'power' thing at the top level? +config PLATFORM_EC_USB_A_PORT_COUNT + int "Number of USB-A ports" + default 0 + help + This sets the number of USB-A ports on the device. These ports do + not support USB Power Delivery features but can be used to power + external devices (according to the USB 3 spec, not the Battery Charger + standard) and to charge devices slowly if power is enabled to them. + +config PLATFORM_EC_USB_PORT_POWER_DUMB + bool "Simple control of power to USB-A ports" + depends on PLATFORM_EC_USB_A_PORT_COUNT > 0 + default y + help + Enable this to provide simple control of the power to USB ports + using GPIOs. To use this your board code must provide a + usb_port_enable[] array with the GPIOs to use for each port. This + implements the EC_CMD_USB_CHARGE_SET_MODE host command and provides + a 'usbchargemode' console command. + menuconfig PLATFORM_EC_USBC bool "USB Type-C" default y if PLATFORM_EC_BATTERY -- cgit v1.2.1