> On 7 Mar 2025, at 2:02 AM, Grigorii Sokolik <g.sokol99@xxxxxxxxxxxx> wrote: > > Thank you so much. Here is the fix: > > --- > [PATCH] HID: hid-apple: Apple Magic Keyboard a3118 USB-C support > > Add Apple Magic Keyboard with fingerprint 2024 model (with USB-C port) > device ID (0321) to those recognized by the hid-apple driver. Keyboard > is otherwise compatible with the existing implementation for its > earlier 2021 model. > > Signed-off-by: Grigorii Sokolik <g.sokol99@xxxxxxxxxxxx> > --- > drivers/hid/hid-apple.c | 5 +++++ > drivers/hid/hid-ids.h | 1 + > 2 files changed, 6 insertions(+) > > diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c > index d900dd05c..ecdfbda66 100644 > --- a/drivers/hid/hid-apple.c > +++ b/drivers/hid/hid-apple.c > @@ -482,6 +482,7 @@ static int hidinput_apple_event(struct hid_device > *hid, struct input_dev *input, > else if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 || > hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 || > hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 || > + hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2024 || Nit: can we keep all the 2021 and 2024 keyboards seperate? As in the 3 variants of 2021 first then 2024? > hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021) > table = apple2021_fn_keys; I think renaming apple2021_fn_keys to magic_keyboard_2021_and_2024_fn_keys would make more sense. > else if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132 || > @@ -1165,6 +1166,10 @@ static const struct hid_device_id apple_devices[] = { > .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY }, > { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021), > .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, > + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2024), Again, regroup 2021 and 2024 separately. > + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY }, > + { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2024), > + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, > { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021), > .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY }, > { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021), > diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h > index 7e4006249..d59c28495 100644 > --- a/drivers/hid/hid-ids.h > +++ b/drivers/hid/hid-ids.h > @@ -186,6 +186,7 @@ > #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c > #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 0x0320 > #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 0x029a > +#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2024 0x0321 Again, regroup 2021 and 2024 separately. > #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021 0x029f > #define USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT 0x8102 > #define USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY 0x8302 > -- > 2.48.1 > > --- > drivers/hid/hid-apple.c | 5 +++++ > drivers/hid/hid-ids.h | 1 + > 2 files changed, 6 insertions(+) > > diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c > index 3c3f67d0bf..daf4c505e7 100644 > --- a/drivers/hid/hid-apple.c > +++ b/drivers/hid/hid-apple.c > @@ -475,6 +475,7 @@ static int hidinput_apple_event(struct hid_device > *hid, struct input_dev *input, > table = magic_keyboard_2015_fn_keys; > else if (hid->product == > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 || > hid->product == > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 || > + hid->product == > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024_V2 || > hid->product == Why are you sending this again? > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 || > hid->product == > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021) > table = apple2021_fn_keys; > @@ -1155,6 +1156,10 @@ static const struct hid_device_id apple_devices[] = { > .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | > APPLE_RDESC_BATTERY }, > { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024), > .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, > + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024_V2), > + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | > APPLE_RDESC_BATTERY }, > + { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024_V2), > + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, > { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021), > .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | > APPLE_RDESC_BATTERY }, > { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, > USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021), > diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h > index 4f583d6f2e..953850f043 100644 > --- a/drivers/hid/hid-ids.h > +++ b/drivers/hid/hid-ids.h > @@ -185,6 +185,7 @@ > #define USB_DEVICE_ID_APPLE_IRCONTROL5 0x8243 > #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c > #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 0x0320 > +#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024_V2 0x0320 > #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 0x029a > #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021 0x029f > #define USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT 0x8102 > -- > 2.48.1 >> On Thu, Mar 6, 2025 at 9:05 PM Aditya Garg <gargaditya08@xxxxxxxx> wrote: >> >> >> >>>> On 7 Mar 2025, at 12:24 AM, Aditya Garg <gargaditya08@xxxxxxxx> wrote: >>> >>> >>> >>>> On 6 Mar 2025, at 12:30 PM, Grigorii Sokolik <g.sokol99@xxxxxxxxxxxx> wrote: >>>> >>>> Add Apple Magic Keyboard 2024 model (with USB-C port) device ID (0321) >>>> to those recognized by the hid-apple driver. Keyboard is otherwise >>>> compatible with the existing implementation for its earlier 2021 model. >>>> >>>> Signed-off-by: Grigorii Sokolik <g.sokol99@xxxxxxxxxxxx> >>>> --- >>>> drivers/hid/hid-apple.c | 5 +++++ >>>> drivers/hid/hid-ids.h | 1 + >>>> 2 files changed, 6 insertions(+) >>>> >>>> --- a/drivers/hid/hid-ids.h >>>> +++ b/drivers/hid/hid-ids.h >>>> @@ -185,6 +185,7 @@ >>>> #define USB_DEVICE_ID_APPLE_IRCONTROL5 0x8243 >>>> #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c >>>> #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 0x0320 >>>> +#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024_V2 0x0320 >> >> A3118 is the one with Touch ID. Name should be USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2024 to be more clear. >>> >>> It’s the same ID as USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024, why are you adding this again? Typo? >>> >>> Also, please use switch case, you can submit your patch as a part of: >>> >>> https://lore.kernel.org/linux-input/A50C1CF0-B927-4FCF-828F-1F5F79BA3762@xxxxxxxx/ >>> >>> Just resubmit those 2 patches along with your patch and make a v2. >> > > > -- > > Thanks! > Kind regards, > Grigorii!