Commit 5e206459 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HID updates from Jiri Kosina:

 - rework of generic input handling which ultimately makes the
   processing of tablet events more generic and reliable (Benjamin
   Tissoires)

 - fixes for handling unnumbered reports fully correctly in i2c-hid
   (Angela Czubak, Dmitry Torokhov)

 - untangling of intermingled code for sending and handling output
   reports in i2c-hid (Dmitry Torokhov)

 - Apple magic keyboard support improvements for newer models (José
   Expósito)

 - Apple T2 Macs support improvements (Aun-Ali Zaidi, Paul Pawlowski)

 - driver for Razer Blackwidow keyboards (Jelle van der Waa)

 - driver for SiGma Micro keyboards (Desmond Lim)

 - integration of first part of DIGImend patches in order to ultimately
   vastly improve Linux support of tablets (Nikolai Kondrashov, José
   Expósito)

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (55 commits)
  HID: intel-ish-hid: Use dma_alloc_coherent for firmware update
  Input: docs: add more details on the use of BTN_TOOL
  HID: input: accommodate priorities for slotted devices
  HID: input: remove the need for HID_QUIRK_INVERT
  HID: input: enforce Invert usage to be processed before InRange
  HID: core: for input reports, process the usages by priority list
  HID: compute an ordered list of input fields to process
  HID: input: move up out-of-range processing of input values
  HID: input: rework spaghetti code with switch statements
  HID: input: tag touchscreens as such if the physical is not there
  HID: core: split data fetching from processing in hid_input_field()
  HID: core: de-duplicate some code in hid_input_field()
  HID: core: statically allocate read buffers
  HID: uclogic: Support multiple frame input devices
  HID: uclogic: Define report IDs before their descriptors
  HID: uclogic: Put version first in rdesc namespace
  HID: uclogic: Use "frame" instead of "buttonpad"
  HID: uclogic: Use different constants for frame report IDs
  HID: uclogic: Specify total report size to buttonpad macro
  HID: uclogic: Switch to matching subreport bytes
  ...
parents 14646776 b146dbbd
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -137,7 +137,11 @@ A few EV_KEY codes have special meanings:
    code should be set to a value of 1. When the tool is no longer interacting
    with the input device, the BTN_TOOL_<name> code should be reset to 0. All
    trackpads, tablets, and touchscreens should use at least one BTN_TOOL_<name>
    code when events are generated.
    code when events are generated. Likewise all trackpads, tablets, and
    touchscreens should export only one BTN_TOOL_<name> at a time. To not break
    existing userspace, it is recommended to not switch tool in one EV_SYN frame
    but first emitting the old BTN_TOOL_<name> at 0, then emit one SYN_REPORT
    and then set the new BTN_TOOL_<name> at 1.

* BTN_TOUCH:

+19 −0
Original line number Diff line number Diff line
@@ -128,6 +128,8 @@ config HID_ACRUX_FF
config HID_APPLE
	tristate "Apple {i,Power,Mac}Books"
	depends on HID
	depends on LEDS_CLASS
	depends on NEW_LEDS
	default !EXPERT
	help
	Support for some Apple devices which less or more break
@@ -929,6 +931,13 @@ config PLAYSTATION_FF
	  Say Y here if you would like to enable force feedback support for
	  PlayStation game controllers.

config HID_RAZER
	tristate "Razer non-fully HID-compliant devices"
	depends on HID
	help
	Support for Razer devices that are not fully compliant with the
	HID standard.

config HID_PRIMAX
	tristate "Primax non-fully HID-compliant devices"
	depends on HID
@@ -984,6 +993,16 @@ config HID_SEMITEK
	- Woo-dy
	- X-Bows Nature/Knight

config HID_SIGMAMICRO
	tristate "SiGma Micro-based keyboards"
	depends on USB_HID
	help
	  Support for keyboards that use the SiGma Micro (a.k.a SigmaChip) IC.

	  Supported devices:
	  - Landslides KR-700
	  - Rapoo V500

config HID_SONY
	tristate "Sony PS2/3/4 accessories"
	depends on USB_HID
