diff mbox series

HID: apple: Add support for Matias wireless keyboard

Message ID 20200720205741.0A114747871@zero.eik.bme.hu (mailing list archive)
State Mainlined
Commit 4c9454267e019212b466810bc68281fb25424af2
Delegated to: Jiri Kosina
Headers show
Series HID: apple: Add support for Matias wireless keyboard | expand

Commit Message

BALATON Zoltan July 20, 2020, 8:53 p.m. UTC
The Matias Wireless keyboard has an Apple like layout and identifies
as ISO RevB Alu keyboard. Use hid-apple for it so Fn key and media
control functions work as expected.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 drivers/hid/hid-apple.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jiri Kosina Aug. 17, 2020, 10:15 a.m. UTC | #1
On Mon, 20 Jul 2020, BALATON Zoltan wrote:

> The Matias Wireless keyboard has an Apple like layout and identifies
> as ISO RevB Alu keyboard. Use hid-apple for it so Fn key and media
> control functions work as expected.
> 
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>

So If I understand correctly, this keyboard identifies itself with Apple 
VID, but in fact it is not.

I'd like to make sure that we don't break the real 
USB_DEVICE_ID_APPLE_ALU_REVB_ISO device produced by Apple; CCing Dan 
Bastone, who added this device ID back in 2011 (4a4c879904aa). Dan, any 
ideas please?

Thanks,
Jiri Kosina Aug. 17, 2020, 10:17 a.m. UTC | #2
On Mon, 17 Aug 2020, Jiri Kosina wrote:

> > The Matias Wireless keyboard has an Apple like layout and identifies
> > as ISO RevB Alu keyboard. Use hid-apple for it so Fn key and media
> > control functions work as expected.
> > 
> > Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> 
> So If I understand correctly, this keyboard identifies itself with Apple 
> VID, but in fact it is not.
> 
> I'd like to make sure that we don't break the real 
> USB_DEVICE_ID_APPLE_ALU_REVB_ISO device produced by Apple; CCing Dan 
> Bastone, who added this device ID back in 2011 (4a4c879904aa). Dan, any 
> ideas please?

OK, Dan's e-mail address doesn't work any more. Let's conservatively queue 
this for 5.10, and in case there are any regression reports against stock 
Apple keyboards, we'll have to look for ways to work it around.

Yay for VID sharing :/

Thanks,
BALATON Zoltan Aug. 17, 2020, 1:16 p.m. UTC | #3
On Mon, 17 Aug 2020, Jiri Kosina wrote:
> On Mon, 20 Jul 2020, BALATON Zoltan wrote:
>> The Matias Wireless keyboard has an Apple like layout and identifies
>> as ISO RevB Alu keyboard. Use hid-apple for it so Fn key and media
>> control functions work as expected.
>>
>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>
> So If I understand correctly, this keyboard identifies itself with Apple
> VID, but in fact it is not.
>
> I'd like to make sure that we don't break the real
> USB_DEVICE_ID_APPLE_ALU_REVB_ISO device produced by Apple; CCing Dan

AFAIK the Apple keyboard with the same pid is a USB one and is already 
handled by hid-apple. This one is a bluetooth keyboard so probably does 
not really clash and even if there's an Apple wireless keyboard with the 
same pid it's more likely we want hid-apple for that too so it's unlikely 
to break anything. (This Matias keyboard looks and acts like an Apple 
keyboard so probably uses this vid/pid to have macOS work better with it 
out of the box without needing additional setup.)

Regards,
BALATON Zoltan
Jiri Kosina Aug. 17, 2020, 2:44 p.m. UTC | #4
On Mon, 17 Aug 2020, BALATON Zoltan wrote:

> AFAIK the Apple keyboard with the same pid is a USB one and is already 
> handled by hid-apple. This one is a bluetooth keyboard so probably does 
> not really clash and even if there's an Apple wireless keyboard with the 
> same pid it's more likely we want hid-apple for that too so it's 
> unlikely to break anything. (This Matias keyboard looks and acts like an 
> Apple keyboard so probably uses this vid/pid to have macOS work better 
> with it out of the box without needing additional setup.)

Thanks for the bakcground. The patch is now in hid.git#for-5.10/apple
diff mbox series

Patch

diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index e82f604d33e9..6b8f0d004d34 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -503,6 +503,8 @@  static const struct hid_device_id apple_devices[] = {
 		.driver_data = APPLE_HAS_FN },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO),
 		.driver_data = APPLE_HAS_FN },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO),
+		.driver_data = APPLE_HAS_FN },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_JIS),
 		.driver_data = APPLE_HAS_FN },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI),