Initial type-c connector class helper functionality - print the contents of files from the port directories
Add starter functionality for the type-c connector class helper ported from https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/main/debugd/src/helpers/typec_connector_class_helper.cc (see also typec_connector_class_helper_utils.cc).
The helper pretty-prints information provided by the USB Type-C Connector Class (Linux) in the sysfs and is mainly used for debugging Type-C-related issues.
An example of the output format expected at this stage is:
port0
uevent: DEVTYPE=typec_port
TYPEC_PORT=port0
vconn_source: no
supported_accessory_modes: none
power_role: source [sink]
data_role: host [device]
preferred_role: source
power_operation_mode: default
usb_power_delivery_revision: 0.0
usb_typec_revision: 0.0
waiting_for_supplier: 0
port1
[...port1 info]
Bug: 367613400
Test: (host) m typec_connector_class
(DUT) adb push "$ANDROID_PRODUCT_OUT/system/bin/typec_connector_class" /data/local/tmp
(DUT) /data/local/tmp/typec_connector_class
(DUT) manually check the contents of the port directories (e.g. port0/) under /sys/class/typec/ match the command's output.
Change-Id: Ie30221e1c4e46770bc07051b038984d204fb5588
5 files changed