Skip to content

usb: typec: UCSI driver overhaul

Heikki Krogerus linux-usb 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14usb: typec: Copy everything from struct typec_capability during registrationdrivers/usb/typec/class.c+35 -200 replies
2/14usb: typec: Introduce typec_get_drvdata()drivers/usb/typec/class.c include/linux/usb/typec.h+15 -00 replies
3/14usb: typec: Separate the operations vectordrivers/usb/typec/class.c include/linux/usb/typec.h+76 -330 replies
4/14usb: typec: tcpm: Start using struct typec_operationsdrivers/usb/typec/tcpm/tcpm.c+21 -260 replies
5/14usb: typec: tps6598x: Start using struct typec_operationsdrivers/usb/typec/tps6598x.c+26 -230 replies
6/14usb: typec: ucsi: Start using struct typec_operationsdrivers/usb/typec/ucsi/ucsi.c+11 -110 replies
7/14usb: typec: Remove the callback members from struct typec_capabilitydrivers/usb/typec/class.c include/linux/usb/typec.h+22 -600 replies
8/14usb: typec: ucsi: ccg: Remove run_isr flagdrivers/usb/typec/ucsi/ucsi_ccg.c+4 -380 replies
9/14usb: typec: ucsi: Simplified interface registration and I/O APIdrivers/usb/typec/ucsi/ucsi.c drivers/usb/typec/ucsi/ucsi.h+354 -290 replies
10/14usb: typec: ucsi: acpi: Move to the new APIdrivers/usb/typec/ucsi/ucsi_acpi.c+77 -190 replies
11/14usb: typec: ucsi: ccg: Move to the new APIdrivers/usb/typec/ucsi/ucsi_ccg.c+87 -850 replies
12/14usb: typec: ucsi: Remove the old APIdrivers/usb/typec/ucsi/displayport.c drivers/usb/typec/ucsi/trace.h drivers/usb/typec/ucsi/ucsi.c +1 more+41 -3710 replies
13/14usb: typec: ucsi: Remove struct ucsi_controldrivers/usb/typec/ucsi/displayport.c drivers/usb/typec/ucsi/trace.c drivers/usb/typec/ucsi/trace.h +2 more+118 -3020 replies
14/14usb: typec: ucsi: Remove all bit-fieldsdrivers/usb/typec/ucsi/trace.h drivers/usb/typec/ucsi/ucsi.c drivers/usb/typec/ucsi/ucsi.h+85 -720 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/14] usb: typec: UCSI driver overhaul

Hi Ajay,

Here's the pretty much complete rewrite of the I/O handling that I was talking about. The first seven patches are not actually related to this stuff, but I'm including them here because the rest of the series is made on top of them. I'm including also that fix patch I send you earlier.

After this it should be easier to handle quirks. My idea how to handle the multi-instance connector alt modes is that we "emulate" the PPM in ucsi_ccg.c in order to handle them, so ucsi.c is not touched at all.

We can now get the connector alternate modes that the actual controller supplies during probe - before registering the ucsi interface - and squash all alt modes with the same SVID into one that we supply to the ucsi.c when ever it sends GET_ALTERNATE_MODES command. Also other alt mode commands like SET_NEW_CAM can have special processing in ucsi_ccg.c and ucsi_ccg.c alone. There should not be any problem with that anymore.

thanks,

Heikki Krogerus (14):
usb: typec: Copy everything from struct typec_capability during
registration
usb: typec: Introduce typec_get_drvdata()
usb: typec: Separate the operations vector
usb: typec: tcpm: Start using struct typec_operations
usb: typec: tps6598x: Start using struct typec_operations
usb: typec: ucsi: Start using struct typec_operations
usb: typec: Remove the callback members from struct typec_capability
usb: typec: ucsi: ccg: Remove run_isr flag
usb: typec: ucsi: Simplified interface registration and I/O API
usb: typec: ucsi: acpi: Move to the new API
usb: typec: ucsi: ccg: Move to the new API
usb: typec: ucsi: Remove the old API
usb: typec: ucsi: Remove struct ucsi_control
usb: typec: ucsi: Remove all bit-fields

 drivers/usb/typec/class.c            | 125 +++---
 drivers/usb/typec/tcpm/tcpm.c        |  47 +--
 drivers/usb/typec/tps6598x.c         |  49 +--
 drivers/usb/typec/ucsi/displayport.c |  26 +-
 drivers/usb/typec/ucsi/trace.c       |  11 -
 drivers/usb/typec/ucsi/trace.h       |  79 +---
 drivers/usb/typec/ucsi/ucsi.c        | 592 ++++++++++++++-------------
 drivers/usb/typec/ucsi/ucsi.h        | 410 +++++++------------
 drivers/usb/typec/ucsi/ucsi_acpi.c   |  96 ++++-
 drivers/usb/typec/ucsi/ucsi_ccg.c    | 214 ++++------
 include/linux/usb/typec.h            |  38 +-
 11 files changed, 785 insertions(+), 902 deletions(-)
Signature · 1 line
2.23.0