Skip to content

Commit a59b386

Browse files
committed
Merge branch 'bits/230-touchbar' into asahi-wip
2 parents e2d1549 + 937ab1e commit a59b386

File tree

17 files changed

+1863
-0
lines changed

17 files changed

+1863
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/apple,h7-display-pipe-mipi.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Apple pre-DCP display controller MIPI interface
8+
9+
maintainers:
10+
- Sasha Finkelstein <fnkl.kernel@gmail.com>
11+
12+
description:
13+
The MIPI controller part of the pre-DCP Apple display controller
14+
15+
allOf:
16+
- $ref: dsi-controller.yaml#
17+
18+
properties:
19+
compatible:
20+
items:
21+
- enum:
22+
- apple,t8112-display-pipe-mipi
23+
- apple,t8103-display-pipe-mipi
24+
- const: apple,h7-display-pipe-mipi
25+
26+
reg:
27+
maxItems: 1
28+
29+
power-domains:
30+
maxItems: 1
31+
32+
ports:
33+
$ref: /schemas/graph.yaml#/properties/ports
34+
35+
properties:
36+
port@0:
37+
$ref: /schemas/graph.yaml#/properties/port
38+
description: Input port. Always connected to the primary controller
39+
40+
port@1:
41+
$ref: /schemas/graph.yaml#/properties/port
42+
description: Output MIPI DSI port to the panel
43+
44+
required:
45+
- port@0
46+
- port@1
47+
48+
required:
49+
- compatible
50+
- reg
51+
- ports
52+
53+
unevaluatedProperties: false
54+
55+
examples:
56+
- |
57+
dsi@28200000 {
58+
compatible = "apple,t8103-display-pipe-mipi", "apple,h7-display-pipe-mipi";
59+
reg = <0x28200000 0xc000>;
60+
power-domains = <&ps_dispdfr_mipi>;
61+
62+
ports {
63+
#address-cells = <1>;
64+
#size-cells = <0>;
65+
66+
port@0 {
67+
reg = <0>;
68+
69+
dfr_adp_out_mipi: endpoint {
70+
remote-endpoint = <&dfr_adp_out_mipi>;
71+
};
72+
};
73+
74+
port@1 {
75+
reg = <1>;
76+
77+
dfr_panel_in: endpoint {
78+
remote-endpoint = <&dfr_mipi_out_panel>;
79+
};
80+
};
81+
};
82+
};
83+
...
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/apple,h7-display-pipe.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Apple pre-DCP display controller
8+
9+
maintainers:
10+
- Sasha Finkelstein <fnkl.kernel@gmail.com>
11+
12+
description:
13+
A secondary display controller used to drive the "touchbar" on
14+
certain Apple laptops.
15+
16+
properties:
17+
compatible:
18+
items:
19+
- enum:
20+
- apple,t8112-display-pipe
21+
- apple,t8103-display-pipe
22+
- const: apple,h7-display-pipe
23+
24+
reg:
25+
items:
26+
- description: Primary register block, controls planes and blending
27+
- description:
28+
Contains other configuration registers like interrupt
29+
and FIFO control
30+
31+
reg-names:
32+
items:
33+
- const: be
34+
- const: fe
35+
36+
power-domains:
37+
description:
38+
Phandles to pmgr entries that are needed for this controller to turn on.
39+
Aside from that, their specific functions are unknown
40+
maxItems: 2
41+
42+
interrupts:
43+
items:
44+
- description: Unknown function
45+
- description: Primary interrupt. Vsync events are reported via it
46+
47+
interrupt-names:
48+
items:
49+
- const: be
50+
- const: fe
51+
52+
iommus:
53+
maxItems: 1
54+
55+
port:
56+
$ref: /schemas/graph.yaml#/properties/port
57+
description: Output port. Always connected to apple,h7-display-pipe-mipi
58+
59+
required:
60+
- compatible
61+
- reg
62+
- interrupts
63+
- port
64+
65+
additionalProperties: false
66+
67+
examples:
68+
- |
69+
#include <dt-bindings/interrupt-controller/apple-aic.h>
70+
display-pipe@28200000 {
71+
compatible = "apple,t8103-display-pipe", "apple,h7-display-pipe";
72+
reg = <0x28200000 0xc000>,
73+
<0x28400000 0x4000>;
74+
reg-names = "be", "fe";
75+
power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
76+
interrupt-parent = <&aic>;
77+
interrupts = <AIC_IRQ 502 IRQ_TYPE_LEVEL_HIGH>,
78+
<AIC_IRQ 506 IRQ_TYPE_LEVEL_HIGH>;
79+
interrupt-names = "be", "fe";
80+
iommus = <&displaydfr_dart 0>;
81+
82+
port {
83+
dfr_adp_out_mipi: endpoint {
84+
remote-endpoint = <&dfr_mipi_in_adp>;
85+
};
86+
};
87+
};
88+
...
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/panel/apple,summit.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Apple "Summit" display panel
8+
9+
maintainers:
10+
- Sasha Finkelstein <fnkl.kernel@gmail.com>
11+
12+
description:
13+
An OLED panel used as a touchbar on certain Apple laptops.
14+
Contains a backlight device, which controls brightness of the panel itself.
15+
The backlight common properties are included for this reason
16+
17+
allOf:
18+
- $ref: panel-common.yaml#
19+
- $ref: /schemas/leds/backlight/common.yaml#
20+
21+
properties:
22+
compatible:
23+
items:
24+
- enum:
25+
- apple,j293-summit
26+
- apple,j493-summit
27+
- const: apple,summit
28+
29+
reg:
30+
maxItems: 1
31+
32+
required:
33+
- compatible
34+
- reg
35+
- max-brightness
36+
- port
37+
38+
unevaluatedProperties: false
39+
40+
examples:
41+
- |
42+
dsi {
43+
#address-cells = <1>;
44+
#size-cells = <0>;
45+
46+
panel@0 {
47+
compatible = "apple,j293-summit", "apple,summit";
48+
reg = <0>;
49+
max-brightness = <255>;
50+
51+
port {
52+
endpoint {
53+
remote-endpoint = <&dfr_bridge_out>;
54+
};
55+
};
56+
};
57+
};
58+
...
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/input/touchscreen/apple,z2-multitouch.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Apple touchscreens attached using the Z2 protocol
8+
9+
maintainers:
10+
- Sasha Finkelstein <fnkl.kernel@gmail.com>
11+
12+
description: A series of touschscreen controllers used in Apple products
13+
14+
allOf:
15+
- $ref: touchscreen.yaml#
16+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
17+
18+
properties:
19+
compatible:
20+
enum:
21+
- apple,j293-touchbar
22+
- apple,j493-touchbar
23+
24+
interrupts:
25+
maxItems: 1
26+
27+
reset-gpios:
28+
maxItems: 1
29+
30+
firmware-name:
31+
maxItems: 1
32+
33+
apple,z2-cal-blob:
34+
$ref: /schemas/types.yaml#/definitions/uint8-array
35+
maxItems: 4096
36+
description:
37+
Calibration blob supplied by the bootloader
38+
39+
required:
40+
- compatible
41+
- interrupts
42+
- reset-gpios
43+
- firmware-name
44+
- touchscreen-size-x
45+
- touchscreen-size-y
46+
47+
unevaluatedProperties: false
48+
49+
examples:
50+
- |
51+
#include <dt-bindings/gpio/gpio.h>
52+
#include <dt-bindings/interrupt-controller/irq.h>
53+
54+
spi {
55+
#address-cells = <1>;
56+
#size-cells = <0>;
57+
58+
touchscreen@0 {
59+
compatible = "apple,j293-touchbar";
60+
reg = <0>;
61+
spi-max-frequency = <11500000>;
62+
reset-gpios = <&pinctrl_ap 139 GPIO_ACTIVE_LOW>;
63+
interrupts-extended = <&pinctrl_ap 194 IRQ_TYPE_EDGE_FALLING>;
64+
firmware-name = "apple/dfrmtfw-j293.bin";
65+
touchscreen-size-x = <23045>;
66+
touchscreen-size-y = <640>;
67+
};
68+
};
69+
70+
...

