Skip to content

RFC usb: typec: New attribute files for USB mode

Heikki Krogerus linux-usb 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3usb: typec: Add attribute file showing the USB mode of the portDocumentation/ABI/testing/sysfs-class-typec drivers/usb/typec/class.c include/linux/usb/typec.h+82 -00 replies
2/3usb: typec: Add attribute file showing the USB mode of the partnerDocumentation/ABI/testing/sysfs-class-typec drivers/usb/typec/class.c include/linux/usb/typec.h+99 -50 replies
3/3usb: typec: Add driver for Thunderbolt 3 Alternate Modedrivers/usb/typec/altmodes/Kconfig drivers/usb/typec/altmodes/Makefile drivers/usb/typec/altmodes/thunderbolt.c+320 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] usb: typec: New attribute files for USB mode

Hi Guenter,

These patches introduce the new sysfs attribute files that allow the user to see and also control the USB mode. The last patch just adds driver for the TBT3 alt mode. The series is made on top of:
https://lore.kernel.org/linux-usb/[email protected]/

What I'm proposing is that we introduce a new sysfs attribute file named "usb_mode" for both the port and partner devices. The file displays the supported USB modes (usb2, usb3, usb4) when read in with both types of devices.

If the user writes to the port attribute file a mode, that mode will be used as the value for the "USB mode" field in the Enter_USB message next time there is a connection. Changing the active mode of the port does not affect the current connection. However, if the user writes to the partner attribute file a mode, Data Reset message is expected to be send to the partner, and the new mode is to be used with the Enter_USB message that follows (as defined in the latest USB Power Delivery spec.).

So the attribute file is the same for both port and partner, but writing to it has different behaviour.

The new attribute files should work, but I want to make sure that the approach is acceptable?

thanks,

Heikki Krogerus (3):
usb: typec: Add attribute file showing the USB mode of the port
usb: typec: Add attribute file showing the USB mode of the partner
usb: typec: Add driver for Thunderbolt 3 Alternate Mode

 Documentation/ABI/testing/sysfs-class-typec |  34 +++
 drivers/usb/typec/altmodes/Kconfig          |   9 +
 drivers/usb/typec/altmodes/Makefile         |   2 +
 drivers/usb/typec/altmodes/thunderbolt.c    | 309 ++++++++++++++++++++
 drivers/usb/typec/class.c                   | 133 ++++++++-
 include/linux/usb/typec.h                   |  11 +
 6 files changed, 497 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/typec/altmodes/thunderbolt.c
Signature · 1 line
2.24.1