mbox series

[RFT,0/9] usb: typec: tipd: Add Apple M1 support

Message ID 20210918120934.28252-1-sven@svenpeter.dev (mailing list archive)
Headers show
Series usb: typec: tipd: Add Apple M1 support | expand

Message

Sven Peter Sept. 18, 2021, 12:09 p.m. UTC
Hi,

This series adds initial support for the Apple CD3217/3218 chip which is also
known as Apple ACE1/2. These chips are used on Apple M1 machines.
They are based on the TI TPS6598x chips with a few differences:

	- The interrupt numbers have been changed
	- The secondary i2c bus and its interrupt controller are connected to the
	  system management controller and must not be disturbed
	- The chip comes up in a low power state and must be booted using the
	  "SPSS" (System Power State Switch maybe) command which is not
	  documented in the TI manual
	- The interrupt mask must be set up explicitely

The first patches prepare for adding support and introduce almost no
functional changes to the driver. Only the interrupt mask is set up for
those as well since I think that makes sense either way.
Then the last patches enable the different behavior required for the Apple
chip selected by a new compatible in the device tree.

I'm only able to test this on my M1 and would appreciate if someone could
confirm this does not break the regular TPS chips. I'm also interested to
see if the normal chips also support the "SPSS" command.

Testing this on the M1 additionaly requires a pinctrl/gpio and a i2c driver
which are not ready to be submitted upstream yet. I've collected the current
work-in-progress state in a branch at [1] though if anyone wants to give
those a try.


Best,


Sven


[1] https://github.com/AsahiLinux/linux/tree/sven/i2c-tipd-WIP

Sven Peter (9):
  dt-bindings: usb: tps6598x: Add Apple CD321x compatible
  usb: typec: tipd: Prepare supporting different variants
  usb: typec: tipd: Allow irq controller selection
  usb: typec: tipd: Add short-circuit for no irqs
  usb: typec: tipd: Allow to configure irq bits
  usb: typec: tipd: Setup IntMask explicitly
  usb: typec: tipd: Add support for apple,cd321x
  usb: typec: tipd: Switch power state to S0 for Apple variant
  usb: typec: tipd: Remove FIXME about testing with I2C_FUNC_I2C

 .../devicetree/bindings/usb/ti,tps6598x.yaml  |   4 +
 drivers/usb/typec/tipd/core.c                 | 140 ++++++++++++++++--
 drivers/usb/typec/tipd/tps6598x.h             |  12 ++
 drivers/usb/typec/tipd/trace.h                |  27 ++++
 4 files changed, 168 insertions(+), 15 deletions(-)

Comments

Alyssa Rosenzweig Sept. 19, 2021, 11:35 a.m. UTC | #1
Hi Sven,

Happy to see this up for review. I skipped a commit that's too deep into
tps driver guts for me to grok, but otherwise you have my r-bs, and this
series has my

	Tested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>

Thanks,

Alyssa