[RFT PATCH 0/9] usb: typec: tipd: Add Apple M1 support
From: Sven Peter
Date: Sat Sep 18 2021 - 08:10:26 EST
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(-)
--
2.25.1