+2 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ hid-picolcd-$(CONFIG_DEBUG_FS) += hid-picolcd_debugfs.o
obj-$(CONFIG_HID_PLANTRONICS)	+= hid-plantronics.o
obj-$(CONFIG_HID_PLAYSTATION)	+= hid-playstation.o
obj-$(CONFIG_HID_PRIMAX)	+= hid-primax.o
obj-$(CONFIG_HID_RAZER)	+= hid-razer.o
obj-$(CONFIG_HID_REDRAGON)	+= hid-redragon.o
obj-$(CONFIG_HID_RETRODE)	+= hid-retrode.o
obj-$(CONFIG_HID_ROCCAT)	+= hid-roccat.o hid-roccat-common.o \
@@ -109,6 +110,7 @@ obj-$(CONFIG_HID_RMI) += hid-rmi.o
obj-$(CONFIG_HID_SAITEK)	+= hid-saitek.o
obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
obj-$(CONFIG_HID_SEMITEK)	+= hid-semitek.o
obj-$(CONFIG_HID_SIGMAMICRO)	+= hid-sigmamicro.o
obj-$(CONFIG_HID_SMARTJOYPLUS)	+= hid-sjoy.o
obj-$(CONFIG_HID_SONY)		+= hid-sony.o
obj-$(CONFIG_HID_SPEEDLINK)	+= hid-speedlink.o
+2 −5
Original line number Diff line number Diff line
@@ -300,13 +300,10 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
	privdata->mmio = pcim_iomap_table(pdev)[2];
	pci_set_master(pdev);
	rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
	if (rc) {
		rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
	if (rc) {
		dev_err(&pdev->dev, "failed to set DMA mask\n");
		return rc;
	}
	}

	privdata->cl_data = devm_kzalloc(&pdev->dev, sizeof(struct amdtp_cl_data), GFP_KERNEL);
	if (!privdata->cl_data)
+278 −27
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
 *  Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
 *  Copyright (c) 2006-2007 Jiri Kosina
 *  Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com>
 *  Copyright (c) 2019 Paul Pawlowski <paul@mrarm.io>
 */

/*
@@ -33,6 +34,7 @@
/* BIT(7) reserved, was: APPLE_IGNORE_HIDINPUT */
#define APPLE_NUMLOCK_EMULATION	BIT(8)
#define APPLE_RDESC_BATTERY	BIT(9)
#define APPLE_BACKLIGHT_CTL	BIT(10)

#define APPLE_FLAG_FKEY		0x01

@@ -61,6 +63,12 @@ MODULE_PARM_DESC(swap_fn_leftctrl, "Swap the Fn and left Control keys. "
		"(For people who want to keep PC keyboard muscle memory. "
		"[0] = as-is, Mac layout, 1 = swapped, PC layout)");

struct apple_sc_backlight {
	struct led_classdev cdev;
	struct hid_device *hdev;
	unsigned short backlight_off, backlight_on_min, backlight_on_max;
};