MAINTAINERS

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,6 +2236,7 @@ F: Documentation/devicetree/bindings/clock/apple,nco.yaml
22362236
F: Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml
22372237
F: Documentation/devicetree/bindings/dma/apple,admac.yaml
22382238
F: Documentation/devicetree/bindings/i2c/apple,i2c.yaml
2239+
F: Documentation/devicetree/bindings/input/touchscreen/apple,z2-multitouch.yaml
22392240
F: Documentation/devicetree/bindings/interrupt-controller/apple,*
22402241
F: Documentation/devicetree/bindings/iommu/apple,dart.yaml
22412242
F: Documentation/devicetree/bindings/iommu/apple,sart.yaml
@@ -2258,6 +2259,7 @@ F: drivers/dma/apple-admac.c
22582259
F: drivers/pmdomain/apple/
22592260
F: drivers/i2c/busses/i2c-pasemi-core.c
22602261
F: drivers/i2c/busses/i2c-pasemi-platform.c
2262+
F: drivers/input/touchscreen/apple_z2.c
22612263
F: drivers/iommu/apple-dart.c
22622264
F: drivers/iommu/io-pgtable-dart.c
22632265
F: drivers/irqchip/irq-apple-aic.c
@@ -7876,6 +7878,22 @@ F: drivers/gpu/host1x/
78767878
F: include/linux/host1x.h
78777879
F: include/uapi/drm/tegra_drm.h
78787880

