[PATCH 0/2] platform/chrome: cros_ec_typec: Link PD object to partner
From: Prashant Malani
Date: Mon Nov 21 2022 - 15:13:55 EST
This is a short series to link a registered USB PD object to its associated
partner device. This is helpful for userspace services (the ChromeOS Type-C
daemon, for example), to identify which Type-C peripheral a PD object belongs to,
when a uevent for the PD object arrives.
The first patch adds a helper to the Type-C class code to access the device struct
for a partner. The second patch uses that helper to set the parent for the USB PD object
in the port driver code.
There was an earlier patch[1] to solve this issue, but it's been jettisoned (on advice from
GregKH) in favor of the current approach.
[1] https://lore.kernel.org/linux-usb/Y3vNZEuNI3CWzZ0L@xxxxxxxxxxxx/T/#m7521020f64d878313d7dd79903ec0e9421aa8737
Series submission suggestions (if the approach is OK):
- Patch 1 goes throug the USB tree and Patch 2 goes in the next release cycle
through the chrome-platform tree.
- Patch 1 and 2 both go through the USB tree.
Prashant Malani (2):
usb: typec: Add helper to get partner device struct
platform/chrome: cros_ec_typec: Set parent of partner PD object
drivers/platform/chrome/cros_ec_typec.c | 2 +-
drivers/usb/typec/class.c | 13 +++++++++++++
include/linux/usb/typec.h | 2 ++
3 files changed, 16 insertions(+), 1 deletion(-)
--
2.38.1.584.g0f3c55d4c2-goog