aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <iwamatsu@nigauri.org>2011-10-01 02:54:53 -0400
committerJiri Kosina <jkosina@suse.cz>2011-10-03 08:00:05 -0400
commitd762cc290b9f17e346f4297fd5984b70ce71ef66 (patch)
tree8450fb1959df8e3f50ba74d216eee5465ca282c8 /drivers/hid
parent1a8962317f494ad858971fc08ba035eff658a5c9 (diff)
HID: Add support MacbookAir 4,1 keyboard
Added USB device IDs and keyboard map for MacBookAir 4,1 keyboard. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-apple.c31
-rw-r--r--drivers/hid/hid-core.c3
-rw-r--r--drivers/hid/hid-ids.h3
3 files changed, 37 insertions, 0 deletions
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index 8bfd87b59c47..b33bab9b72a5 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -82,6 +82,28 @@ static const struct apple_key_translation macbookair_fn_keys[] = {
82 { } 82 { }
83}; 83};
84 84
85static const struct apple_key_translation macbookair4_fn_keys[] = {
86 { KEY_BACKSPACE, KEY_DELETE },
87 { KEY_ENTER, KEY_INSERT },
88 { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
89 { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY },
90 { KEY_F3, KEY_SCALE, APPLE_FLAG_FKEY },
91 { KEY_F4, KEY_DASHBOARD, APPLE_FLAG_FKEY },
92 { KEY_F5, KEY_KBDILLUMDOWN, APPLE_FLAG_FKEY },
93 { KEY_F6, KEY_KBDILLUMUP, APPLE_FLAG_FKEY },
94 { KEY_F7, KEY_PREVIOUSSONG, APPLE_FLAG_FKEY },
95 { KEY_F8, KEY_PLAYPAUSE, APPLE_FLAG_FKEY },
96 { KEY_F9, KEY_NEXTSONG, APPLE_FLAG_FKEY },
97 { KEY_F10, KEY_MUTE, APPLE_FLAG_FKEY },
98 { KEY_F11, KEY_VOLUMEDOWN, APPLE_FLAG_FKEY },
99 { KEY_F12, KEY_VOLUMEUP, APPLE_FLAG_FKEY },
100 { KEY_UP, KEY_PAGEUP },
101 { KEY_DOWN, KEY_PAGEDOWN },
102 { KEY_LEFT, KEY_HOME },
103 { KEY_RIGHT, KEY_END },
104 { }
105};
106
85static const struct apple_key_translation apple_fn_keys[] = { 107static const struct apple_key_translation apple_fn_keys[] = {
86 { KEY_BACKSPACE, KEY_DELETE }, 108 { KEY_BACKSPACE, KEY_DELETE },
87 { KEY_ENTER, KEY_INSERT }, 109 { KEY_ENTER, KEY_INSERT },
@@ -186,6 +208,9 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
186 else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI && 208 else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI &&
187 hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING6_JIS) 209 hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING6_JIS)
188 table = macbookair_fn_keys; 210 table = macbookair_fn_keys;
211 else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI &&
212 hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS)
213 table = macbookair4_fn_keys;
189 else if (hid->product < 0x21d || hid->product >= 0x300) 214 else if (hid->product < 0x21d || hid->product >= 0x300)
190 table = powerbook_fn_keys; 215 table = powerbook_fn_keys;
191 else 216 else
@@ -496,6 +521,12 @@ static const struct hid_device_id apple_devices[] = {
496 .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, 521 .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
497 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS), 522 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS),
498 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, 523 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
524 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI),
525 .driver_data = APPLE_HAS_FN },
526 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO),
527 .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
528 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS),
529 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
499 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), 530 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
500 .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, 531 .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
501 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), 532 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index d98332b11009..5b4b76e6c906 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1359,6 +1359,9 @@ static const struct hid_device_id hid_have_special_driver[] = {
1359 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI) }, 1359 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI) },
1360 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO) }, 1360 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO) },
1361 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS) }, 1361 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS) },
1362 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) },
1363 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) },
1364 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) },
1362 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, 1365 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
1363 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, 1366 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
1364 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, 1367 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 3c83f8d92431..aa7419350603 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -109,6 +109,9 @@
109#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245 109#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245
110#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246 110#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246
111#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247 111#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247
112#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI 0x0249
113#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO 0x024a
114#define USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS 0x024b
112#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c 115#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c
113#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d 116#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d
114#define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e 117#define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e