linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] Thunderbolt and DP altmode support for cros-ec-typec
@ 2024-11-07 19:29 Abhishek Pandit-Subedi
  2024-11-07 19:29 ` [PATCH v3 1/7] usb: typec: Only use SVID for matching altmodes Abhishek Pandit-Subedi
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Abhishek Pandit-Subedi @ 2024-11-07 19:29 UTC (permalink / raw)
  To: heikki.krogerus, tzungbi, linux-usb, chrome-platform
  Cc: jthies, akuchynski, pmalani, dmitry.baryshkov,
	Abhishek Pandit-Subedi, Benson Leung, Greg Kroah-Hartman,
	Guenter Roeck, Masahiro Yamada, Nathan Chancellor, Nicolas Schier,
	linux-kbuild, linux-kernel


Hi Heikki, Tzung-Bi et al,

This patch series adds support for alternate mode entry for the
cros-ec-typec driver for Displayport and Thunderbolt.

Thunderbolt support is added by adapting an RFC Heikki had posted
previously:

https://lore.kernel.org/linux-usb/20191230152857.43917-1-heikki.krogerus@linux.intel.com/

A few comments on the series:

* The cros-ec interface will not accept any VDOs/VDMs so we simply
  ignore any configurations we are passed (i.e. DPConfigure). This means
  the sysfs control of DP lanes won't work.
* ChromeOS has two modes of operation for alt-modes: entirely EC driven
  or AP-driven from userspace (via the typec daemon). Thus, we don't
  expect the kernel alt-mode drivers to auto-enter modes in all cases.
  This series allows auto-enter for displayport but disables it for TBT
  for this reason.

This was tested with a ChromeOS Brya device using kernel 6.6 and built
with allmodconfig for linux-usb.

Thanks,
Abhishek

Changes in v3:
- Removed mode from altmode device ids
- Updated modalias for typecd bus to remove mode
- Re-ordered to start of series
- Revert rename of TYPEC_TBT_MODE
- Remove mode from typec_device_id
- Use port.active instead of introducing auto-enter field
- Introduce inactive field to typec_altmode_desc to set default value
  for active.
- Always make port 'active' field writable
- Refactored typec_altmode_dp_data per review request
- Removed unused vdm operations during altmode registration
- Fix usage of TBT sid and mode.
- Removed unused vdm operations during altmode registration
- Set port.inactive = true instead of auto-enter.

Changes in v2:
- Update altmode_match to ignore mode entirely
- Also apply the same behavior to typec_match
- Use <linux/usb/typec_tbt.h> and add missing TBT_CABLE_ROUNDED
- Pass struct typec_thunderbolt_data to typec_altmode_notify
- Rename TYPEC_TBT_MODE to USB_TYPEC_TBT_MODE
- Use USB_TYPEC_TBT_SID and USB_TYPEC_TBT_MODE for device id
- Change module license to GPL due to checkpatch warning
- Refactored displayport into cros_typec_altmode.c to extract common
  implementation between altmodes
- Refactored thunderbolt support into cros_typec_altmode.c
- Only disable auto-enter for Thunderbolt
- Update commit message to clearly indicate the need for userspace
  intervention to enter TBT mode

Abhishek Pandit-Subedi (6):
  usb: typec: Only use SVID for matching altmodes
  usb: typec: Check port is active before enter mode on probe
  platform/chrome: cros_ec_typec: Update partner altmode active
  platform/chrome: cros_ec_typec: Displayport support
  platform/chrome: cros_ec_typec: Thunderbolt support
  platform/chrome: cros_ec_typec: Disable tbt on port

Heikki Krogerus (1):
  usb: typec: Add driver for Thunderbolt 3 Alternate Mode

 MAINTAINERS                                  |   3 +
 drivers/platform/chrome/Makefile             |   7 +
 drivers/platform/chrome/cros_ec_typec.c      |  47 ++-
 drivers/platform/chrome/cros_ec_typec.h      |   1 +
 drivers/platform/chrome/cros_typec_altmode.c | 360 +++++++++++++++++++
 drivers/platform/chrome/cros_typec_altmode.h |  48 +++
 drivers/usb/typec/altmodes/Kconfig           |   9 +
 drivers/usb/typec/altmodes/Makefile          |   2 +
 drivers/usb/typec/altmodes/displayport.c     |   9 +-
 drivers/usb/typec/altmodes/nvidia.c          |   2 +-
 drivers/usb/typec/altmodes/thunderbolt.c     | 312 ++++++++++++++++
 drivers/usb/typec/bus.c                      |   6 +-
 drivers/usb/typec/class.c                    |   9 +-
 include/linux/usb/typec.h                    |   2 +
 include/linux/usb/typec_tbt.h                |   1 +
 scripts/mod/devicetable-offsets.c            |   1 -
 scripts/mod/file2alias.c                     |   4 +-
 17 files changed, 793 insertions(+), 30 deletions(-)
 create mode 100644 drivers/platform/chrome/cros_typec_altmode.c
 create mode 100644 drivers/platform/chrome/cros_typec_altmode.h
 create mode 100644 drivers/usb/typec/altmodes/thunderbolt.c

-- 
2.47.0.277.g8800431eea-goog


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-12-06 23:30 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 19:29 [PATCH v3 0/7] Thunderbolt and DP altmode support for cros-ec-typec Abhishek Pandit-Subedi
2024-11-07 19:29 ` [PATCH v3 1/7] usb: typec: Only use SVID for matching altmodes Abhishek Pandit-Subedi
2024-11-08 11:41   ` Heikki Krogerus
2024-11-07 19:29 ` [PATCH v3 2/7] usb: typec: Add driver for Thunderbolt 3 Alternate Mode Abhishek Pandit-Subedi
2024-11-09  6:21   ` Dmitry Baryshkov
2024-11-14  3:51     ` Abhishek Pandit-Subedi
2024-11-22 18:50   ` Benson Leung
2024-12-06 22:27     ` Abhishek Pandit-Subedi
2024-11-07 19:29 ` [PATCH v3 3/7] usb: typec: Check port is active before enter mode on probe Abhishek Pandit-Subedi
2024-11-08 12:21   ` Heikki Krogerus
2024-11-08 13:17   ` Greg Kroah-Hartman
2024-11-08 18:28     ` Abhishek Pandit-Subedi
2024-11-07 19:29 ` [PATCH v3 4/7] platform/chrome: cros_ec_typec: Update partner altmode active Abhishek Pandit-Subedi
2024-11-07 19:29 ` [PATCH v3 5/7] platform/chrome: cros_ec_typec: Displayport support Abhishek Pandit-Subedi
2024-11-09  6:38   ` Dmitry Baryshkov
2024-11-14  4:13     ` Abhishek Pandit-Subedi
2024-11-12  0:16   ` Benson Leung
2024-11-07 19:29 ` [PATCH v3 6/7] platform/chrome: cros_ec_typec: Thunderbolt support Abhishek Pandit-Subedi
2024-11-09  6:41   ` Dmitry Baryshkov
2024-11-14  4:01     ` Abhishek Pandit-Subedi
2024-11-14 10:55       ` Dmitry Baryshkov
2024-12-06 22:23         ` Abhishek Pandit-Subedi
2024-12-06 23:30           ` Dmitry Baryshkov
2024-11-07 19:30 ` [PATCH v3 7/7] platform/chrome: cros_ec_typec: Disable tbt on port Abhishek Pandit-Subedi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).