summaryrefslogtreecommitdiff
path: root/baseboard/hatch
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-12-18 16:11:09 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-30 13:06:35 -0800
commit01f8d598f8bbd5f9d7400d17284e3dbac270d491 (patch)
tree6404ec18e3cf91212f1922dfd5ca60ca3b668cbb /baseboard/hatch
parent9670696203029efa87b0871073e149b7ba8619c2 (diff)
downloadchrome-ec-01f8d598f8bbd5f9d7400d17284e3dbac270d491.tar.gz
hatch: Add smart control for USB-A ports
There are 2 USB-A ports, but 5V power is controlled by the same signal for both of them. This CL adds support for 5V control for these ports. BRANCH=none BUG=b:122251649 TEST=make buildall Change-Id: I21328688ec653d91f9e37d2c441a3b5f816206f3 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387588 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Diffstat (limited to 'baseboard/hatch')
-rw-r--r--baseboard/hatch/baseboard.c5
-rw-r--r--baseboard/hatch/baseboard.h8
2 files changed, 12 insertions, 1 deletions
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c
index ccdd2b3705..78930e4f36 100644
--- a/baseboard/hatch/baseboard.c
+++ b/baseboard/hatch/baseboard.c
@@ -150,6 +150,11 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
}
};
+/* GPIO to enable/disable the USB Type-A port. */
+const int usb_port_enable[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT] = {
+ GPIO_EN_USB_A_5V,
+};
+
/* Power Delivery and charging functions */
void baseboard_tcpc_init(void)
diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h
index 42734459f3..c95cfec9d6 100644
--- a/baseboard/hatch/baseboard.h
+++ b/baseboard/hatch/baseboard.h
@@ -83,6 +83,13 @@
#define CONFIG_CMD_PD_CONTROL
#define CONFIG_CMD_PPC_DUMP
+/* USB Type A Features */
+#define CONFIG_USB_PORT_POWER_SMART
+#undef CONFIG_USB_PORT_POWER_SMART_PORT_COUNT
+#define CONFIG_USB_PORT_POWER_SMART_PORT_COUNT 1
+#define CONFIG_USB_PORT_POWER_SMART_CDP_SDP_ONLY
+#define GPIO_USB1_ILIM_SEL GPIO_EN_USB_A_LOW_PWR_OD
+
/* TODO(b/122273953): Use correct PD delay values */
#define PD_POWER_SUPPLY_TURN_ON_DELAY 30000 /* us */
#define PD_POWER_SUPPLY_TURN_OFF_DELAY 250000 /* us */
@@ -94,7 +101,6 @@
#define PD_MAX_CURRENT_MA 3000
#define PD_MAX_VOLTAGE_MV 20000
-
/* I2C Bus Configuration */
#define CONFIG_I2C
#define CONFIG_I2C_MASTER