Use upstream version of 4010

This commit is contained in:
Aditya Garg
2022-02-02 17:41:17 +05:30
parent 3b5cdcd202
commit 212eceae7d
2 changed files with 25 additions and 38 deletions
@@ -1,24 +1,17 @@
From 57ed05689d88d3e1e03d32daba7778f4cd179cba Mon Sep 17 00:00:00 2001
From: Aditya Garg <gargaditya08@live.com>
Date: Wed, 15 Dec 2021 18:22:16 +0530
Subject: [PATCH 10/10] HID: apple: Add ability to use numbers as function keys on T2
Macs
Some T2 Macs don't have their touchbar working properly on linux.
Thus we add an ability to use numbers as function keys instead.
We also ensure that the apple_fn_keys table is used instead of
powerbook_fn_keys on T2 Macs, which was being used earlier.
This patch adds the Fn mapping for keyboards on certain T2 Macs.
Signed-off-by: Aditya Garg <gargaditya08@live.com>
---
drivers/hid/hid-apple.c | 70 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
drivers/hid/hid-apple.c | 64 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 63 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index 2c9c5faa7..a1c2f1ee3 100644
index b6e1a29a2..70e9f6f74 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -91,6 +91,51 @@ static const struct apple_key_translation macbookair_fn_keys[] = {
@@ -113,6 +113,51 @@ static const struct apple_key_translation macbookair_fn_keys[] = {
{ }
};
@@ -70,33 +63,27 @@ index 2c9c5faa7..a1c2f1ee3 100644
static const struct apple_key_translation apple_fn_keys[] = {
{ KEY_BACKSPACE, KEY_DELETE },
{ KEY_ENTER, KEY_INSERT },
@@ -217,6 +262,25 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
@@ -236,7 +281,18 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
}
if (fnmode) {
- if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
+ if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132 ||
+ hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680 ||
+ hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213)
+ table = macbookpro_no_esc_fn_keys;
+ else if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K ||
+ hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223 ||
+ hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F)
+ table = macbookpro_dedicated_esc_fn_keys;
+ else if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K ||
+ hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K)
+ table = apple_fn_keys;
+ else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
table = macbookair_fn_keys;
+ else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K &&
+ hid->product <= USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F) {
+ switch (hid->product) {
+ /* MacBook Pros with esc on the touchbar */
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132:
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680:
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213:
+ table = macbookpro_no_esc_fn_keys;
+ break;
+ /* MacBook Pros with a dedicated esc key */
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K:
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223:
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F:
+ table = macbookpro_dedicated_esc_fn_keys;
+ break;
+ default:
+ table = apple_fn_keys;
+ }
+ }
else if (hid->product < 0x21d || hid->product >= 0x300)
table = powerbook_fn_keys;
else
@@ -364,6 +428,12 @@ static void apple_setup_input(struct input_dev *input)
@@ -386,6 +442,12 @@ static void apple_setup_input(struct input_dev *input)
set_bit(KEY_NUMLOCK, input->keybit);
/* Enable all needed keys */
+2 -2
View File
@@ -6,7 +6,7 @@
pkgbase=linux-t2
pkgver=5.16.5
_srcname=linux-${pkgver}
pkgrel=2
pkgrel=3
pkgdesc='Linux kernel for T2 Macs'
_srctag=v${pkgver%.*}-${pkgver##*.}
url="https://git.archlinux.org/linux.git/log/?h=v$_srctag"
@@ -316,7 +316,7 @@ sha256sums=('ecaeedd9d289934f97c572aa965b6959d4d47f9789220e4fc3fbb525d8f1c7ab'
'40eff5e88bb30c51c6b97e85c2e7b8dec5f97916f768e6c07618d9c5afe68574'
'cac035fe07663a319185c644c5b39b34bef89ada348881fa4a02d15290260445'
'9dfa9f02d17c5cd9620fa2c1d43ca967b81b6a56d33c2bafae14e0c64e498baa'
'2cfc28a394117184c4fd4c14fd8d1cbf2ed6d2c5ddba93f077cbbc621d73ca81'
'a0a190edc937e70f48b436b5fa69395f45f6135639438eaea0722e0310ecdc71'
'59426d41ff7414fb28b43307227d1df3906739b8b255063868ebe7f03d5905b5'
'31e65ffa0ec2a998de6a806f931a9ca684a9be5933918a94b0e79ef6456e0821'
'9ede98eceb69e9c93e25fdb2c567466963bdd2f81c0ecb9fb9e5107f6142ff26'