Merge #583
583: OneNetbook 4 updates r=Mic92 a=t184256 Co-authored-by: Alexander Sosedkin <monk@unboiled.info>
This commit is contained in:
commit
a4bc667096
|
@ -1,9 +1,5 @@
|
||||||
{ pkgs, config, lib, ... }:
|
{ pkgs, config, lib, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
iio-sensor-proxy-supports-rotation =
|
|
||||||
lib.versionAtLeast pkgs.iio-sensor-proxy.version "3.0";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../common/cpu/intel
|
../../common/cpu/intel
|
||||||
|
@ -24,29 +20,11 @@ in
|
||||||
];
|
];
|
||||||
|
|
||||||
# OneNetbook 4 has an accelerometer,
|
# OneNetbook 4 has an accelerometer,
|
||||||
hardware.sensor.iio.enable = lib.mkDefault iio-sensor-proxy-supports-rotation;
|
hardware.sensor.iio.enable = true;
|
||||||
# said accelerometer needs rotation, rotation needs iio-sensor-proxy >= 3.0
|
# said accelerometer needs rotation, rotation needs iio-sensor-proxy >= 3.0
|
||||||
services.udev.extraHwdb = lib.mkIf iio-sensor-proxy-supports-rotation ''
|
services.udev.extraHwdb = ''
|
||||||
acpi:BOSC0200:BOSC0200:*
|
acpi:BOSC0200:BOSC0200:*
|
||||||
ACCEL_MOUNT_MATRIX=0, 1, 0; 0, 0, 1; 1, 0, 0
|
ACCEL_MOUNT_MATRIX=0, 1, 0; 0, 0, 1; 1, 0, 0
|
||||||
'';
|
'';
|
||||||
# (this at least gets normal/left-up/right-up/bottom-up right)
|
# (this at least gets normal/left-up/right-up/bottom-up right)
|
||||||
# Until https://github.com/NixOS/nixpkgs/pull/125989 reaches you, you can use
|
|
||||||
#nixpkgs.overlays = [
|
|
||||||
# (self: super: {
|
|
||||||
# iio-sensor-proxy =
|
|
||||||
# if (lib.versionOlder super.iio-sensor-proxy.version "3.0") then
|
|
||||||
# (super.iio-sensor-proxy.overrideAttrs (oa: rec {
|
|
||||||
# version = "3.0";
|
|
||||||
# src = pkgs.fetchFromGitLab {
|
|
||||||
# domain = "gitlab.freedesktop.org";
|
|
||||||
# owner = "hadess";
|
|
||||||
# repo = "iio-sensor-proxy";
|
|
||||||
# rev = version;
|
|
||||||
# sha256 = "0ngbz1vkbjci3ml6p47jh6c6caipvbkm8mxrc8ayr6vc2p9l1g49";
|
|
||||||
# };
|
|
||||||
# }))
|
|
||||||
# else super.iio-sensor-proxy;
|
|
||||||
# })
|
|
||||||
#];
|
|
||||||
}
|
}
|
||||||
|
|
18
onenetbook/4/goodix-stylus-mastykin/6.1.patch.patch
Normal file
18
onenetbook/4/goodix-stylus-mastykin/6.1.patch.patch
Normal file
|
@ -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
|
|
@ -12,8 +12,18 @@ let
|
||||||
cat ${patch1_original} > $out
|
cat ${patch1_original} > $out
|
||||||
${patch}/bin/patch $out < ${./5.12.12.patch.patch}
|
${patch}/bin/patch $out < ${./5.12.12.patch.patch}
|
||||||
'';
|
'';
|
||||||
patch1 = if (lib.versionAtLeast kernel.version "5.12.12") then
|
patch1_updated_6_1 = runCommand
|
||||||
patch1_updated_5_12_12 else patch1_original;
|
"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 {
|
patch2 = fetchpatch {
|
||||||
url = "https://marc.info/?l=linux-input&m=161847127221531&q=p4";
|
url = "https://marc.info/?l=linux-input&m=161847127221531&q=p4";
|
||||||
name = "goodix-stylus-mastykin-2-buttons.patch";
|
name = "goodix-stylus-mastykin-2-buttons.patch";
|
||||||
|
|
Loading…
Reference in a new issue