linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.9 01/26] HID: add support for Apple Magic Keyboards
@ 2018-10-01  0:40 Sasha Levin
  2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 02/26] usb: gadget: fotg210-udc: Fix memory leak of fotg210->ep[i] Sasha Levin
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: Sasha Levin @ 2018-10-01  0:40 UTC (permalink / raw)
  To: stable, linux-kernel; +Cc: Sean O'Brien, Jiri Kosina, Sasha Levin

From: Sean O'Brien <seobrien@chromium.org>

[ Upstream commit ee345492437043a79db058a3d4f029ebcb52089a ]

USB device
	Vendor 05ac (Apple)
	Device 026c (Magic Keyboard with Numeric Keypad)

Bluetooth devices
	Vendor 004c (Apple)
	Device 0267 (Magic Keyboard)
	Device 026c (Magic Keyboard with Numeric Keypad)

Support already exists for the Magic Keyboard over USB connection.
Add support for the Magic Keyboard over Bluetooth connection, and for
the Magic Keyboard with Numeric Keypad over Bluetooth and USB
connection.

Signed-off-by: Sean O'Brien <seobrien@chromium.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/hid/hid-apple.c | 9 ++++++++-
 drivers/hid/hid-ids.h   | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index 2e046082210f..65a0c79f212e 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -333,7 +333,8 @@ static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		struct hid_field *field, struct hid_usage *usage,
 		unsigned long **bit, int *max)
 {
-	if (usage->hid == (HID_UP_CUSTOM | 0x0003)) {
+	if (usage->hid == (HID_UP_CUSTOM | 0x0003) ||
+			usage->hid == (HID_UP_MSVENDOR | 0x0003)) {
 		/* The fn key on Apple USB keyboards */
 		set_bit(EV_REP, hi->input->evbit);
 		hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_FN);
@@ -476,6 +477,12 @@ static const struct hid_device_id apple_devices[] = {
 		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI),
 		.driver_data = APPLE_HAS_FN },
+	{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI),
+		.driver_data = APPLE_HAS_FN },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI),
+		.driver_data = APPLE_HAS_FN },
+	{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI),
+		.driver_data = APPLE_HAS_FN },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI),
 		.driver_data = APPLE_HAS_FN },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO),
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index de64cd33590a..ad5048e6b0d3 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -83,6 +83,7 @@
 #define USB_DEVICE_ID_ANTON_TOUCH_PAD	0x3101
 
 #define USB_VENDOR_ID_APPLE		0x05ac
+#define BT_VENDOR_ID_APPLE		0x004c
 #define USB_DEVICE_ID_APPLE_MIGHTYMOUSE	0x0304
 #define USB_DEVICE_ID_APPLE_MAGICMOUSE	0x030d
 #define USB_DEVICE_ID_APPLE_MAGICTRACKPAD	0x030e
@@ -152,6 +153,7 @@
 #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO   0x0256
 #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS   0x0257
 #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI   0x0267
+#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI   0x026c
 #define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI	0x0290
 #define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO	0x0291
 #define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS	0x0292
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2018-10-01  0:46 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01  0:40 [PATCH AUTOSEL 4.9 01/26] HID: add support for Apple Magic Keyboards Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 02/26] usb: gadget: fotg210-udc: Fix memory leak of fotg210->ep[i] Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 04/26] HID: hid-saitek: Add device ID for RAT 7 Contagion Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 03/26] pinctrl: msm: Really mask level interrupts to prevent latching Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 06/26] perf probe powerpc: Ignore SyS symbols irrespective of endianness Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 05/26] perf evsel: Fix potential null pointer dereference in perf_evsel__new_idx() Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 07/26] RDMA/ucma: check fd type in ucma_migrate_id() Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 08/26] USB: yurex: Check for truncation in yurex_read() Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 09/26] nvmet-rdma: fix possible bogus dereference under heavy load Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 10/26] net/mlx5: Consider PCI domain in search for next dev Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 11/26] drm/nouveau/TBDdevinit: don't fail when PMU/PRE_OS is missing from VBIOS Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 12/26] dm raid: fix rebuild of specific devices by updating superblock Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 13/26] fs/cifs: suppress a string overflow warning Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 14/26] net: ena: fix driver when PAGE_SIZE == 64kB Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 15/26] perf/x86/intel: Add support/quirk for the MISPREDICT bit on Knights Landing CPUs Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 16/26] dm thin metadata: try to avoid ever aborting transactions Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 17/26] arch/hexagon: fix kernel/dma.c build warning Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 19/26] arm64: jump_label.h: use asm_volatile_goto macro instead of "asm goto" Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 18/26] hexagon: modify ffs() and fls() to return int Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 20/26] r8169: Clear RTL_FLAG_TASK_*_PENDING when clearing RTL_FLAG_TASK_ENABLED Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 22/26] s390/qeth: don't dump past end of unknown HW header Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 21/26] s390/qeth: use vzalloc for QUERY OAT buffer Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 23/26] cifs: read overflow in is_valid_oplock_break() Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 24/26] xen/manage: don't complain about an empty value in control/sysrq node Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 25/26] xen: avoid crash in disable_hotplug_cpu Sasha Levin
2018-10-01  0:40 ` [PATCH AUTOSEL 4.9 26/26] xen: fix GCC warning and remove duplicate EVTCHN_ROW/EVTCHN_COL usage Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).