7881+
DRM DRIVERS FOR PRE-DCP APPLE DISPLAY OUTPUT
7882+
M: Sasha Finkelstein <fnkl.kernel@gmail.com>
7883+
R: Janne Grunau <j@jannau.net>
7884+
L: dri-devel@lists.freedesktop.org
7885+
L: asahi@lists.linux.dev
7886+
S: Maintained
7887+
W: https://asahilinux.org
7888+
B: https://github.com/AsahiLinux/linux/issues
7889+
C: irc://irc.oftc.net/asahi-dev
7890+
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
7891+
F: Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
7892+
F: Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml
7893+
F: Documentation/devicetree/bindings/display/panel/apple,summit.yaml
7894+
F: drivers/gpu/drm/adp/
7895+
F: drivers/gpu/drm/panel/panel-summit.c
7896+
78797897
DRM DRIVERS FOR RENESAS R-CAR
78807898
M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
78817899
M: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

drivers/gpu/drm/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,8 @@ source "drivers/gpu/drm/mcde/Kconfig"
443443

444444
source "drivers/gpu/drm/tidss/Kconfig"
445445

446+
source "drivers/gpu/drm/adp/Kconfig"
447+
446448
source "drivers/gpu/drm/xlnx/Kconfig"
447449

448450
source "drivers/gpu/drm/gud/Kconfig"

drivers/gpu/drm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ obj-y += mxsfb/
208208
obj-y += tiny/
209209
obj-$(CONFIG_DRM_PL111) += pl111/
210210
obj-$(CONFIG_DRM_TVE200) += tve200/
211+
obj-$(CONFIG_DRM_ADP) += adp/
211212
obj-$(CONFIG_DRM_XEN) += xen/
212213
obj-$(CONFIG_DRM_VBOXVIDEO) += vboxvideo/
213214
obj-$(CONFIG_DRM_LIMA) += lima/

drivers/gpu/drm/adp/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR MIT
2+
config DRM_ADP
3+
tristate "DRM Support for pre-DCP Apple display controllers"
4+
depends on DRM && OF && ARM64
5+
depends on ARCH_APPLE || COMPILE_TEST
6+
select DRM_KMS_HELPER
7+
select DRM_BRIDGE_CONNECTOR
8+
select DRM_DISPLAY_HELPER
9+
select DRM_KMS_DMA_HELPER
10+
select DRM_GEM_DMA_HELPER
11+
select DRM_PANEL_BRIDGE
12+
select VIDEOMODE_HELPERS
13+
select DRM_MIPI_DSI
14+
help
15+
Chose this option if you have an Apple Arm laptop with a touchbar.
16+
17+
If M is selected, this module will be called adpdrm.

drivers/gpu/drm/adp/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR MIT
2+
3+
adpdrm-y := adp_drv.o
4+
adpdrm-mipi-y := adp-mipi.o
5+
obj-$(CONFIG_DRM_ADP) += adpdrm.o adpdrm-mipi.o

0 commit comments

Comments
 (0)