diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 568a149..428b456 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -17,7 +17,8 @@ source=(https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.{xz,sign} '90-linux.hook' # pacman hook for initramfs regeneration 'linux-lts.preset' # standard config files for mkinitcpio ramdisk 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch - 0002-ZEN-Add-CONFIG-for-unprivileged_userns_clone.patch) + 0002-ZEN-Add-CONFIG-for-unprivileged_userns_clone.patch + v2-HID-input-fix-a4tech-horizontal-wheel-custom-usage.4.19.60.patch) validpgpkeys=('ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman (Linux kernel stable release signing key) ) @@ -30,7 +31,8 @@ sha256sums=('0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65' 'bc3dab5594735fb56bdb39c1630a470fd2e65fcf0d81a5db31bab3b91944225d' - '67aed9742e4281df6f0bd18dc936ae79319fee3763737f158c0e87a6948d100d') + '67aed9742e4281df6f0bd18dc936ae79319fee3763737f158c0e87a6948d100d' + '7a7b04aceb74dbc510c62ffac4193fca24890afcfddacd7f44e63b7550da1ac5') _kernelname=${pkgbase#linux} @@ -51,6 +53,8 @@ prepare() { patch -Np1 -i ../0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch patch -Np1 -i ../0002-ZEN-Add-CONFIG-for-unprivileged_userns_clone.patch + patch -Np1 -i ../v2-HID-input-fix-a4tech-horizontal-wheel-custom-usage.4.19.60.patch + cp -Tf ../config .config if [ "${_kernelname}" != "" ]; then diff --git a/trunk/v2-HID-input-fix-a4tech-horizontal-wheel-custom-usage.4.19.60.patch b/trunk/v2-HID-input-fix-a4tech-horizontal-wheel-custom-usage.4.19.60.patch new file mode 100644 index 0000000..e5bc260 --- /dev/null +++ b/trunk/v2-HID-input-fix-a4tech-horizontal-wheel-custom-usage.4.19.60.patch @@ -0,0 +1,68 @@ +diff --git a/drivers/hid/hid-a4tech.c b/drivers/hid/hid-a4tech.c +index 9428ea7cdf8a..c52bd163abb3 100644 +--- a/drivers/hid/hid-a4tech.c ++++ b/drivers/hid/hid-a4tech.c +@@ -26,12 +26,36 @@ + #define A4_2WHEEL_MOUSE_HACK_7 0x01 + #define A4_2WHEEL_MOUSE_HACK_B8 0x02 + ++#define A4_WHEEL_ORIENTATION (HID_UP_GENDESK | 0x000000b8) ++ + struct a4tech_sc { + unsigned long quirks; + unsigned int hw_wheel; + __s32 delayed_value; + }; + ++static int a4_input_mapping(struct hid_device *hdev, struct hid_input *hi, ++ struct hid_field *field, struct hid_usage *usage, ++ unsigned long **bit, int *max) ++{ ++ struct a4tech_sc *a4 = hid_get_drvdata(hdev); ++ ++ if (a4->quirks & A4_2WHEEL_MOUSE_HACK_B8 && ++ usage->hid == A4_WHEEL_ORIENTATION) { ++ /* ++ * We do not want to have this usage mapped to anything as it's ++ * nonstandard and doesn't really behave like an HID report. ++ * It's only selecting the orientation (vertical/horizontal) of ++ * the previous mouse wheel report. The input_events will be ++ * generated once both reports are recorded in a4_event(). ++ */ ++ return -1; ++ } ++ ++ return 0; ++ ++} ++ + static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi, + struct hid_field *field, struct hid_usage *usage, + unsigned long **bit, int *max) +@@ -53,8 +77,7 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field, + struct a4tech_sc *a4 = hid_get_drvdata(hdev); + struct input_dev *input; + +- if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput || +- !usage->type) ++ if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput) + return 0; + + input = field->hidinput->input; +@@ -65,7 +88,7 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field, + return 1; + } + +- if (usage->hid == 0x000100b8) { ++ if (usage->hid == A4_WHEEL_ORIENTATION) { + input_event(input, EV_REL, value ? REL_HWHEEL : + REL_WHEEL, a4->delayed_value); + return 1; +@@ -129,6 +152,7 @@ MODULE_DEVICE_TABLE(hid, a4_devices); + static struct hid_driver a4_driver = { + .name = "a4tech", + .id_table = a4_devices, ++ .input_mapping = a4_input_mapping, + .input_mapped = a4_input_mapped, + .event = a4_event, + .probe = a4_probe,