Skip to content

Conversation

@sambhurst
Copy link
Contributor

@sambhurst sambhurst commented May 12, 2022

These pull requests are part of a larger effort to port the Google ChromeOS USB-C Stack to Zephyr. See issue #38371.

Currently the State Machine Framework #38088 and Type-C Port Controller Driver #41856 has merged.
This PR implements the USBC-C Subsystem from which Type-C / Power delivery application can be created. Once this PR merges, Power Delivery Sink only applications can be created.

@github-actions github-actions bot added area: API Changes to public APIs area: Boards area: Devicetree area: Devicetree Binding PR modifies or adds a Device Tree binding area: Documentation area: Samples Samples platform: STM32 ST Micro STM32 labels May 12, 2022
@sambhurst sambhurst force-pushed the zephyr_usbc_subsystem branch 7 times, most recently from 0fa9d7a to 0ebb83f Compare May 12, 2022 19:51
@MaureenHelm MaureenHelm requested a review from jfischer-no May 12, 2022 19:57
@sambhurst sambhurst force-pushed the zephyr_usbc_subsystem branch 3 times, most recently from d9db717 to 54cd82f Compare May 12, 2022 21:43
@teburd teburd self-requested a review May 12, 2022 21:45
Copy link
Contributor

@jfischer-no jfischer-no left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to update includes, e.g. #include <kernel.h> -> #include <zephyr/kernel.h>
Please consider to place USBC subsystem in the subsys/usb/usbc, subsys/usb is no longer completely occupied by current device stack, which was moved to subsys/usb/device. What will be added else soon is subsys/usb/device_next and subsys/usb/host (see #42066)

Add pin control properties to the STM32 UCPD bindings file so that the pins can be configured in the device tree. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
Assign the pins for the STM32G071b and STM32G081b STM32 UCPD peripherals so the UCPD driver can properly configure the device. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
Use DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) to determine number of potential interrupt sources. This mitigates the wasting of memory on devices with mutliple UCPD ports but only one UCPD port is used. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
The "@return" command should be used for the arbitrary return description, and "@RetVal <return value>" for the description of named return value Signed-off-by: Sam Hurst <sbh1187@gmail.com>
USB-C VBUS can be measured and controlled by different devices. For example, a TypeC Port Controller (TCPC) or an ADC and GPIO can be used. This driver is used to abstracts the underlying hardware used for USB VBUS measurement and control. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
This commit adds a VBUS driver the uses an ADC connected to a voltage divider to measure VBUS. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
Remove USB-C VBUS2 Discharge configuration node from device tree. USBC VBUS discharge is controlled by the vbus driver. See dts/bindings/usb-c/vbus-adc.yaml Signed-off-by: Sam Hurst <sbh1187@gmail.com>
Update TCPC driver to use DT_HAS_<compat>_ENABLED Kconfig symbol to expose the driver and enable it by default based on devicetree. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
A USB-C VBUS driver will be used to measure VBUS instead of accessing the measurement hardware directly. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
These macros are needed to implement a USB-C Sink device Signed-off-by: Sam Hurst <sbh1187@gmail.com>
A USB TypeC connector has many peripherals associated with it and the DTS binding in this commit provides a way to group peripherals and properties in a device tree. This binding is used with the USB-C Subsytem. This is based on Linux, documentation: https://www.kernel.org/doc/Documentation/devicetree/bindings/connector/usb-connector.yaml Signed-off-by: Sam Hurst <sbh1187@gmail.com>
This USB-C Subsystem enables an application to include USB-C Power Delivery Sink functionality. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
Implementing USB-C Sink functionality can be difficult. This sample application serves as an example of how to create an application with Power Delivery Sink functionality. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
Documents the USB-C Subsystem API. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
This commit adds the USB-C driver API documentation in peripherals section of the reference guide. The USB-C VBUS API is declared experimental. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
Add a new entry specifically for USB-C. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
This CL removes the board specific USB-C Sink sample in favor of the generic USB-C Sink sample. Signed-off-by: Sam Hurst <sbh1187@gmail.com>
Add myself as codeowner for the USB-C subsystem and sample Signed-off-by: Sam Hurst <sbh1187@gmail.com>
@sambhurst sambhurst requested a review from galak October 20, 2022 15:20
@nashif nashif merged commit 7880954 into zephyrproject-rtos:main Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment