From c2aa5756c0ee18607c38f7db54a424e98618b0b3 Mon Sep 17 00:00:00 2001 From: Alexander Sosedkin Date: Thu, 23 Jan 2025 19:20:48 +0100 Subject: [PATCH] onenetbook/4: update stylus patch for 6.12 --- .../4/goodix-stylus-mastykin/6.12.patch.patch | 27 +++++++++++++++++++ .../4/goodix-stylus-mastykin/default.nix | 10 ++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 onenetbook/4/goodix-stylus-mastykin/6.12.patch.patch diff --git a/onenetbook/4/goodix-stylus-mastykin/6.12.patch.patch b/onenetbook/4/goodix-stylus-mastykin/6.12.patch.patch new file mode 100644 index 00000000..2699e0d2 --- /dev/null +++ b/onenetbook/4/goodix-stylus-mastykin/6.12.patch.patch @@ -0,0 +1,27 @@ +--- orig.patch 2025-01-23 19:34:37.216154507 +0100 ++++ updated-6.12.patch 2025-01-23 19:36:28.316333973 +0100 +@@ -11,10 +11,10 @@ + #define MT_QUIRK_NOT_SEEN_MEANS_UP BIT(0) + #define MT_QUIRK_SLOT_IS_CONTACTID BIT(1) + @@ -70,6 +73,7 @@ +- #define MT_QUIRK_WIN8_PTP_BUTTONS BIT(18) +- #define MT_QUIRK_SEPARATE_APP_REPORT BIT(19) + #define MT_QUIRK_FORCE_MULTI_INPUT BIT(20) +-+#define MT_QUIRK_NON_MT_PEN BIT(21) ++ #define MT_QUIRK_DISABLE_WAKEUP BIT(21) ++ #define MT_QUIRK_ORIENTATION_INVERT BIT(22) +++#define MT_QUIRK_NON_MT_PEN BIT(23) + + #define MT_INPUTMODE_TOUCHSCREEN 0x02 + #define MT_INPUTMODE_TOUCHPAD 0x03 +@@ -41,9 +41,9 @@ + #define MT_CLS_RAZER_BLADE_STEALTH 0x0112 + #define MT_CLS_SMART_TECH 0x0113 + +#define MT_CLS_NON_MT_PEN 0x0114 ++ #define MT_CLS_SIS 0x0457 + + #define MT_DEFAULT_MAXCONTACT 10 +- #define MT_MAX_MAXCONTACT 250 + @@ -374,6 +383,9 @@ + MT_QUIRK_CONTACT_CNT_ACCURATE | + MT_QUIRK_SEPARATE_APP_REPORT, diff --git a/onenetbook/4/goodix-stylus-mastykin/default.nix b/onenetbook/4/goodix-stylus-mastykin/default.nix index 3a6c0e00..14c5e5cd 100644 --- a/onenetbook/4/goodix-stylus-mastykin/default.nix +++ b/onenetbook/4/goodix-stylus-mastykin/default.nix @@ -18,8 +18,16 @@ let cat ${patch1_original} > $out ${patch}/bin/patch $out < ${./6.1.patch.patch} ''; + patch1_updated_6_12 = runCommand + "goodix-stylus-mastykin-1-pen-support-6.12.patch" {} + '' + cat ${patch1_original} > $out + ${patch}/bin/patch $out < ${./6.12.patch.patch} + ''; patch1 = - if (lib.versionAtLeast kernel.version "6.1") then + if (lib.versionAtLeast kernel.version "6.12") then + patch1_updated_6_12 + else if (lib.versionAtLeast kernel.version "6.1") then patch1_updated_6_1 else if (lib.versionAtLeast kernel.version "5.12.12") then patch1_updated_5_12_12