1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-26 21:09:42 +01:00

onenetbook/4: update stylus patch for 5.12.12

This commit is contained in:
Alexander Sosedkin 2021-06-26 12:05:54 +02:00
parent 9a4e7bdd2a
commit 4f74b8b63a
2 changed files with 39 additions and 13 deletions

View file

@ -0,0 +1,17 @@
--- orig/patch1
+++ updated/patch1
@@ -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)
+@@ -71,6 +74,7 @@
#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_NON_MT_PEN BIT(22)
#define MT_INPUTMODE_TOUCHSCREEN 0x02
#define MT_INPUTMODE_TOUCHPAD 0x03

View file

@ -1,5 +1,25 @@
{ stdenv, lib, kernel, fetchpatch }:
{ stdenv, lib, kernel, fetchpatch, runCommandNoCC, patch }:
let
patch1_original = fetchpatch {
url = "https://marc.info/?l=linux-input&m=161847127221531&q=p3";
name = "goodix-stylus-mastykin-1-pen-support.patch";
sha256 = "sha256-1oc8OvfhScYvtsMeV9A4hU+09i59tEJ6HZS6jspsJR8=";
};
patch1_updated_5_12_12 = runCommandNoCC
"goodix-stylus-mastykin-1-pen-support-5.12.12.patch" {}
''
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;
patch2 = fetchpatch {
url = "https://marc.info/?l=linux-input&m=161847127221531&q=p4";
name = "goodix-stylus-mastykin-2-buttons.patch";
sha256 = "sha256-HxmR8iEgoj4PJopGWJdWsjFxbfISwTMzz+HyG81mRG4=";
};
in
stdenv.mkDerivation rec {
name = "hid-multitouch-onenetbook4-${version}";
version = kernel.version;
@ -8,18 +28,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = kernel.moduleBuildDependencies;
src = ./.;
patches = [
(fetchpatch {
url = "https://marc.info/?l=linux-input&m=161847127221531&q=p3";
name = "goodix-stylus-mastykin-1-pen-support.patch";
sha256 = "sha256-1oc8OvfhScYvtsMeV9A4hU+09i59tEJ6HZS6jspsJR8=";
})
(fetchpatch {
url = "https://marc.info/?l=linux-input&m=161847127221531&q=p4";
name = "goodix-stylus-mastykin-2-buttons.patch";
sha256 = "sha256-HxmR8iEgoj4PJopGWJdWsjFxbfISwTMzz+HyG81mRG4=";
})
];
patches = [ patch1 patch2 ];
postUnpack = ''
tar -C goodix-stylus-mastykin \