Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Documentation/devicetree/bindings/input/apple,dockchannel-hid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,43 @@ properties:
Name of the touchscreen firmware that the host sends to the
coprocessor when the interface is first opened.

apple,power-method:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [1, 2]
default: 1
description:
The power sequencing protocol of the coprocessor firmware, as
described above. With power method 2 the touchscreen owns its
lines, so apple,reset-gpios should be given. Without it the driver
falls back to the shared apple,afe-reset-gpios of the parent and
does not power-cycle the touchscreen itself.

apple,reset-gpios:
maxItems: 1
description:
Reset line of the touchscreen, described with the level that
asserts the reset as its active level. Unlike the multi-touch
analog front end reset the touchscreen owns the line, and with
power method 2 the host drives it itself during the start
sequence instead of using the shared reset of the parent.

apple,power-gpios:
maxItems: 1
description:
Optional supply enable line of the touchscreen, raised to power
the interface on and lowered to power it off during power
method 2 transitions.

touchscreen-size-x:
$ref: touchscreen/touchscreen.yaml#/properties/touchscreen-size-x

touchscreen-size-y:
$ref: touchscreen/touchscreen.yaml#/properties/touchscreen-size-y

touchscreen-x-mm: true

touchscreen-y-mm: true

mtp:
type: object
additionalProperties: false
Expand Down
5 changes: 5 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,11 @@ F: drivers/gpu/drm/apple/dcp-fabric*
F: tools/testing/selftests/drivers/gpu/apple-afkv2/
F: tools/testing/selftests/drivers/gpu/apple-dcp/

APPLE MTP TOUCH SCREEN (KIWI) DRIVER
M: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
S: Maintained
F: drivers/hid/hid-apple-mtp-kiwi.c

APPLE PCIE CONTROLLER DRIVER
M: Marc Zyngier <maz@kernel.org>
L: linux-pci@vger.kernel.org
Expand Down
11 changes: 6 additions & 5 deletions arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,12 @@
/*
* The touchscreen (ADT mtp-transport/kiwi, image-tag "fsat"). macOS
* sends it firmware through the same CBOR bootloader as the trackpad.
* Its power, reset, 24 MHz clock and display-sync lines are SoC GPIOs
* (nub-gpio0 0x1a, 0x19, 0x16; gpio0 0xb), with an SMC power reference
* (pKW4('rCIO', 0x20000)) and the TSRC clock source. How that load and
* the report format map onto this transport is still being worked
* out, so the interface stays off until it has been tested.
* Its power (nub-gpio0 0x1a) and reset (0x19) lines are GPIOs; the 24
* MHz clock (nub-gpio0 0x16) and display-sync (gpio0 0xb) pads are pad
* functions, muxed by the transport node's pinctrl-0. The ADT also
* names an SMC power reference (pKW4('rCIO', 0x20000)) and the TSRC
* clock source. A board enables the interface once its settings have
* been tested (the K114c so far).
*/
kiwi: kiwi {
status = "disabled";
Expand Down
42 changes: 42 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-k114c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/* Defined before the includes: t6050-max.dtsi guards the ATC2 router on it. */
#define T6050_K114C
#include "t6050-k114-k116.dtsi"
#include <dt-bindings/pinctrl/apple.h>

/ {
compatible = "apple,k114c", "apple,t6050", "apple,arm-platform";
Expand Down Expand Up @@ -581,3 +582,44 @@
<&ps_atc2_cio_usb>, <&ps_atc2_cio_auss>, <&ps_atc2_pcie>;
apple,pcie-tunnel = <&acio2_pcie_tunnel>;
};

/*
* The touchscreen (kiwi). It sequences its own power: power method 2 with
* its own reset line (nub GPIO 25, active low) and supply enable (nub GPIO
* 26), not the shared multi-touch AFE reset. The GPIO numbers, pin values
* and polarities are those of a device tree that gave touch on this machine.
*/
&ps_nub_gpio {
status = "okay";
};

&nub_gpio0 {
status = "okay";

kiwi_clk24_pins: kiwi-clk24-pins {
pinmux = <APPLE_PINMUX(22, 1)>;
};
};

&pinctrl_ap {
kiwi_dsync_pins: kiwi-dsync-pins {
pinmux = <APPLE_PINMUX(11, 1)>;
};
};

&mtp_hid {
pinctrl-0 = <&kiwi_clk24_pins>, <&kiwi_dsync_pins>;
pinctrl-names = "default";
};

&kiwi {
firmware-name = "apple/tpkiwifw-k114c.bin";
apple,power-method = <2>;
apple,reset-gpios = <&nub_gpio0 25 GPIO_ACTIVE_LOW>;
apple,power-gpios = <&nub_gpio0 26 GPIO_ACTIVE_HIGH>;
touchscreen-size-x = <3024>;
touchscreen-size-y = <1986>;
touchscreen-x-mm = <302>;
touchscreen-y-mm = <199>;
status = "okay";
};
1 change: 1 addition & 0 deletions arch/arm64/configs/asahi.config
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ CONFIG_SND_SOC_TAS2770=m
CONFIG_HID_APPLE=m
CONFIG_HID_MAGICMOUSE=m
CONFIG_HID_APPLE_MTP_HAPTIC=m
CONFIG_HID_APPLE_MTP_KIWI=m
CONFIG_SERIAL_SAMSUNG=y
CONFIG_SERIAL_SAMSUNG_CONSOLE=y
CONFIG_HID_DOCKCHANNEL=m
Expand Down
12 changes: 12 additions & 0 deletions drivers/hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ config HID_APPLE_MTP_HAPTIC
This driver can also be built as a module. If so, it will be called
hid-apple-mtp-haptic.

config HID_APPLE_MTP_KIWI
tristate "Apple MTP touch screen (kiwi) support"
depends on HID
help
Support for the touch screen of the 14 inch M5 Max MacBook Pro
(K114c). The driver turns the raw capacitance image of the touch
interface into multi-touch contacts. The sensor grid and the panel
size are fixed in the driver, and it ignores frames of any other size.

This driver can also be built as a module. If so, it will be called
hid-apple-mtp-kiwi.

config HID_APPLEIR
tristate "Apple infrared receiver"
depends on (USB_HID)
Expand Down
1 change: 1 addition & 0 deletions drivers/hid/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ obj-$(CONFIG_HID_ALPS) += hid-alps.o
obj-$(CONFIG_HID_ACRUX) += hid-axff.o
obj-$(CONFIG_HID_APPLE) += hid-apple.o
obj-$(CONFIG_HID_APPLE_MTP_HAPTIC) += hid-apple-mtp-haptic.o
obj-$(CONFIG_HID_APPLE_MTP_KIWI) += hid-apple-mtp-kiwi.o
obj-$(CONFIG_HID_APPLEIR) += hid-appleir.o
obj-$(CONFIG_HID_APPLETB_BL) += hid-appletb-bl.o
obj-$(CONFIG_HID_APPLETB_KBD) += hid-appletb-kbd.o
Expand Down
Loading
Loading