Update patches/asus2.patch

This commit is contained in:
ferreo 2025-01-12 15:27:47 +01:00
parent 9906174cb2
commit 11e8ca2849

View File

@ -1,7 +1,7 @@
From 66a2ab4a176b432d441e7d90d620f6594de89e43 Mon Sep 17 00:00:00 2001 From 318ba1ff9a044051536a4e4938b8e38a6ffe9bac Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Fri, 7 Jun 2024 15:58:01 +1200 Date: Fri, 7 Jun 2024 15:58:01 +1200
Subject: [PATCH 01/27] Input: xpad - add support for ASUS ROG RAIKIRI PRO Subject: [PATCH 01/28] Input: xpad - add support for ASUS ROG RAIKIRI PRO
Add the VID/PID for ASUS ROG RAIKIRI PRO to Add the VID/PID for ASUS ROG RAIKIRI PRO to
xpad_device and the VID to xpad_table. xpad_device and the VID to xpad_table.
@ -27,10 +27,10 @@ index 0f23be98c56e..1b92729bd378 100644
2.47.1 2.47.1
From 65991d72695e279390b0e68af59b852a2b5c6259 Mon Sep 17 00:00:00 2001 From 75ffd91fb4a2da8683a438f0ea23a2fe20dd97ca Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Fri, 24 May 2024 10:54:36 +1200 Date: Fri, 24 May 2024 10:54:36 +1200
Subject: [PATCH 02/27] platform/x86: asus-wmi: don't fail if platform_profile Subject: [PATCH 02/28] platform/x86: asus-wmi: don't fail if platform_profile
already registered already registered
On some newer laptops it appears that an AMD driver can register a On some newer laptops it appears that an AMD driver can register a
@ -64,10 +64,10 @@ index 1101e5b2488e..293ecd228a5a 100644
2.47.1 2.47.1
From 0da9e8de9be25f4e922fb24c44dc280721e42413 Mon Sep 17 00:00:00 2001 From f1d69dd5412a06634a19db8daa0329d9ff585452 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 1 Sep 2024 14:30:37 +1200 Date: Sun, 1 Sep 2024 14:30:37 +1200
Subject: [PATCH 03/27] platform/x86: asus-wmi: Refactor Ally suspend/resume Subject: [PATCH 03/28] platform/x86: asus-wmi: Refactor Ally suspend/resume
The CSEE method from ACPI is now called only on module load. This fixes The CSEE method from ACPI is now called only on module load. This fixes
an issues with USB device loss on Ally 1 after reboot. an issues with USB device loss on Ally 1 after reboot.
@ -255,10 +255,10 @@ index 293ecd228a5a..acd0ec1d9aae 100644
2.47.1 2.47.1
From d15ffbaf86af112d09cc553feed43605387be83d Mon Sep 17 00:00:00 2001 From a1141dd063ffac579de9dce1e33695dc1be6fc57 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 22 Sep 2024 21:40:46 +1200 Date: Sun, 22 Sep 2024 21:40:46 +1200
Subject: [PATCH 04/27] platform/x86: asus-wmi: export symbols used for Subject: [PATCH 04/28] platform/x86: asus-wmi: export symbols used for
read/write WMI read/write WMI
Export some rather helpful read/write WMI symbols using a namespace. Export some rather helpful read/write WMI symbols using a namespace.
@ -366,10 +366,10 @@ index 365e119bebaa..6ea4dedfb85e 100644
2.47.1 2.47.1
From b4c17bb1855a52dda5f324b5a26308adc20a3429 Mon Sep 17 00:00:00 2001 From 7f65084989651f074bb3ff6ad440fd651d4a47bf Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 21 Sep 2024 16:04:58 +1200 Date: Sat, 21 Sep 2024 16:04:58 +1200
Subject: [PATCH 05/27] hid-asus: Add MODULE_IMPORT_NS(ASUS_WMI) Subject: [PATCH 05/28] hid-asus: Add MODULE_IMPORT_NS(ASUS_WMI)
A small change to asus_wmi_evaluate_method() was introduced during A small change to asus_wmi_evaluate_method() was introduced during
asus-armoury driver development to put the exports behind a namespace. asus-armoury driver development to put the exports behind a namespace.
@ -396,10 +396,10 @@ index a4b47319ad8e..9540e3e19cce 100644
2.47.1 2.47.1
From 0a53978ad2c616b7adf33f8f7fdda776a5a0a57c Mon Sep 17 00:00:00 2001 From 755e9eca472fb56ae53c2df8bde024e21ddc991c Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 22 Sep 2024 21:39:43 +1200 Date: Sun, 22 Sep 2024 21:39:43 +1200
Subject: [PATCH 06/27] platform/x86: asus-armoury: move existing tunings to Subject: [PATCH 06/28] platform/x86: asus-armoury: move existing tunings to
asus-armoury module asus-armoury module
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
@ -1249,10 +1249,10 @@ index 6ea4dedfb85e..21313e1eb6c9 100644
2.47.1 2.47.1
From 0f43ec1f59df37f227a9eaac231326e09be4fe3e Mon Sep 17 00:00:00 2001 From 7d28e4b7e77a31accd21c9886cea99af28dd4038 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Thu, 19 Sep 2024 17:23:35 +1200 Date: Thu, 19 Sep 2024 17:23:35 +1200
Subject: [PATCH 07/27] platform/x86: asus-armoury: add panel_hd_mode attribute Subject: [PATCH 07/28] platform/x86: asus-armoury: add panel_hd_mode attribute
Add panel_hd_mode to toggle the panel mode between single and high Add panel_hd_mode to toggle the panel mode between single and high
definition modes. definition modes.
@ -1311,10 +1311,10 @@ index 21313e1eb6c9..a6064995c2cc 100644
2.47.1 2.47.1
From 8066b15e1f48352e674c29927def1c1fa3c5b48d Mon Sep 17 00:00:00 2001 From 9065f2a2b500e211cd0893304b44d2a238e1b971 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Thu, 19 Sep 2024 17:19:37 +1200 Date: Thu, 19 Sep 2024 17:19:37 +1200
Subject: [PATCH 08/27] platform/x86: asus-armoury: add the ppt_* and nv_* Subject: [PATCH 08/28] platform/x86: asus-armoury: add the ppt_* and nv_*
tuning knobs tuning knobs
Adds the ppt_* and nv_* tuning knobs that are available via WMI methods Adds the ppt_* and nv_* tuning knobs that are available via WMI methods
@ -1592,10 +1592,10 @@ index b00d829c9da0..91ec6f4cb149 100644
2.47.1 2.47.1
From cd0478042eb3c5b861ad94b80c93e63f7233f1a7 Mon Sep 17 00:00:00 2001 From 885251ddad44ce0fa49de6b8e6796009df60421f Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 2 Jun 2024 14:32:15 +1200 Date: Sun, 2 Jun 2024 14:32:15 +1200
Subject: [PATCH 09/27] platform/x86: asus-armoury: add dgpu tgp control Subject: [PATCH 09/28] platform/x86: asus-armoury: add dgpu tgp control
Implement the dgpu TGP control under the asus-armoury module using the Implement the dgpu TGP control under the asus-armoury module using the
fw_attributes class. fw_attributes class.
@ -1722,10 +1722,10 @@ index a6064995c2cc..8c755799eb60 100644
2.47.1 2.47.1
From 6e5bc568440a4f46c1f3ad5c658177e5def0c71b Mon Sep 17 00:00:00 2001 From ccea3439731ded372f9b71c3542d5eebc878ce2b Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 2 Jun 2024 14:44:31 +1200 Date: Sun, 2 Jun 2024 14:44:31 +1200
Subject: [PATCH 10/27] platform/x86: asus-armoury: add apu-mem control support Subject: [PATCH 10/28] platform/x86: asus-armoury: add apu-mem control support
Implement the APU memory size control under the asus-armoury module using Implement the APU memory size control under the asus-armoury module using
the fw_attributes class. the fw_attributes class.
@ -1888,10 +1888,10 @@ index 8c755799eb60..88bf250dc8ca 100644
2.47.1 2.47.1
From 700829ff413e3ae984b97e78043abeddf924ebb9 Mon Sep 17 00:00:00 2001 From 1508da1b03bedecbe0a991bece7c1797b14fe055 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Wed, 18 Sep 2024 21:19:12 +1200 Date: Wed, 18 Sep 2024 21:19:12 +1200
Subject: [PATCH 11/27] platform/x86: asus-armoury: add core count control Subject: [PATCH 11/28] platform/x86: asus-armoury: add core count control
Implement Intel core enablement under the asus-armoury module using the Implement Intel core enablement under the asus-armoury module using the
fw_attributes class. fw_attributes class.
@ -2237,10 +2237,10 @@ index 88bf250dc8ca..cc21e4272460 100644
2.47.1 2.47.1
From f199d8a6671304cdad1bc64e8616fa816518e413 Mon Sep 17 00:00:00 2001 From ed252adfb6011ca67f98bd47bb8842a7f2be2ee0 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Mon, 3 Jun 2024 12:04:41 +1200 Date: Mon, 3 Jun 2024 12:04:41 +1200
Subject: [PATCH 12/27] platform/x86: asus-wmi: deprecate bios features Subject: [PATCH 12/28] platform/x86: asus-wmi: deprecate bios features
With the existence of the asus-armoury module the attributes no-longer With the existence of the asus-armoury module the attributes no-longer
need to live under the /sys/devices/platform/asus-nb-wmi/ path. need to live under the /sys/devices/platform/asus-nb-wmi/ path.
@ -2858,10 +2858,10 @@ index 525629097b9f..d4981e08f44f 100644
2.47.1 2.47.1
From 6d1521d36a9e675b28b6810a7472c9592f769718 Mon Sep 17 00:00:00 2001 From c353db0dd524535c9e123529c90e99ed3d25fb49 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Thu, 10 Oct 2024 09:52:45 +1300 Date: Thu, 10 Oct 2024 09:52:45 +1300
Subject: [PATCH 13/27] ALSA: hda/realtek: fixup ASUS GA605W Subject: [PATCH 13/28] ALSA: hda/realtek: fixup ASUS GA605W
The GA605W laptop has almost the exact same codec setup as the GA403 The GA605W laptop has almost the exact same codec setup as the GA403
and so the same quirks apply to it. and so the same quirks apply to it.
@ -2872,10 +2872,10 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
1 file changed, 2 insertions(+) 1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 973671e0cdb0..bfb3e95ccfaf 100644 index 192fc75b51e6..d88fc0ca893d 100644
--- a/sound/pci/hda/patch_realtek.c --- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c
@@ -10603,6 +10603,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = { @@ -10604,6 +10604,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
@ -2888,10 +2888,10 @@ index 973671e0cdb0..bfb3e95ccfaf 100644
2.47.1 2.47.1
From 630e1c62a634a74b68ac1d6bcf8e5bcb5fc1a822 Mon Sep 17 00:00:00 2001 From e44288e88b8fa2f4f2e33522e0b2666b467b31aa Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Mon, 26 Aug 2024 12:49:35 +1200 Date: Mon, 26 Aug 2024 12:49:35 +1200
Subject: [PATCH 14/27] hid-asus-ally: Add joystick LED ring support Subject: [PATCH 14/28] hid-asus-ally: Add joystick LED ring support
Adds basic support for the joystick RGB LED rings as a multicolour LED Adds basic support for the joystick RGB LED rings as a multicolour LED
device with 4 LEDs. device with 4 LEDs.
@ -3672,10 +3672,10 @@ index 9540e3e19cce..7c5269cd4d76 100644
2.47.1 2.47.1
From 38832529751a0d5abaf4464a0117b4fb2899effa Mon Sep 17 00:00:00 2001 From caab298317491b6b6b8a7a9000116e114cd860b6 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Wed, 2 Oct 2024 23:32:46 +1300 Date: Wed, 2 Oct 2024 23:32:46 +1300
Subject: [PATCH 15/27] hid-asus-ally: initial Ally-X gamepad Subject: [PATCH 15/28] hid-asus-ally: initial Ally-X gamepad
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -4159,10 +4159,10 @@ index eb8617c80c2a..458d02996bca 100644
2.47.1 2.47.1
From 104603cbab4cce4ba09d11d3776920a4e6bc716c Mon Sep 17 00:00:00 2001 From 13ccb06fd0af8663cc3d54699fd1caccb983a5a0 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Wed, 2 Oct 2024 23:51:36 +1300 Date: Wed, 2 Oct 2024 23:51:36 +1300
Subject: [PATCH 16/27] hid-asus-ally: initial gamepad configuration Subject: [PATCH 16/28] hid-asus-ally: initial gamepad configuration
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -4571,16 +4571,16 @@ index 458d02996bca..2b298ad4da0e 100644
2.47.1 2.47.1
From 165dc43b72d144782a62290b389fce5819169847 Mon Sep 17 00:00:00 2001 From e55ed327e70cd92738bf5b63efd92bb88f82c7bc Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 14:58:33 +1300 Date: Sat, 5 Oct 2024 14:58:33 +1300
Subject: [PATCH 17/27] hid-asus-ally: add button remap attributes Subject: [PATCH 17/28] hid-asus-ally: add button remap attributes
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
drivers/hid/hid-asus-ally.c | 393 ++++++++++++++++++++++++++++++++++-- drivers/hid/hid-asus-ally.c | 393 ++++++++++++++++++++++++++++++++++--
drivers/hid/hid-asus-ally.h | 197 ++++++++++++++++++ drivers/hid/hid-asus-ally.h | 211 +++++++++++++++++++
2 files changed, 572 insertions(+), 18 deletions(-) 2 files changed, 586 insertions(+), 18 deletions(-)
diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c
index eed1bc84026d..56cc7abc397f 100644 index eed1bc84026d..56cc7abc397f 100644
@ -5049,7 +5049,7 @@ index eed1bc84026d..56cc7abc397f 100644
hid_hw_stop(hdev); hid_hw_stop(hdev);
} }
diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h
index 2b298ad4da0e..127db570a827 100644 index 2b298ad4da0e..f985cbd698c3 100644
--- a/drivers/hid/hid-asus-ally.h --- a/drivers/hid/hid-asus-ally.h
+++ b/drivers/hid/hid-asus-ally.h +++ b/drivers/hid/hid-asus-ally.h
@@ -33,11 +33,155 @@ enum xpad_cmd_len { @@ -33,11 +33,155 @@ enum xpad_cmd_len {
@ -5208,7 +5208,7 @@ index 2b298ad4da0e..127db570a827 100644
#define ALLY_DEVICE_ATTR_WO(_name, _sysfs_name) \ #define ALLY_DEVICE_ATTR_WO(_name, _sysfs_name) \
struct device_attribute dev_attr_##_name = \ struct device_attribute dev_attr_##_name = \
@@ -47,3 +191,56 @@ enum btn_pair_index { @@ -47,3 +191,70 @@ enum btn_pair_index {
#define ALLY_DEVICE_ATTR_RW(_name, _sysfs_name) \ #define ALLY_DEVICE_ATTR_RW(_name, _sysfs_name) \
struct device_attribute dev_attr_##_name = \ struct device_attribute dev_attr_##_name = \
__ATTR(_sysfs_name, 0644, _name##_show, _name##_store) __ATTR(_sysfs_name, 0644, _name##_show, _name##_store)
@ -5257,22 +5257,36 @@ index 2b298ad4da0e..127db570a827 100644
+ .attrs = _fname##_attrs, \ + .attrs = _fname##_attrs, \
+ } + }
+ +
+#define ALLY_BTN_MAPPING(_fname, _mname) \ +#define _ALLY_BTN_REMAP(_fname, _btn_name) \
+ ALLY_BTN_SHOW(btn_mapping_##_fname, _mname, false); \ + ALLY_BTN_SHOW(btn_mapping_##_fname##_remap, _btn_name, false); \
+ ALLY_BTN_STORE(btn_mapping_##_fname, _mname, false); \ + ALLY_BTN_STORE(btn_mapping_##_fname##_remap, _btn_name, false); \
+ ALLY_BTN_SHOW(btn_mapping_##_fname##_macro, _mname, true); \ + ALLY_DEVICE_ATTR_RW(btn_mapping_##_fname##_remap, remap);
+ ALLY_BTN_STORE(btn_mapping_##_fname##_macro, _mname, true); \ +
+ ALLY_DEVICE_ATTR_RW(btn_mapping_##_fname, remap); \ +#define _ALLY_BTN_MACRO(_fname, _btn_name) \
+ ALLY_DEVICE_ATTR_RW(btn_mapping_##_fname##_macro, macro_remap); \ + ALLY_BTN_SHOW(btn_mapping_##_fname##_macro, _btn_name, true); \
+ ALLY_BTN_ATTRS_GROUP(btn_##_fname, btn_mapping_##_fname) + ALLY_BTN_STORE(btn_mapping_##_fname##_macro, _btn_name, true); \
+ ALLY_DEVICE_ATTR_RW(btn_mapping_##_fname##_macro, macro_remap);
+
+#define ALLY_BTN_MAPPING(_fname, _btn_name) \
+ _ALLY_BTN_REMAP(_fname, _btn_name) \
+ _ALLY_BTN_MACRO(_fname, _btn_name) \
+ static struct attribute *_fname##_attrs[] = { \
+ &dev_attr_btn_mapping_##_fname##_remap.attr, \
+ &dev_attr_btn_mapping_##_fname##_macro.attr, \
+ NULL, \
+ }; \
+ static const struct attribute_group btn_mapping_##_fname##_attr_group = { \
+ .name = __stringify(btn_##_fname), \
+ .attrs = _fname##_attrs, \
+ }
-- --
2.47.1 2.47.1
From fd95feedfc41a2aec2ca2dba52fec8254a9bc501 Mon Sep 17 00:00:00 2001 From 3a019f986fbec2ab488303f992fbe40389d26524 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Fri, 25 Oct 2024 08:56:54 +0200 Date: Fri, 25 Oct 2024 08:56:54 +0200
Subject: [PATCH 18/27] hid-asus-ally: add gamepad mode selection Subject: [PATCH 18/28] hid-asus-ally: add gamepad mode selection
--- ---
drivers/hid/hid-asus-ally.c | 73 +++++++++++++++++++++++++++++++++++++ drivers/hid/hid-asus-ally.c | 73 +++++++++++++++++++++++++++++++++++++
@ -5367,7 +5381,7 @@ index 56cc7abc397f..7cecdc10ba2c 100644
NULL NULL
}; };
diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h
index 127db570a827..caec424c52e3 100644 index f985cbd698c3..f7e21be50d8e 100644
--- a/drivers/hid/hid-asus-ally.h --- a/drivers/hid/hid-asus-ally.h
+++ b/drivers/hid/hid-asus-ally.h +++ b/drivers/hid/hid-asus-ally.h
@@ -20,6 +20,7 @@ enum xpad_mode { @@ -20,6 +20,7 @@ enum xpad_mode {
@ -5390,19 +5404,19 @@ index 127db570a827..caec424c52e3 100644
2.47.1 2.47.1
From fc9b88f3382162a9fe6ec9f221ac762b27d548e0 Mon Sep 17 00:00:00 2001 From fe383c22dd2899f08b03f8040af07d2163647c39 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 15:40:09 +1300 Date: Sat, 5 Oct 2024 15:40:09 +1300
Subject: [PATCH 19/27] hid-asus-ally: Turbo settings for buttons Subject: [PATCH 19/28] hid-asus-ally: Turbo settings for buttons
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
drivers/hid/hid-asus-ally.c | 80 ++++++++++++++++++++++++++++--------- drivers/hid/hid-asus-ally.c | 72 +++++++++++++++++++++++++++++--------
drivers/hid/hid-asus-ally.h | 58 ++++++++++++++++++++++++++- drivers/hid/hid-asus-ally.h | 50 ++++++++++++++++++++++++++
2 files changed, 118 insertions(+), 20 deletions(-) 2 files changed, 108 insertions(+), 14 deletions(-)
diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c
index 7cecdc10ba2c..7f0000a2db3c 100644 index 7cecdc10ba2c..b0fcad91f2b7 100644
--- a/drivers/hid/hid-asus-ally.c --- a/drivers/hid/hid-asus-ally.c
+++ b/drivers/hid/hid-asus-ally.c +++ b/drivers/hid/hid-asus-ally.c
@@ -233,6 +233,7 @@ static const char* btn_to_name(u64 key) @@ -233,6 +233,7 @@ static const char* btn_to_name(u64 key)
@ -5470,12 +5484,10 @@ index 7cecdc10ba2c..7f0000a2db3c 100644
if (ret < 0) if (ret < 0)
return ret; return ret;
@@ -581,24 +625,24 @@ static ssize_t gamepad_apply_all_store(struct device *dev, struct device_attribu @@ -583,22 +627,22 @@ ALLY_DEVICE_ATTR_WO(gamepad_apply_all, apply_all);
ALLY_DEVICE_ATTR_WO(gamepad_apply_all, apply_all);
/* button map attributes, regular and macro*/ /* button map attributes, regular and macro*/
-ALLY_BTN_MAPPING(m1, btn_m1); ALLY_BTN_MAPPING(m1, btn_m1);
-ALLY_BTN_MAPPING(m2, btn_m2); ALLY_BTN_MAPPING(m2, btn_m2);
-ALLY_BTN_MAPPING(a, btn_a); -ALLY_BTN_MAPPING(a, btn_a);
-ALLY_BTN_MAPPING(b, btn_b); -ALLY_BTN_MAPPING(b, btn_b);
-ALLY_BTN_MAPPING(x, btn_x); -ALLY_BTN_MAPPING(x, btn_x);
@ -5490,31 +5502,27 @@ index 7cecdc10ba2c..7f0000a2db3c 100644
-ALLY_BTN_MAPPING(dpad_d, dpad_down); -ALLY_BTN_MAPPING(dpad_d, dpad_down);
-ALLY_BTN_MAPPING(dpad_l, dpad_left); -ALLY_BTN_MAPPING(dpad_l, dpad_left);
-ALLY_BTN_MAPPING(dpad_r, dpad_right); -ALLY_BTN_MAPPING(dpad_r, dpad_right);
-ALLY_BTN_MAPPING(view, btn_view); ALLY_BTN_MAPPING(view, btn_view);
-ALLY_BTN_MAPPING(menu, btn_menu); ALLY_BTN_MAPPING(menu, btn_menu);
+ALLY_BTN_MAPPING_NO_TURBO(m1, btn_m1); +ALLY_TURBO_BTN_MAPPING(a, btn_a);
+ALLY_BTN_MAPPING_NO_TURBO(m2, btn_m2); +ALLY_TURBO_BTN_MAPPING(b, btn_b);
+ALLY_BTN_MAPPING_NO_TURBO(view, btn_view); +ALLY_TURBO_BTN_MAPPING(x, btn_x);
+ALLY_BTN_MAPPING_NO_TURBO(menu, btn_menu); +ALLY_TURBO_BTN_MAPPING(y, btn_y);
+ALLY_BTN_MAPPING_WITH_TURBO(a, btn_a); +ALLY_TURBO_BTN_MAPPING(lb, btn_lb);
+ALLY_BTN_MAPPING_WITH_TURBO(b, btn_b); +ALLY_TURBO_BTN_MAPPING(rb, btn_rb);
+ALLY_BTN_MAPPING_WITH_TURBO(x, btn_x); +ALLY_TURBO_BTN_MAPPING(ls, btn_ls);
+ALLY_BTN_MAPPING_WITH_TURBO(y, btn_y); +ALLY_TURBO_BTN_MAPPING(rs, btn_rs);
+ALLY_BTN_MAPPING_WITH_TURBO(lb, btn_lb); +ALLY_TURBO_BTN_MAPPING(lt, btn_lt);
+ALLY_BTN_MAPPING_WITH_TURBO(rb, btn_rb); +ALLY_TURBO_BTN_MAPPING(rt, btn_rt);
+ALLY_BTN_MAPPING_WITH_TURBO(ls, btn_ls); +ALLY_TURBO_BTN_MAPPING(dpad_u, dpad_up);
+ALLY_BTN_MAPPING_WITH_TURBO(rs, btn_rs); +ALLY_TURBO_BTN_MAPPING(dpad_d, dpad_down);
+ALLY_BTN_MAPPING_WITH_TURBO(lt, btn_lt); +ALLY_TURBO_BTN_MAPPING(dpad_l, dpad_left);
+ALLY_BTN_MAPPING_WITH_TURBO(rt, btn_rt); +ALLY_TURBO_BTN_MAPPING(dpad_r, dpad_right);
+ALLY_BTN_MAPPING_WITH_TURBO(dpad_u, dpad_up);
+ALLY_BTN_MAPPING_WITH_TURBO(dpad_d, dpad_down);
+ALLY_BTN_MAPPING_WITH_TURBO(dpad_l, dpad_left);
+ALLY_BTN_MAPPING_WITH_TURBO(dpad_r, dpad_right);
static void _gamepad_set_xpad_default(struct ally_gamepad_cfg *ally_cfg) static void _gamepad_set_xpad_default(struct ally_gamepad_cfg *ally_cfg)
{ {
diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h
index caec424c52e3..4e60e4c8f6d9 100644 index f7e21be50d8e..63a3b5caa71c 100644
--- a/drivers/hid/hid-asus-ally.h --- a/drivers/hid/hid-asus-ally.h
+++ b/drivers/hid/hid-asus-ally.h +++ b/drivers/hid/hid-asus-ally.h
@@ -24,6 +24,7 @@ enum xpad_cmd { @@ -24,6 +24,7 @@ enum xpad_cmd {
@ -5571,49 +5579,35 @@ index caec424c52e3..4e60e4c8f6d9 100644
#define ALLY_BTN_ATTRS_GROUP(_name, _fname) \ #define ALLY_BTN_ATTRS_GROUP(_name, _fname) \
static struct attribute *_fname##_attrs[] = { \ static struct attribute *_fname##_attrs[] = { \
&dev_attr_##_fname.attr, \ &dev_attr_##_fname.attr, \
@@ -238,11 +271,32 @@ enum btn_pair_index { @@ -260,3 +293,20 @@ enum btn_pair_index {
.attrs = _fname##_attrs, \ .name = __stringify(btn_##_fname), \
.attrs = _fname##_attrs, \
} }
+
-#define ALLY_BTN_MAPPING(_fname, _mname) \ +#define ALLY_TURBO_BTN_MAPPING(_fname, _btn_name) \
+#define ALLY_BTN_ATTRS_GROUP_WITH_TURBO(_name, _fname) \ + _ALLY_BTN_REMAP(_fname, _btn_name) \
+ static struct attribute *_fname##_attrs[] = { \ + _ALLY_BTN_MACRO(_fname, _btn_name) \
+ &dev_attr_##_fname.attr, \ + ALLY_TURBO_SHOW(btn_mapping_##_fname##_turbo, _btn_name); \
+ &dev_attr_##_fname##_macro.attr, \ + ALLY_TURBO_STORE(btn_mapping_##_fname##_turbo, _btn_name); \
+ &dev_attr_##_fname##_turbo.attr, \ + ALLY_DEVICE_ATTR_RW(btn_mapping_##_fname##_turbo, turbo); \
+ }; \ + static struct attribute *_fname##_turbo_attrs[] = { \
+ static const struct attribute_group _fname##_attr_group = { \ + &dev_attr_btn_mapping_##_fname##_remap.attr, \
+ .name = __stringify(_name), \ + &dev_attr_btn_mapping_##_fname##_macro.attr, \
+ .attrs = _fname##_attrs, \ + &dev_attr_btn_mapping_##_fname##_turbo.attr, \
+ NULL, \
+ }; \
+ static const struct attribute_group btn_mapping_##_fname##_attr_group = { \
+ .name = __stringify(btn_##_fname), \
+ .attrs = _fname##_turbo_attrs, \
+ } + }
+
+#define _ALLY_BTN_MAPPING(_fname, _mname) \
ALLY_BTN_SHOW(btn_mapping_##_fname, _mname, false); \
ALLY_BTN_STORE(btn_mapping_##_fname, _mname, false); \
ALLY_BTN_SHOW(btn_mapping_##_fname##_macro, _mname, true); \
ALLY_BTN_STORE(btn_mapping_##_fname##_macro, _mname, true); \
ALLY_DEVICE_ATTR_RW(btn_mapping_##_fname, remap); \
- ALLY_DEVICE_ATTR_RW(btn_mapping_##_fname##_macro, macro_remap); \
+ ALLY_DEVICE_ATTR_RW(btn_mapping_##_fname##_macro, macro_remap);
+
+#define ALLY_BTN_MAPPING_NO_TURBO(_fname, _mname) \
+ _ALLY_BTN_MAPPING(_fname, _mname) \
ALLY_BTN_ATTRS_GROUP(btn_##_fname, btn_mapping_##_fname)
+
+#define ALLY_BTN_MAPPING_WITH_TURBO(_fname, _mname) \
+ _ALLY_BTN_MAPPING(_fname, _mname) \
+ ALLY_TURBO_SHOW(btn_mapping_##_fname##_turbo, _mname); \
+ ALLY_TURBO_STORE(btn_mapping_##_fname##_turbo, _mname); \
+ ALLY_DEVICE_ATTR_RW(btn_mapping_##_fname##_turbo, turbo); \
+ ALLY_BTN_ATTRS_GROUP_WITH_TURBO(btn_##_fname, btn_mapping_##_fname)
-- --
2.47.1 2.47.1
From dccdc1d80c57aa05d88ab2a06244f7c8ac509e03 Mon Sep 17 00:00:00 2001 From 5dd0a575d36ce31154d93e76193b91cda0888137 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 20:46:00 +1300 Date: Sat, 5 Oct 2024 20:46:00 +1300
Subject: [PATCH 20/27] hid-asus-ally: add vibration intensity settings Subject: [PATCH 20/28] hid-asus-ally: add vibration intensity settings
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -5622,7 +5616,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
2 files changed, 99 insertions(+) 2 files changed, 99 insertions(+)
diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c
index 7f0000a2db3c..cdc45e2c79b4 100644 index b0fcad91f2b7..724bf3e8639a 100644
--- a/drivers/hid/hid-asus-ally.c --- a/drivers/hid/hid-asus-ally.c
+++ b/drivers/hid/hid-asus-ally.c +++ b/drivers/hid/hid-asus-ally.c
@@ -267,6 +267,11 @@ struct ally_gamepad_cfg { @@ -267,6 +267,11 @@ struct ally_gamepad_cfg {
@ -5747,7 +5741,7 @@ index 7f0000a2db3c..cdc45e2c79b4 100644
if (sysfs_create_groups(&hdev->dev.kobj, gamepad_device_attr_groups)) { if (sysfs_create_groups(&hdev->dev.kobj, gamepad_device_attr_groups)) {
err = -ENODEV; err = -ENODEV;
diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h
index 4e60e4c8f6d9..eea4696850fa 100644 index 63a3b5caa71c..6ac79ad3c5f2 100644
--- a/drivers/hid/hid-asus-ally.h --- a/drivers/hid/hid-asus-ally.h
+++ b/drivers/hid/hid-asus-ally.h +++ b/drivers/hid/hid-asus-ally.h
@@ -22,6 +22,7 @@ enum xpad_mode { @@ -22,6 +22,7 @@ enum xpad_mode {
@ -5781,10 +5775,10 @@ index 4e60e4c8f6d9..eea4696850fa 100644
2.47.1 2.47.1
From 9a27e314332661084ebb2ef819bee1d205fe0f3d Mon Sep 17 00:00:00 2001 From b060d13d6fdd1f7bf488d72fa705517fc0fd1545 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 21:32:41 +1300 Date: Sat, 5 Oct 2024 21:32:41 +1300
Subject: [PATCH 21/27] hid-asus-ally: add JS deadzones Subject: [PATCH 21/28] hid-asus-ally: add JS deadzones
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -5793,7 +5787,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
2 files changed, 123 insertions(+) 2 files changed, 123 insertions(+)
diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c
index cdc45e2c79b4..9bb9ac3ce87b 100644 index 724bf3e8639a..a813b2972a66 100644
--- a/drivers/hid/hid-asus-ally.c --- a/drivers/hid/hid-asus-ally.c
+++ b/drivers/hid/hid-asus-ally.c +++ b/drivers/hid/hid-asus-ally.c
@@ -257,6 +257,11 @@ struct btn_mapping { @@ -257,6 +257,11 @@ struct btn_mapping {
@ -5923,7 +5917,7 @@ index cdc45e2c79b4..9bb9ac3ce87b 100644
drvdata.gamepad_cfg = ally_cfg; // Must asign before attr group setup drvdata.gamepad_cfg = ally_cfg; // Must asign before attr group setup
if (sysfs_create_groups(&hdev->dev.kobj, gamepad_device_attr_groups)) { if (sysfs_create_groups(&hdev->dev.kobj, gamepad_device_attr_groups)) {
diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h
index eea4696850fa..76ba5fcd593a 100644 index 6ac79ad3c5f2..3dc14a5226f3 100644
--- a/drivers/hid/hid-asus-ally.h --- a/drivers/hid/hid-asus-ally.h
+++ b/drivers/hid/hid-asus-ally.h +++ b/drivers/hid/hid-asus-ally.h
@@ -22,6 +22,7 @@ enum xpad_mode { @@ -22,6 +22,7 @@ enum xpad_mode {
@ -5990,10 +5984,10 @@ index eea4696850fa..76ba5fcd593a 100644
2.47.1 2.47.1
From 1d825d14c04e872369d9418beb2c5c9225f8af4c Mon Sep 17 00:00:00 2001 From 0e1e99bd457064942e9023bb823b56a14892be0f Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 21:37:27 +1300 Date: Sat, 5 Oct 2024 21:37:27 +1300
Subject: [PATCH 22/27] hid-asus-ally: add trigger deadzones Subject: [PATCH 22/28] hid-asus-ally: add trigger deadzones
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -6002,7 +5996,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
2 files changed, 44 insertions(+) 2 files changed, 44 insertions(+)
diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c
index 9bb9ac3ce87b..2e34cb47972e 100644 index a813b2972a66..fc5620e63b06 100644
--- a/drivers/hid/hid-asus-ally.c --- a/drivers/hid/hid-asus-ally.c
+++ b/drivers/hid/hid-asus-ally.c +++ b/drivers/hid/hid-asus-ally.c
@@ -281,6 +281,8 @@ struct ally_gamepad_cfg { @@ -281,6 +281,8 @@ struct ally_gamepad_cfg {
@ -6092,7 +6086,7 @@ index 9bb9ac3ce87b..2e34cb47972e 100644
&btn_mapping_m2_attr_group, &btn_mapping_m2_attr_group,
&btn_mapping_a_attr_group, &btn_mapping_a_attr_group,
diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h
index 76ba5fcd593a..f103b5ecff36 100644 index 3dc14a5226f3..32ed5caa3759 100644
--- a/drivers/hid/hid-asus-ally.h --- a/drivers/hid/hid-asus-ally.h
+++ b/drivers/hid/hid-asus-ally.h +++ b/drivers/hid/hid-asus-ally.h
@@ -23,6 +23,7 @@ enum xpad_cmd { @@ -23,6 +23,7 @@ enum xpad_cmd {
@ -6107,10 +6101,10 @@ index 76ba5fcd593a..f103b5ecff36 100644
2.47.1 2.47.1
From ba3ecac043234bc54f2a2296f1884ae37b3af2cf Mon Sep 17 00:00:00 2001 From e60cb0bb587e7b6c549353000a2fd0eff019aaef Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 6 Oct 2024 19:49:24 +1300 Date: Sun, 6 Oct 2024 19:49:24 +1300
Subject: [PATCH 23/27] hid-asus-ally: add anti-deadzones Subject: [PATCH 23/28] hid-asus-ally: add anti-deadzones
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -6119,7 +6113,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
2 files changed, 112 insertions(+) 2 files changed, 112 insertions(+)
diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c
index 2e34cb47972e..3e4d9b19dc41 100644 index fc5620e63b06..9d8bd0afaa68 100644
--- a/drivers/hid/hid-asus-ally.c --- a/drivers/hid/hid-asus-ally.c
+++ b/drivers/hid/hid-asus-ally.c +++ b/drivers/hid/hid-asus-ally.c
@@ -283,6 +283,9 @@ struct ally_gamepad_cfg { @@ -283,6 +283,9 @@ struct ally_gamepad_cfg {
@ -6269,7 +6263,7 @@ index 2e34cb47972e..3e4d9b19dc41 100644
drvdata.gamepad_cfg = ally_cfg; // Must asign before attr group setup drvdata.gamepad_cfg = ally_cfg; // Must asign before attr group setup
if (sysfs_create_groups(&hdev->dev.kobj, gamepad_device_attr_groups)) { if (sysfs_create_groups(&hdev->dev.kobj, gamepad_device_attr_groups)) {
diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h
index f103b5ecff36..9c13de73749c 100644 index 32ed5caa3759..69f59592dd50 100644
--- a/drivers/hid/hid-asus-ally.h --- a/drivers/hid/hid-asus-ally.h
+++ b/drivers/hid/hid-asus-ally.h +++ b/drivers/hid/hid-asus-ally.h
@@ -28,6 +28,7 @@ enum xpad_cmd { @@ -28,6 +28,7 @@ enum xpad_cmd {
@ -6292,10 +6286,10 @@ index f103b5ecff36..9c13de73749c 100644
2.47.1 2.47.1
From 104a4ed73a1e93728a31776c56c5cc6108347068 Mon Sep 17 00:00:00 2001 From f3d319113cf5e4b203476d329b6a1d30a555752f Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 6 Oct 2024 21:22:40 +1300 Date: Sun, 6 Oct 2024 21:22:40 +1300
Subject: [PATCH 24/27] hid-asus-ally: add JS response curves Subject: [PATCH 24/28] hid-asus-ally: add JS response curves
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -6304,7 +6298,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
2 files changed, 141 insertions(+) 2 files changed, 141 insertions(+)
diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c
index 3e4d9b19dc41..4d9954362625 100644 index 9d8bd0afaa68..9f9a7516b774 100644
--- a/drivers/hid/hid-asus-ally.c --- a/drivers/hid/hid-asus-ally.c
+++ b/drivers/hid/hid-asus-ally.c +++ b/drivers/hid/hid-asus-ally.c
@@ -5,8 +5,10 @@ @@ -5,8 +5,10 @@
@ -6466,7 +6460,7 @@ index 3e4d9b19dc41..4d9954362625 100644
drvdata.gamepad_cfg = ally_cfg; // Must asign before attr group setup drvdata.gamepad_cfg = ally_cfg; // Must asign before attr group setup
if (sysfs_create_groups(&hdev->dev.kobj, gamepad_device_attr_groups)) { if (sysfs_create_groups(&hdev->dev.kobj, gamepad_device_attr_groups)) {
diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h diff --git a/drivers/hid/hid-asus-ally.h b/drivers/hid/hid-asus-ally.h
index 9c13de73749c..518d8db3af5e 100644 index 69f59592dd50..c83817589082 100644
--- a/drivers/hid/hid-asus-ally.h --- a/drivers/hid/hid-asus-ally.h
+++ b/drivers/hid/hid-asus-ally.h +++ b/drivers/hid/hid-asus-ally.h
@@ -28,6 +28,7 @@ enum xpad_cmd { @@ -28,6 +28,7 @@ enum xpad_cmd {
@ -6532,10 +6526,10 @@ index 9c13de73749c..518d8db3af5e 100644
2.47.1 2.47.1
From dfd576d639ef514857a6672615d83ad89a70dbf4 Mon Sep 17 00:00:00 2001 From e63cb120c18461beca50d4890fd92141a7b6f001 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Thu, 10 Oct 2024 11:15:36 +1300 Date: Thu, 10 Oct 2024 11:15:36 +1300
Subject: [PATCH 25/27] hid-asus-ally: add calibrations (wip) Subject: [PATCH 25/28] hid-asus-ally: add calibrations (wip)
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -6543,7 +6537,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
1 file changed, 95 insertions(+) 1 file changed, 95 insertions(+)
diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c
index 4d9954362625..03603695c484 100644 index 9f9a7516b774..5a8458e232d3 100644
--- a/drivers/hid/hid-asus-ally.c --- a/drivers/hid/hid-asus-ally.c
+++ b/drivers/hid/hid-asus-ally.c +++ b/drivers/hid/hid-asus-ally.c
@@ -275,6 +275,28 @@ struct response_curve { @@ -275,6 +275,28 @@ struct response_curve {
@ -6680,10 +6674,10 @@ index 4d9954362625..03603695c484 100644
2.47.1 2.47.1
From 61a794cdbe346387f73238f62ebdc6e778cd44dd Mon Sep 17 00:00:00 2001 From a112e37e12870d8ca40da77d24e4e4de056e9d11 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Wed, 6 Nov 2024 00:27:03 +0300 Date: Wed, 6 Nov 2024 00:27:03 +0300
Subject: [PATCH 26/27] debug by default Subject: [PATCH 26/28] debug by default
--- ---
drivers/hid/hid-asus-ally.c | 2 ++ drivers/hid/hid-asus-ally.c | 2 ++
@ -6691,7 +6685,7 @@ Subject: [PATCH 26/27] debug by default
2 files changed, 4 insertions(+) 2 files changed, 4 insertions(+)
diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c diff --git a/drivers/hid/hid-asus-ally.c b/drivers/hid/hid-asus-ally.c
index 03603695c484..d2fbb08babdb 100644 index 5a8458e232d3..d59316001f50 100644
--- a/drivers/hid/hid-asus-ally.c --- a/drivers/hid/hid-asus-ally.c
+++ b/drivers/hid/hid-asus-ally.c +++ b/drivers/hid/hid-asus-ally.c
@@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
@ -6720,10 +6714,10 @@ index 69e79446c411..fb4ae804521d 100644
2.47.1 2.47.1
From ddf01b6d179acae59c0eff5a23823b0723681d07 Mon Sep 17 00:00:00 2001 From de3341e021d14f75ae701dc6463036ef84e37024 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Tue, 17 Dec 2024 09:31:08 +1300 Date: Tue, 17 Dec 2024 09:31:08 +1300
Subject: [PATCH 27/27] Tmp: add GA605W & H7606W to AMD-PMF quirks. Subject: [PATCH 27/28] Tmp: add GA605W & H7606W to AMD-PMF quirks.
This will not be submitted upstream as the entire This will not be submitted upstream as the entire
quirk system is being removed in 6.14 kernel. quirk system is being removed in 6.14 kernel.
@ -6763,3 +6757,81 @@ index 7cde5733b9ca..02b9d0b49092 100644
-- --
2.47.1 2.47.1
From 66a01bb83e65e9b78731507954eed6e2a7f3b767 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev>
Date: Mon, 6 Jan 2025 11:22:43 +1300
Subject: [PATCH 28/28] hid-asus: Disable OOBE mode on the ProArt P16
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
drivers/hid/hid-asus.c | 29 ++++++++++++++++++++++
include/linux/platform_data/x86/asus-wmi.h | 5 ++++
2 files changed, 34 insertions(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 7c5269cd4d76..c077d8817004 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -437,6 +437,26 @@ static int asus_kbd_get_functions(struct hid_device *hdev,
return ret;
}
+static int asus_kbd_disable_oobe(struct hid_device *hdev)
+{
+ const u8 init[][6] = {
+ // Use size of largest array for array dimension
+ { FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 },
+ { FEATURE_KBD_REPORT_ID, 0xBA, 0xC5, 0xC4 },
+ { FEATURE_KBD_REPORT_ID, 0xD0, 0x8F, 0x01 },
+ { FEATURE_KBD_REPORT_ID, 0xD0, 0x85, 0xFF }
+ };
+ int ret;
+
+ for (size_t i = 0; i < ARRAY_SIZE(init); i++) {
+ ret = asus_kbd_set_report(hdev, init[i], sizeof(init[i]));
+ if (ret < 0)
+ return ret;
+ }
+
+ return 0;
+}
+
static void asus_schedule_work(struct asus_kbd_leds *led)
{
unsigned long flags;
@@ -539,6 +559,15 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID2);
if (ret < 0)
return ret;
+
+ if (dmi_match(DMI_PRODUCT_FAMILY, "ProArt P16")) {
+ hid_info(hdev, "Laptop requires disabling the OOBE mode for LED use");
+ ret = asus_kbd_disable_oobe(hdev);
+ if (ret < 0)
+ return ret;
+ else
+ hid_info(hdev, "Disabled OOBE mode");
+ }
} else {
/* Initialize keyboard */
ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index cc21e4272460..c427b6c20d3f 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -206,6 +206,11 @@ static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Flow"),
},
},
+ {
+ .matches = {
+ DMI_MATCH(DMI_PRODUCT_FAMILY, "ProArt P16"),
+ },
+ },
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GA403U"),
--
2.47.1