From bde6ca292c29ad3fa41ecbd052403f0663d41dc1 Mon Sep 17 00:00:00 2001 From: Alexander Sosedkin Date: Sun, 19 Mar 2023 00:10:04 +0100 Subject: [PATCH] onenetbook/4: update stylus patch for 6.1 --- .../4/goodix-stylus-mastykin/6.1.patch.patch | 18 ++++++++++++++++++ .../4/goodix-stylus-mastykin/default.nix | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 onenetbook/4/goodix-stylus-mastykin/6.1.patch.patch diff --git a/onenetbook/4/goodix-stylus-mastykin/6.1.patch.patch b/onenetbook/4/goodix-stylus-mastykin/6.1.patch.patch new file mode 100644 index 0000000..643b727 --- /dev/null +++ b/onenetbook/4/goodix-stylus-mastykin/6.1.patch.patch @@ -0,0 +1,18 @@ +--- orig/patch1 2023-03-19 00:07:17.419793837 +0100 ++++ updated/patch1 2023-03-19 00:08:09.493618699 +0100 +@@ -10,11 +10,11 @@ + /* quirks to control the device */ + #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) ++@@ -72,6 +75,7 @@ + #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 diff --git a/onenetbook/4/goodix-stylus-mastykin/default.nix b/onenetbook/4/goodix-stylus-mastykin/default.nix index 2329073..3a6c0e0 100644 --- a/onenetbook/4/goodix-stylus-mastykin/default.nix +++ b/onenetbook/4/goodix-stylus-mastykin/default.nix @@ -12,8 +12,18 @@ let cat ${patch1_original} > $out ${patch}/bin/patch $out < ${./5.12.12.patch.patch} ''; - patch1 = if (lib.versionAtLeast kernel.version "5.12.12") then - patch1_updated_5_12_12 else patch1_original; + patch1_updated_6_1 = runCommand + "goodix-stylus-mastykin-1-pen-support-6.1.patch" {} + '' + cat ${patch1_original} > $out + ${patch}/bin/patch $out < ${./6.1.patch.patch} + ''; + patch1 = + 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 + else patch1_original; patch2 = fetchpatch { url = "https://marc.info/?l=linux-input&m=161847127221531&q=p4"; name = "goodix-stylus-mastykin-2-buttons.patch";