Skip to content

Commit 0670c2f

Browse files
kekrbytdz
authored andcommitted
drm/tiny: add driver for Apple Touch Bars in x86 Macs
The Touch Bars found on x86 Macs support two USB configurations: one where the device presents itself as a HID keyboard and can display predefined sets of keys, and one where the operating system has full control over what is displayed. This commit adds support for the display functionality of the second configuration. Functionality for the first configuration has been merged in the HID tree. Note that this driver has only been tested on T2 Macs, and only includes the USB device ID for these devices. Testing on T1 Macs would be appreciated. Credit goes to Ben (Bingxing) Wang on GitHub for reverse engineering most of the protocol. Also, as requested by Andy, I would like to clarify the use of __packed structs in this driver: - All the packed structs are aligned except for appletbdrm_msg_information. - We have to pack appletbdrm_msg_information since it is requirement of the protocol. - We compared binaries compiled by keeping the rest structs __packed and not __packed using bloat-o-meter, and __packed was not affecting code generation. - To maintain consistency, rest structs have been kept __packed. I would also like to point out that since the driver was reverse-engineered the actual data types of the protocol might be different, including, but not limited to, endianness. Link: https://github.com/imbushuo/DFRDisplayKm Signed-off-by: Kerem Karabay <[email protected]> Co-developed-by: Atharva Tiwari <[email protected]> Signed-off-by: Atharva Tiwari <[email protected]> Co-developed-by: Aditya Garg <[email protected]> Signed-off-by: Aditya Garg <[email protected]> Signed-off-by: Aun-Ali Zaidi <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c904370 commit 0670c2f

File tree

4 files changed

+862
-0
lines changed

4 files changed

+862
-0
lines changed

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7149,6 +7149,14 @@ S: Supported
71497149
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
71507150
F: drivers/gpu/drm/sun4i/sun8i*
71517151

7152+
DRM DRIVER FOR APPLE TOUCH BARS
7153+
M: Aun-Ali Zaidi <[email protected]>
7154+
M: Aditya Garg <[email protected]>
7155+
7156+
S: Maintained
7157+
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
7158+
F: drivers/gpu/drm/tiny/appletbdrm.c
7159+
71527160
DRM DRIVER FOR ARM PL111 CLCD
71537161
M: Linus Walleij <[email protected]>
71547162
S: Maintained

drivers/gpu/drm/tiny/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

3+
config DRM_APPLETBDRM
4+
tristate "DRM support for Apple Touch Bars"
5+
depends on DRM && USB && MMU
6+
select DRM_GEM_SHMEM_HELPER
7+
select DRM_KMS_HELPER
8+
help
9+
Say Y here if you want support for the display of Touch Bars on x86
10+
MacBook Pros.
11+
12+
To compile this driver as a module, choose M here: the
13+
module will be called appletbdrm.
14+
315
config DRM_ARCPGU
416
tristate "ARC PGU"
517
depends on DRM && OF

drivers/gpu/drm/tiny/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

3+
obj-$(CONFIG_DRM_APPLETBDRM) += appletbdrm.o
34
obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
45
obj-$(CONFIG_DRM_BOCHS) += bochs.o
56
obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus-qemu.o

0 commit comments

Comments
 (0)