From de9de98b9e0b044ce1d15d90cad3a20257e557fd Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Wed, 15 Jul 2020 22:16:46 +0200 Subject: [PATCH] Update v4.19 patches Changes: SAM: - Bugfix: Fix HID input for Surface Laptop 3. The driver now separates devices by IID, using the same behavior as on the Surface Book 3. - Bugfix: Minor fixes in SSH driver message system. Links: - kernel: https://github.com/linux-surface/kernel/commit/c5f2f3b76d74898a563d8d27af23dee040aefaa5 - SAM: https://github.com/linux-surface/surface-aggregator-module/commit/99b024313615009b2f940e9d166e78e81ab39704 --- patches/4.19/0005-surface-sam.patch | 76 +++++++++++++++++------------ patches/4.19/0006-suspend.patch | 2 +- patches/4.19/0007-ipts.patch | 2 +- patches/4.19/0008-wifi.patch | 2 +- 4 files changed, 49 insertions(+), 33 deletions(-) diff --git a/patches/4.19/0005-surface-sam.patch b/patches/4.19/0005-surface-sam.patch index ac6a31ea5..fbf67c8eb 100644 --- a/patches/4.19/0005-surface-sam.patch +++ b/patches/4.19/0005-surface-sam.patch @@ -1,4 +1,4 @@ -From b060f8f79b2425879cd27b4cadacea68765e5a82 Mon Sep 17 00:00:00 2001 +From 94e62231d05dc74e0e2cc76d8fbc752a84ff91b1 Mon Sep 17 00:00:00 2001 From: qzed Date: Mon, 26 Aug 2019 01:15:40 +0200 Subject: [PATCH 5/8] surface-sam @@ -14,19 +14,19 @@ Subject: [PATCH 5/8] surface-sam .../x86/surface_sam/surface_sam_hps.c | 1297 +++++ .../x86/surface_sam/surface_sam_san.c | 913 +++ .../x86/surface_sam/surface_sam_san.h | 30 + - .../x86/surface_sam/surface_sam_sid.c | 262 + + .../x86/surface_sam/surface_sam_sid.c | 281 + .../x86/surface_sam/surface_sam_sid_gpelid.c | 232 + .../surface_sam/surface_sam_sid_perfmode.c | 216 + .../x86/surface_sam/surface_sam_sid_power.c | 1154 ++++ .../x86/surface_sam/surface_sam_sid_power.h | 15 + .../x86/surface_sam/surface_sam_sid_vhf.c | 432 ++ .../x86/surface_sam/surface_sam_sid_vhf.h | 13 + - .../x86/surface_sam/surface_sam_ssh.c | 5115 +++++++++++++++++ + .../x86/surface_sam/surface_sam_ssh.c | 5112 +++++++++++++++++ .../x86/surface_sam/surface_sam_ssh.h | 482 ++ .../x86/surface_sam/surface_sam_ssh_trace.h | 536 ++ .../x86/surface_sam/surface_sam_vhf.c | 261 + drivers/tty/serdev/core.c | 110 +- - 22 files changed, 11839 insertions(+), 29 deletions(-) + 22 files changed, 11855 insertions(+), 29 deletions(-) create mode 100644 drivers/platform/x86/surface_sam/Kconfig create mode 100644 drivers/platform/x86/surface_sam/Makefile create mode 100644 drivers/platform/x86/surface_sam/surface_sam_dtx.c @@ -3180,10 +3180,10 @@ index 0000000000000..2b9dee159bbbc +#endif /* _SURFACE_SAM_SAN_H */ diff --git a/drivers/platform/x86/surface_sam/surface_sam_sid.c b/drivers/platform/x86/surface_sam/surface_sam_sid.c new file mode 100644 -index 0000000000000..0dae6569b4265 +index 0000000000000..caa2e6446b5f4 --- /dev/null +++ b/drivers/platform/x86/surface_sam/surface_sam_sid.c -@@ -0,0 +1,262 @@ +@@ -0,0 +1,281 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Surface Integration Driver. @@ -3215,27 +3215,22 @@ index 0000000000000..0dae6569b4265 +}; + + -+static const struct ssam_hid_properties ssam_hid_props_sl3 = { -+ .registry = SSAM_EVENT_REGISTRY_REG, // TODO: needs confirmation -+ .instance = 0, -+}; -+ -+static const struct ssam_hid_properties ssam_hid_props_sb3_keyboard = { ++static const struct ssam_hid_properties ssam_hid_props_keyboard = { + .registry = SSAM_EVENT_REGISTRY_REG, + .instance = 1, +}; + -+static const struct ssam_hid_properties ssam_hid_props_sb3_touchpad = { ++static const struct ssam_hid_properties ssam_hid_props_touchpad = { + .registry = SSAM_EVENT_REGISTRY_REG, + .instance = 3, +}; + -+static const struct ssam_hid_properties ssam_hid_props_sb3_iid5 = { ++static const struct ssam_hid_properties ssam_hid_props_iid5 = { + .registry = SSAM_EVENT_REGISTRY_REG, + .instance = 5, +}; + -+static const struct ssam_hid_properties ssam_hid_props_sb3_iid6 = { ++static const struct ssam_hid_properties ssam_hid_props_iid6 = { + .registry = SSAM_EVENT_REGISTRY_REG, + .instance = 6, +}; @@ -3296,25 +3291,25 @@ index 0000000000000..0dae6569b4265 + { + .name = "surface_sam_sid_vhf", + .id = 1, -+ .platform_data = (void *)&ssam_hid_props_sb3_keyboard, ++ .platform_data = (void *)&ssam_hid_props_keyboard, + .pdata_size = sizeof(struct ssam_hid_properties), + }, + { + .name = "surface_sam_sid_vhf", + .id = 3, -+ .platform_data = (void *)&ssam_hid_props_sb3_touchpad, ++ .platform_data = (void *)&ssam_hid_props_touchpad, + .pdata_size = sizeof(struct ssam_hid_properties), + }, + { + .name = "surface_sam_sid_vhf", + .id = 5, -+ .platform_data = (void *)&ssam_hid_props_sb3_iid5, ++ .platform_data = (void *)&ssam_hid_props_iid5, + .pdata_size = sizeof(struct ssam_hid_properties), + }, + { + .name = "surface_sam_sid_vhf", + .id = 6, -+ .platform_data = (void *)&ssam_hid_props_sb3_iid6, ++ .platform_data = (void *)&ssam_hid_props_iid6, + .pdata_size = sizeof(struct ssam_hid_properties), + }, + { }, @@ -3342,8 +3337,20 @@ index 0000000000000..0dae6569b4265 + }, + { + .name = "surface_sam_sid_vhf", -+ .id = -1, -+ .platform_data = (void *)&ssam_hid_props_sl3, ++ .id = 1, ++ .platform_data = (void *)&ssam_hid_props_keyboard, ++ .pdata_size = sizeof(struct ssam_hid_properties), ++ }, ++ { ++ .name = "surface_sam_sid_vhf", ++ .id = 3, ++ .platform_data = (void *)&ssam_hid_props_touchpad, ++ .pdata_size = sizeof(struct ssam_hid_properties), ++ }, ++ { ++ .name = "surface_sam_sid_vhf", ++ .id = 5, ++ .platform_data = (void *)&ssam_hid_props_iid5, + .pdata_size = sizeof(struct ssam_hid_properties), + }, + { }, @@ -3360,8 +3367,20 @@ index 0000000000000..0dae6569b4265 + }, + { + .name = "surface_sam_sid_vhf", -+ .id = -1, -+ .platform_data = (void *)&ssam_hid_props_sl3, ++ .id = 1, ++ .platform_data = (void *)&ssam_hid_props_keyboard, ++ .pdata_size = sizeof(struct ssam_hid_properties), ++ }, ++ { ++ .name = "surface_sam_sid_vhf", ++ .id = 3, ++ .platform_data = (void *)&ssam_hid_props_touchpad, ++ .pdata_size = sizeof(struct ssam_hid_properties), ++ }, ++ { ++ .name = "surface_sam_sid_vhf", ++ .id = 5, ++ .platform_data = (void *)&ssam_hid_props_iid5, + .pdata_size = sizeof(struct ssam_hid_properties), + }, + { }, @@ -5546,10 +5565,10 @@ index 0000000000000..eb55485ccb119 +#endif /* _SURFACE_SAM_SID_VHF_H */ diff --git a/drivers/platform/x86/surface_sam/surface_sam_ssh.c b/drivers/platform/x86/surface_sam/surface_sam_ssh.c new file mode 100644 -index 0000000000000..ecc49e139eb8e +index 0000000000000..ef1ce8cd7d7f2 --- /dev/null +++ b/drivers/platform/x86/surface_sam/surface_sam_ssh.c -@@ -0,0 +1,5115 @@ +@@ -0,0 +1,5112 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Surface Serial Hub (SSH) driver for communication with the Surface/System @@ -6909,10 +6928,8 @@ index 0000000000000..ecc49e139eb8e + * If we are cancelling or completing this packet, ignore it. + * It's going to be removed from this queue shortly. + */ -+ if (test_bit(SSH_PACKET_SF_LOCKED_BIT, &p->state)) { -+ spin_unlock(&ptl->queue.lock); ++ if (test_bit(SSH_PACKET_SF_LOCKED_BIT, &p->state)) + continue; -+ } + + /* + * Packets should be ordered non-blocking/to-be-resent first. @@ -6920,7 +6937,6 @@ index 0000000000000..ecc49e139eb8e + * process any following packet either and abort. + */ + if (!ssh_ptl_tx_can_process(p)) { -+ spin_unlock(&ptl->queue.lock); + packet = ERR_PTR(-EBUSY); + break; + } @@ -8905,7 +8921,7 @@ index 0000000000000..ecc49e139eb8e + + packet_args.type = SSH_PACKET_TY_BLOCKING; + if (!(flags & SSAM_REQUEST_UNSEQUENCED)) -+ packet_args.type = SSH_PACKET_TY_SEQUENCED; ++ packet_args.type |= SSH_PACKET_TY_SEQUENCED; + + packet_args.priority = SSH_PACKET_PRIORITY(DATA, 0); + packet_args.ops = &ssh_rtl_packet_ops; diff --git a/patches/4.19/0006-suspend.patch b/patches/4.19/0006-suspend.patch index adc6e7fd9..7e981d64d 100644 --- a/patches/4.19/0006-suspend.patch +++ b/patches/4.19/0006-suspend.patch @@ -1,4 +1,4 @@ -From ebd1924d3df86997fb2ddbaf0e883745546b230c Mon Sep 17 00:00:00 2001 +From 045d078505d3bbd4b8632251c718aa4dac59e085 Mon Sep 17 00:00:00 2001 From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com> Date: Sat, 28 Sep 2019 17:48:21 +0200 Subject: [PATCH 6/8] suspend diff --git a/patches/4.19/0007-ipts.patch b/patches/4.19/0007-ipts.patch index 0bac71ab0..44e74ac73 100644 --- a/patches/4.19/0007-ipts.patch +++ b/patches/4.19/0007-ipts.patch @@ -1,4 +1,4 @@ -From c5eaac134e67ec8bebfe7750e90ea68bdb4f3b92 Mon Sep 17 00:00:00 2001 +From 5ab23410ddbe3088444af99d1296a4164365fc70 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 28 Sep 2019 17:58:17 +0200 Subject: [PATCH 7/8] ipts diff --git a/patches/4.19/0008-wifi.patch b/patches/4.19/0008-wifi.patch index 9875e4fe7..07b483a5c 100644 --- a/patches/4.19/0008-wifi.patch +++ b/patches/4.19/0008-wifi.patch @@ -1,4 +1,4 @@ -From d9be3c8242ffa52ae091be0bdac579cf1f8c6f9e Mon Sep 17 00:00:00 2001 +From 1177844a912a96fad44a13c59c36839f8aaa05e1 Mon Sep 17 00:00:00 2001 From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com> Date: Thu, 20 Feb 2020 16:51:11 +0900 Subject: [PATCH 8/8] wifi