struct apple_sc {
	struct hid_device *hdev;
	unsigned long quirks;
@@ -68,6 +76,7 @@ struct apple_sc {
	unsigned int fn_found;
	DECLARE_BITMAP(pressed_numlock, KEY_CNT);
	struct timer_list battery_timer;
	struct apple_sc_backlight *backlight;
};

struct apple_key_translation {
@@ -76,6 +85,61 @@ struct apple_key_translation {
	u8 flags;
};

static const struct apple_key_translation magic_keyboard_alu_fn_keys[] = {
	{ KEY_BACKSPACE, KEY_DELETE },
	{ KEY_ENTER,	KEY_INSERT },
	{ KEY_F1,	KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
	{ KEY_F2,	KEY_BRIGHTNESSUP,   APPLE_FLAG_FKEY },
	{ KEY_F3,	KEY_SCALE,          APPLE_FLAG_FKEY },
	{ KEY_F4,	KEY_DASHBOARD,      APPLE_FLAG_FKEY },
	{ KEY_F6,	KEY_NUMLOCK,        APPLE_FLAG_FKEY },
	{ KEY_F7,	KEY_PREVIOUSSONG,   APPLE_FLAG_FKEY },
	{ KEY_F8,	KEY_PLAYPAUSE,      APPLE_FLAG_FKEY },
	{ KEY_F9,	KEY_NEXTSONG,       APPLE_FLAG_FKEY },
	{ KEY_F10,	KEY_MUTE,           APPLE_FLAG_FKEY },
	{ KEY_F11,	KEY_VOLUMEDOWN,     APPLE_FLAG_FKEY },
	{ KEY_F12,	KEY_VOLUMEUP,       APPLE_FLAG_FKEY },
	{ KEY_UP,	KEY_PAGEUP },
	{ KEY_DOWN,	KEY_PAGEDOWN },
	{ KEY_LEFT,	KEY_HOME },
	{ KEY_RIGHT,	KEY_END },
	{ }
};

static const struct apple_key_translation magic_keyboard_2015_fn_keys[] = {
	{ KEY_BACKSPACE, KEY_DELETE },
	{ KEY_ENTER,	KEY_INSERT },
	{ KEY_F1,	KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
	{ KEY_F2,	KEY_BRIGHTNESSUP,   APPLE_FLAG_FKEY },
	{ KEY_F3,	KEY_SCALE,          APPLE_FLAG_FKEY },
	{ KEY_F4,	KEY_DASHBOARD,      APPLE_FLAG_FKEY },
	{ KEY_F7,	KEY_PREVIOUSSONG,   APPLE_FLAG_FKEY },
	{ KEY_F8,	KEY_PLAYPAUSE,      APPLE_FLAG_FKEY },
	{ KEY_F9,	KEY_NEXTSONG,       APPLE_FLAG_FKEY },
	{ KEY_F10,	KEY_MUTE,           APPLE_FLAG_FKEY },
	{ KEY_F11,	KEY_VOLUMEDOWN,     APPLE_FLAG_FKEY },
	{ KEY_F12,	KEY_VOLUMEUP,       APPLE_FLAG_FKEY },
	{ KEY_UP,	KEY_PAGEUP },
	{ KEY_DOWN,	KEY_PAGEDOWN },
	{ KEY_LEFT,	KEY_HOME },
	{ KEY_RIGHT,	KEY_END },
	{ }
};

struct apple_backlight_config_report {
	u8 report_id;
	u8 version;
	u16 backlight_off, backlight_on_min, backlight_on_max;
};

struct apple_backlight_set_report {
	u8 report_id;
	u8 version;
	u16 backlight;
	u16 rate;
};


static const struct apple_key_translation apple2021_fn_keys[] = {
	{ KEY_BACKSPACE, KEY_DELETE },
	{ KEY_ENTER,	KEY_INSERT },
@@ -119,6 +183,51 @@ static const struct apple_key_translation macbookair_fn_keys[] = {
	{ }
};

static const struct apple_key_translation macbookpro_no_esc_fn_keys[] = {
	{ KEY_BACKSPACE, KEY_DELETE },
	{ KEY_ENTER,	KEY_INSERT },
	{ KEY_GRAVE,	KEY_ESC },
	{ KEY_1,	KEY_F1 },
	{ KEY_2,	KEY_F2 },
	{ KEY_3,	KEY_F3 },
	{ KEY_4,	KEY_F4 },
	{ KEY_5,	KEY_F5 },
	{ KEY_6,	KEY_F6 },
	{ KEY_7,	KEY_F7 },
	{ KEY_8,	KEY_F8 },
	{ KEY_9,	KEY_F9 },
	{ KEY_0,	KEY_F10 },
	{ KEY_MINUS,	KEY_F11 },
	{ KEY_EQUAL,	KEY_F12 },
	{ KEY_UP,	KEY_PAGEUP },
	{ KEY_DOWN,	KEY_PAGEDOWN },
	{ KEY_LEFT,	KEY_HOME },
	{ KEY_RIGHT,	KEY_END },
	{ }
};

static const struct apple_key_translation macbookpro_dedicated_esc_fn_keys[] = {
	{ KEY_BACKSPACE, KEY_DELETE },
	{ KEY_ENTER,	KEY_INSERT },
	{ KEY_1,	KEY_F1 },
	{ KEY_2,	KEY_F2 },
	{ KEY_3,	KEY_F3 },
	{ KEY_4,	KEY_F4 },
	{ KEY_5,	KEY_F5 },
	{ KEY_6,	KEY_F6 },
	{ KEY_7,	KEY_F7 },
	{ KEY_8,	KEY_F8 },
	{ KEY_9,	KEY_F9 },
	{ KEY_0,	KEY_F10 },
	{ KEY_MINUS,	KEY_F11 },
	{ KEY_EQUAL,	KEY_F12 },
	{ KEY_UP,	KEY_PAGEUP },
	{ KEY_DOWN,	KEY_PAGEDOWN },
	{ KEY_LEFT,	KEY_HOME },
	{ KEY_RIGHT,	KEY_END },
	{ }
};

static const struct apple_key_translation apple_fn_keys[] = {
	{ KEY_BACKSPACE, KEY_DELETE },
	{ KEY_ENTER,	KEY_INSERT },
@@ -202,6 +311,15 @@ static const struct apple_key_translation swapped_fn_leftctrl_keys[] = {
	{ }
};

static inline void apple_setup_key_translation(struct input_dev *input,
		const struct apple_key_translation *table)
{
	const struct apple_key_translation *trans;

	for (trans = table; trans->from; trans++)
		set_bit(trans->to, input->keybit);
}

static const struct apple_key_translation *apple_find_translation(
		const struct apple_key_translation *table, u16 from)
{
@@ -242,10 +360,34 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
	}

	if (fnmode) {
		if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 ||
		if (hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI ||
		    hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO ||
		    hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS ||
		    hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI ||
		    hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO ||
		    hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS ||
		    hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI ||
		    hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO ||
		    hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS)
			table = magic_keyboard_alu_fn_keys;
		else if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2015 ||
			 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2015)
			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_FINGERPRINT_2021 ||
			 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021)
			table = apple2021_fn_keys;
		else if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132 ||
			 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680 ||
			 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213)
				table = macbookpro_no_esc_fn_keys;
		else if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K ||
			 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223 ||
			 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F)
				table = macbookpro_dedicated_esc_fn_keys;
		else if (hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K ||
			 hid->product == USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K)
				table = apple_fn_keys;
		else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
				hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
			table = macbookair_fn_keys;
@@ -452,30 +594,21 @@ static __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc,

static void apple_setup_input(struct input_dev *input)
{
	const struct apple_key_translation *trans;

	set_bit(KEY_NUMLOCK, input->keybit);

	/* Enable all needed keys */
	for (trans = apple_fn_keys; trans->from; trans++)
		set_bit(trans->to, input->keybit);

	for (trans = powerbook_fn_keys; trans->from; trans++)
		set_bit(trans->to, input->keybit);

	for (trans = powerbook_numlock_keys; trans->from; trans++)
		set_bit(trans->to, input->keybit);

	for (trans = apple_iso_keyboard; trans->from; trans++)
		set_bit(trans->to, input->keybit);

	for (trans = apple2021_fn_keys; trans->from; trans++)
		set_bit(trans->to, input->keybit);

	if (swap_fn_leftctrl) {
		for (trans = swapped_fn_leftctrl_keys; trans->from; trans++)
			set_bit(trans->to, input->keybit);
	}
	apple_setup_key_translation(input, apple_fn_keys);
	apple_setup_key_translation(input, powerbook_fn_keys);
	apple_setup_key_translation(input, powerbook_numlock_keys);
	apple_setup_key_translation(input, apple_iso_keyboard);
	apple_setup_key_translation(input, magic_keyboard_alu_fn_keys);
	apple_setup_key_translation(input, magic_keyboard_2015_fn_keys);
	apple_setup_key_translation(input, apple2021_fn_keys);
	apple_setup_key_translation(input, macbookpro_no_esc_fn_keys);
	apple_setup_key_translation(input, macbookpro_dedicated_esc_fn_keys);

	if (swap_fn_leftctrl)
		apple_setup_key_translation(input, swapped_fn_leftctrl_keys);
}

static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi,
@@ -530,6 +663,105 @@ static int apple_input_configured(struct hid_device *hdev,
	return 0;
}

static bool apple_backlight_check_support(struct hid_device *hdev)
{
	int i;
	unsigned int hid;
	struct hid_report *report;

	list_for_each_entry(report, &hdev->report_enum[HID_INPUT_REPORT].report_list, list) {
		for (i = 0; i < report->maxfield; i++) {
			hid = report->field[i]->usage->hid;
			if ((hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR && (hid & HID_USAGE) == 0xf)
				return true;
		}
	}

	return false;
}

static int apple_backlight_set(struct hid_device *hdev, u16 value, u16 rate)
{
	int ret = 0;
	struct apple_backlight_set_report *rep;

	rep = kmalloc(sizeof(*rep), GFP_KERNEL);
	if (rep == NULL)
		return -ENOMEM;

	rep->report_id = 0xB0;
	rep->version = 1;
	rep->backlight = value;
	rep->rate = rate;

	ret = hid_hw_raw_request(hdev, 0xB0u, (u8 *) rep, sizeof(*rep),
				 HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);

	kfree(rep);
	return ret;
}

static int apple_backlight_led_set(struct led_classdev *led_cdev,
	enum led_brightness brightness)
{
	struct apple_sc_backlight *backlight = container_of(led_cdev,
							    struct apple_sc_backlight, cdev);

	return apple_backlight_set(backlight->hdev, brightness, 0);
}

static int apple_backlight_init(struct hid_device *hdev)
{
	int ret;
	struct apple_sc *asc = hid_get_drvdata(hdev);
	struct apple_backlight_config_report *rep;

	if (!apple_backlight_check_support(hdev))
		return -EINVAL;

	rep = kmalloc(0x200, GFP_KERNEL);
	if (rep == NULL)
		return -ENOMEM;

	ret = hid_hw_raw_request(hdev, 0xBFu, (u8 *) rep, sizeof(*rep),
				 HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
	if (ret < 0) {
		hid_err(hdev, "backlight request failed: %d\n", ret);
		goto cleanup_and_exit;
	}
	if (ret < 8 || rep->version != 1) {
		hid_err(hdev, "backlight config struct: bad version %i\n", rep->version);
		ret = -EINVAL;
		goto cleanup_and_exit;
	}

	hid_dbg(hdev, "backlight config: off=%u, on_min=%u, on_max=%u\n",
		rep->backlight_off, rep->backlight_on_min, rep->backlight_on_max);

	asc->backlight = devm_kzalloc(&hdev->dev, sizeof(*asc->backlight), GFP_KERNEL);
	if (!asc->backlight) {
		ret = -ENOMEM;
		goto cleanup_and_exit;
	}

	asc->backlight->hdev = hdev;
	asc->backlight->cdev.name = "apple::kbd_backlight";
	asc->backlight->cdev.max_brightness = rep->backlight_on_max;
	asc->backlight->cdev.brightness_set_blocking = apple_backlight_led_set;

	ret = apple_backlight_set(hdev, 0, 0);
	if (ret < 0) {
		hid_err(hdev, "backlight set request failed: %d\n", ret);
		goto cleanup_and_exit;
	}

	ret = devm_led_classdev_register(&hdev->dev, &asc->backlight->cdev);

cleanup_and_exit:
	kfree(rep);
	return ret;
}

static int apple_probe(struct hid_device *hdev,
		const struct hid_device_id *id)
{
@@ -565,6 +797,9 @@ static int apple_probe(struct hid_device *hdev,
		  jiffies + msecs_to_jiffies(APPLE_BATTERY_TIMEOUT_MS));
	apple_fetch_battery(hdev);

	if (quirks & APPLE_BACKLIGHT_CTL)
		apple_backlight_init(hdev);

	return 0;
}

@@ -736,6 +971,22 @@ static const struct hid_device_id apple_devices[] = {
		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS),
		.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K),
		.driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132),
		.driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680),
		.driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213),
		.driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K),
		.driver_data = APPLE_HAS_FN },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223),
		.driver_data = APPLE_HAS_FN },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K),
		.driver_data = APPLE_HAS_FN },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F),
		.driver_data = APPLE_HAS_FN },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
@@ -748,15 +999,15 @@ static const struct hid_device_id apple_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
		.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_2021),
		.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 },
		.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_NUMPAD_2021),
		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
		.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),
		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },

Loading