From: Huei-Horng Yo <hiroshi@ghostsinthelab.org>
To: linux-input@vger.kernel.org
Subject: [PATCH] HID: Add Apple wireless keyboard 2011 JIS model support
Date: Tue, 04 Feb 2014 01:41:13 +0800 [thread overview]
Message-ID: <52EFD4B9.9070603@ghostsinthelab.org> (raw)
Hello,
I bought an Apple wireless keyboard 2011 JIS model,
the 'fn' key isn't work as expected in Linux 3.12.9.
What my patch mainly does is to add support for that model.
Before applying this patch, the keyboard behaves like a general keyboard,
its 'fn' key has no function to be used with arrow keys to do Home, End,
Page Up and Page Down.
I found that this is because the HID IDs list hasn't it in vendor ID
0x05ac (APPLE) section,
so I add the production ID 0x0257 (got the value by using bluetoothctl)
in drivers/hid/hid-ids.h
and add the corresponding codes in drivers/hid/hid-apple.c &
drivers/hid/hid-core.c.
Thanks,
Huei-Horng Yo
P.S. Also reported in Bugzilla:https://bugzilla.kernel.org/show_bug.cgi?id=69681 <https://bugzilla.kernel.org/show_bug.cgi?id=69681>
apple-alu-wireless-kbd-jis.patch
Signed-off-by: Huei-Horng Yo <hiroshi@ghostsinthelab.org>
diff -uprN linux-3.12.vanilla/drivers/hid/hid-apple.c linux-3.12/drivers/hid/hid-apple.c
--- linux-3.12.vanilla/drivers/hid/hid-apple.c 2013-11-04 07:41:51.000000000 +0800
+++ linux-3.12/drivers/hid/hid-apple.c 2014-02-01 01:15:37.532768035 +0800
@@ -447,6 +447,9 @@ static const struct hid_device_id apple_
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI),
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
+ USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS),
+ .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS),
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI),
diff -uprN linux-3.12.vanilla/drivers/hid/hid-core.c linux-3.12/drivers/hid/hid-core.c
--- linux-3.12.vanilla/drivers/hid/hid-core.c 2013-11-04 07:41:51.000000000 +0800
+++ linux-3.12/drivers/hid/hid-core.c 2014-02-01 01:15:37.532768035 +0800
@@ -1680,6 +1680,7 @@ static const struct hid_device_id hid_ha
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },
diff -uprN linux-3.12.vanilla/drivers/hid/hid-ids.h linux-3.12/drivers/hid/hid-ids.h
--- linux-3.12.vanilla/drivers/hid/hid-ids.h 2013-11-04 07:41:51.000000000 +0800
+++ linux-3.12/drivers/hid/hid-ids.h 2014-02-01 01:15:37.532768035 +0800
@@ -135,6 +135,7 @@
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI 0x0255
#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_WELLSPRING8_ANSI 0x0290
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0291
#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0292
next reply other threads:[~2014-02-03 17:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-03 17:41 Huei-Horng Yo [this message]
2014-02-04 4:33 ` [PATCH] HID: Add Apple wireless keyboard 2011 JIS model support Huei-Horng Yo
2014-02-04 7:03 ` Huei-Horng Yo
-- strict thread matches above, loose matches on Subject: below --
2014-02-06 9:18 Huei-Horng Yo
2014-02-06 9:22 ` Jiri Kosina
2014-02-06 9:40 ` Huei-Horng Yo
2014-02-06 13:45 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52EFD4B9.9070603@ghostsinthelab.org \
--to=hiroshi@ghostsinthelab.org \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).