]> www.infradead.org Git - users/willy/pagecache.git/commit
platform/chrome: cros_ec_typec: Add support for setting USB mode via sysfs
authorAndrei Kuchynski <akuchynski@chromium.org>
Mon, 10 Feb 2025 13:04:19 +0000 (13:04 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Fri, 21 Feb 2025 01:42:22 +0000 (01:42 +0000)
commit9fc83373f0ffb8834da48b1446a5c2fef9525bb1
tree5cea1454ddfe2f38d1ab48f142b5af963a61e3a6
parent435a3d78b87a93c52a4f84e36ba4a0857554c958
platform/chrome: cros_ec_typec: Add support for setting USB mode via sysfs

This patch implements USB mode setting via a sysfs interface in
cros_ec_typec driver. User-space applications can now change the current
USB mode by writing to "usb_mode" sysfs entry, replacing the previous
ioctl-based method.
The embedded controller (EC) currently supports only entering USB4 mode
and exiting all modes (including altmodes). Both of these operations
trigger Data Reset Message, even if no USB Mode is active.
Additionally, the patch exposes the USB modes supported by the port via
"usb_capability" sysfs attribute.

Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
Link: https://lore.kernel.org/r/20250210130419.4110130-1-akuchynski@chromium.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_ec_typec.c
drivers/platform/chrome/cros_ec_typec.h