]> Git Repo - linux.git/commitdiff
Merge branch 'for-6.5/upstream-fixes' into for-linus
authorBenjamin Tissoires <[email protected]>
Thu, 31 Aug 2023 08:49:57 +0000 (10:49 +0200)
committerBenjamin Tissoires <[email protected]>
Thu, 31 Aug 2023 08:49:57 +0000 (10:49 +0200)
Apple devices fixes by Nimish Gåtam and Nils Tonnaett

1  2 
drivers/hid/hid-input.c

diff --combined drivers/hid/hid-input.c
index 40a5645f8fe8147c583013483d81ba9a4e800b74,96659a7fb4634c2b51e648f8191e234fd0c3b88b..0235cc1690a10993e0bfd0e525ff871223bb8044
@@@ -358,6 -358,9 +358,9 @@@ static const struct hid_device_id hid_b
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
                USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI),
          HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE },
+       { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
+               USB_DEVICE_ID_APPLE_MAGICTRACKPAD),
+         HID_BATTERY_QUIRK_IGNORE },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM,
                USB_DEVICE_ID_ELECOM_BM084),
          HID_BATTERY_QUIRK_IGNORE },
@@@ -988,7 -991,6 +991,7 @@@ static void hidinput_configure_usage(st
                        return;
  
                case 0x3c: /* Invert */
 +                      device->quirks &= ~HID_QUIRK_NOINVERT;
                        map_key_clear(BTN_TOOL_RUBBER);
                        break;
  
                case 0x45: /* ERASER */
                        /*
                         * This event is reported when eraser tip touches the surface.
 -                       * Actual eraser (BTN_TOOL_RUBBER) is set by Invert usage when
 -                       * tool gets in proximity.
 +                       * Actual eraser (BTN_TOOL_RUBBER) is set and released either
 +                       * by Invert if tool reports proximity or by Eraser directly.
                         */
 +                      if (!test_bit(BTN_TOOL_RUBBER, input->keybit)) {
 +                              device->quirks |= HID_QUIRK_NOINVERT;
 +                              set_bit(BTN_TOOL_RUBBER, input->keybit);
 +                      }
                        map_key_clear(BTN_TOUCH);
                        break;
  
@@@ -1585,15 -1583,6 +1588,15 @@@ void hidinput_hid_event(struct hid_devi
                else if (report->tool != BTN_TOOL_RUBBER)
                        /* value is off, tool is not rubber, ignore */
                        return;
 +              else if (*quirks & HID_QUIRK_NOINVERT &&
 +                       !test_bit(BTN_TOUCH, input->key)) {
 +                      /*
 +                       * There is no invert to release the tool, let hid_input
 +                       * send BTN_TOUCH with scancode and release the tool after.
 +                       */
 +                      hid_report_release_tool(report, input, BTN_TOOL_RUBBER);
 +                      return;
 +              }
  
                /* let hid-input set BTN_TOUCH */
                break;
This page took 0.063064 seconds and 4 git commands to generate.