--- /dev/null
+From 213f9da80533940560bef8fa43b10c590895459c Mon Sep 17 00:00:00 2001
+From: Gökçen Eraslan <gokcen@pardus.org.tr>
+Date: Sat, 22 Oct 2011 22:39:06 +0300
+Subject: HID: Add device IDs for Macbook Pro 8 keyboards
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Gökçen Eraslan <gokcen@pardus.org.tr>
+
+commit 213f9da80533940560bef8fa43b10c590895459c upstream.
+
+This patch adds keyboard support for Macbook Pro 8 models which has
+WELLSPRING5A model name and 0x0252, 0x0253 and 0x0254 USB IDs. Trackpad
+support for those models are added to bcm5974 in
+c331eb580a0a7906c0cdb8dbae3cfe99e3c0e555 ("Input: bcm5974 - Add
+support for newer MacBookPro8,2).
+
+Signed-off-by: Gökçen Eraslan <gokcen@pardus.org.tr>
+Acked-by: Henrik Rydberg <rydberg@euromail.se>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Cc: Chase Douglas <chase.douglas@canonical.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/hid-apple.c | 6 ++++++
+ drivers/hid/hid-core.c | 6 ++++++
+ drivers/hid/hid-ids.h | 3 +++
+ 3 files changed, 15 insertions(+)
+
+--- a/drivers/hid/hid-apple.c
++++ b/drivers/hid/hid-apple.c
+@@ -533,6 +533,12 @@ static const struct hid_device_id apple_
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS),
+ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI),
++ .driver_data = APPLE_HAS_FN },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO),
++ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS),
++ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
+ { 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),
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1340,6 +1340,9 @@ static const struct hid_device_id hid_ha
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS) },
+@@ -1899,6 +1902,9 @@ static const struct hid_device_id hid_mo
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_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) },
+ { }
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -118,6 +118,9 @@
+ #define USB_DEVICE_ID_APPLE_ALU_REVB_ANSI 0x024f
+ #define USB_DEVICE_ID_APPLE_ALU_REVB_ISO 0x0250
+ #define USB_DEVICE_ID_APPLE_ALU_REVB_JIS 0x0251
++#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252
++#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253
++#define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254
+ #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239
+ #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a
+ #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b
--- /dev/null
+From f6f554f09c5b831efdaf67c449e18ca06ee648fe Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Wed, 10 Aug 2011 14:12:52 +0200
+Subject: HID: add MacBookAir4,2 to hid_have_special_driver[]
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+commit f6f554f09c5b831efdaf67c449e18ca06ee648fe upstream.
+
+Otherwise the generic driver wouldn't unbind from it and wouldn't
+let hid-apple to automatically take over.
+
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/hid-core.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1340,6 +1340,9 @@ static const struct hid_device_id hid_ha
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_JIS) },
--- /dev/null
+From 5d922baa631058c7e37ae33e81c4d3e6437f8d1d Mon Sep 17 00:00:00 2001
+From: "Joshua V. Dillon" <jvdillon@gmail.com>
+Date: Fri, 5 Aug 2011 12:05:22 -0700
+Subject: HID: add support for MacBookAir4,2 keyboard.
+
+From: "Joshua V. Dillon" <jvdillon@gmail.com>
+
+commit 5d922baa631058c7e37ae33e81c4d3e6437f8d1d upstream.
+
+Added USB device IDs for MacBookAir4,2 keyboard. Device constants were
+copied from the MacBookAir3,2 constants. The 4,2 device specification is
+reportedly unchanged from the 3,2 predecessor and seems to work well.
+
+Signed-off-by: Joshua V Dillon <jvdillon@gmail.com>
+Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/hid-apple.c | 9 +++++++++
+ drivers/hid/hid-ids.h | 3 +++
+ 2 files changed, 12 insertions(+)
+
+--- a/drivers/hid/hid-apple.c
++++ b/drivers/hid/hid-apple.c
+@@ -183,6 +183,9 @@ static int hidinput_apple_event(struct h
+ if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
+ hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
+ table = macbookair_fn_keys;
++ else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI &&
++ hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING6_JIS)
++ table = macbookair_fn_keys;
+ else if (hid->product < 0x21d || hid->product >= 0x300)
+ table = powerbook_fn_keys;
+ else
+@@ -493,6 +496,12 @@ static const struct hid_device_id apple_
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS),
+ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI),
++ .driver_data = APPLE_HAS_FN },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO),
++ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS),
++ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
+ { 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),
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -109,6 +109,9 @@
+ #define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245
+ #define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246
+ #define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247
++#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c
++#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d
++#define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e
+ #define USB_DEVICE_ID_APPLE_ALU_REVB_ANSI 0x024f
+ #define USB_DEVICE_ID_APPLE_ALU_REVB_ISO 0x0250
+ #define USB_DEVICE_ID_APPLE_ALU_REVB_JIS 0x0251
--- /dev/null
+From d762cc290b9f17e346f4297fd5984b70ce71ef66 Mon Sep 17 00:00:00 2001
+From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date: Sat, 1 Oct 2011 15:54:53 +0900
+Subject: HID: Add support MacbookAir 4,1 keyboard
+
+From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit d762cc290b9f17e346f4297fd5984b70ce71ef66 upstream.
+
+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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/hid-apple.c | 31 +++++++++++++++++++++++++++++++
+ drivers/hid/hid-core.c | 3 +++
+ drivers/hid/hid-ids.h | 3 +++
+ 3 files changed, 37 insertions(+)
+
+--- a/drivers/hid/hid-apple.c
++++ b/drivers/hid/hid-apple.c
+@@ -82,6 +82,28 @@ static const struct apple_key_translatio
+ { }
+ };
+
++static const struct apple_key_translation macbookair4_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_F5, KEY_KBDILLUMDOWN, APPLE_FLAG_FKEY },
++ { KEY_F6, KEY_KBDILLUMUP, 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 apple_fn_keys[] = {
+ { KEY_BACKSPACE, KEY_DELETE },
+ { KEY_ENTER, KEY_INSERT },
+@@ -186,6 +208,9 @@ static int hidinput_apple_event(struct h
+ else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI &&
+ hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING6_JIS)
+ table = macbookair_fn_keys;
++ else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI &&
++ hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS)
++ table = macbookair4_fn_keys;
+ else if (hid->product < 0x21d || hid->product >= 0x300)
+ table = powerbook_fn_keys;
+ else
+@@ -502,6 +527,12 @@ static const struct hid_device_id apple_
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS),
+ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI),
++ .driver_data = APPLE_HAS_FN },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO),
++ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS),
++ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
+ { 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),
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1343,6 +1343,9 @@ static const struct hid_device_id hid_ha
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_JIS) },
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -109,6 +109,9 @@
+ #define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245
+ #define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246
+ #define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247
++#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI 0x0249
++#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO 0x024a
++#define USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS 0x024b
+ #define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c
+ #define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d
+ #define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e
--- /dev/null
+From 21404b772a1c65f7b935b8c0fddc388a949f4e31 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Sun, 6 Nov 2011 18:34:03 -0800
+Subject: hid/apple: modern macbook airs use the standard apple function key translations
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 21404b772a1c65f7b935b8c0fddc388a949f4e31 upstream.
+
+This removes the use of the special "macbookair_fn_keys" keyboard
+translation table for the MacBookAir4,x models (ie the 2011 refresh).
+They use the standard apple_fn_keys[] translation. Apparently only the
+old MacBook Air's need a different translation table.
+
+This mirrors the change that commit da617c7cb915 ("HID: consolidate
+MacbookAir 4,1 mappings") did for the WELLSPRING6A ones, but does it for
+the WELLSPRING6 model used on the MacBookAir4,2.
+
+Reported-and-tested-by: Dirk Hohndel <hohndel@infradead.org>
+Cc: Jiri Kosina <jkosina@suse.cz>
+Cc: Joshua V Dillon <jvdillon@gmail.com>
+Cc: Chase Douglas <chase.douglas@canonical.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+--- a/drivers/hid/hid-apple.c
++++ b/drivers/hid/hid-apple.c
+@@ -183,9 +183,6 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
+ if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
+ hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
+ table = macbookair_fn_keys;
+- else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI &&
+- hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING6_JIS)
+- table = macbookair_fn_keys;
+ else if (hid->product < 0x21d || hid->product >= 0x300)
+ table = powerbook_fn_keys;
+ else
--- /dev/null
+From da617c7cb915545dda4280df888dd6f8d5697420 Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Wed, 5 Oct 2011 16:54:45 +0200
+Subject: HID: consolidate MacbookAir 4,1 mappings
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+commit da617c7cb915545dda4280df888dd6f8d5697420 upstream.
+
+MacbookAir 4,1 doesn't require extra mapping table, as the mappings
+are identical to apple_fn_keys[].
+
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/hid-apple.c | 25 -------------------------
+ 1 file changed, 25 deletions(-)
+
+--- a/drivers/hid/hid-apple.c
++++ b/drivers/hid/hid-apple.c
+@@ -82,28 +82,6 @@ static const struct apple_key_translatio
+ { }
+ };
+
+-static const struct apple_key_translation macbookair4_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_F5, KEY_KBDILLUMDOWN, APPLE_FLAG_FKEY },
+- { KEY_F6, KEY_KBDILLUMUP, 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 apple_fn_keys[] = {
+ { KEY_BACKSPACE, KEY_DELETE },
+ { KEY_ENTER, KEY_INSERT },
+@@ -208,9 +186,6 @@ static int hidinput_apple_event(struct h
+ else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI &&
+ hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING6_JIS)
+ table = macbookair_fn_keys;
+- else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI &&
+- hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS)
+- table = macbookair4_fn_keys;
+ else if (hid->product < 0x21d || hid->product >= 0x300)
+ table = powerbook_fn_keys;
+ else
--- /dev/null
+From ad734bc1565364f9e4b70888d3ce5743b3c1030a Mon Sep 17 00:00:00 2001
+From: Andreas Krist <andreas.krist@gmail.com>
+Date: Fri, 28 Oct 2011 18:50:39 +0200
+Subject: HID: hid-apple: add device ID of another wireless aluminium
+
+From: Andreas Krist <andreas.krist@gmail.com>
+
+commit ad734bc1565364f9e4b70888d3ce5743b3c1030a upstream.
+
+I've recently bought a Apple wireless aluminum keyboard (model 2011) which is
+not yet supported by the kernel - it seems they just changed the device id.
+After applying the attached patch, the device is fully functional.
+
+Signed-off-by: Andreas Krist <andreas.krist@gmail.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/hid-apple.c | 3 +++
+ drivers/hid/hid-core.c | 1 +
+ drivers/hid/hid-ids.h | 1 +
+ 3 files changed, 5 insertions(+)
+
+--- a/drivers/hid/hid-apple.c
++++ b/drivers/hid/hid-apple.c
+@@ -483,6 +483,9 @@ static const struct hid_device_id apple_
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO),
+ .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
+ APPLE_ISO_KEYBOARD },
++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO),
++ .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
++ APPLE_ISO_KEYBOARD },
+ { 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),
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1355,6 +1355,7 @@ static const struct hid_device_id hid_ha
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
+ { 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_ISO) },
+ { 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_ASUS, USB_DEVICE_ID_ASUS_T91MT) },
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -124,6 +124,7 @@
+ #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239
+ #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a
+ #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b
++#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO 0x0256
+ #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a
+ #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b
+ #define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241
--- /dev/null
+From c50bb1a4005630f47b5da26336f74a485033a515 Mon Sep 17 00:00:00 2001
+From: Jeff Brown <jeffbrown@android.com>
+Date: Mon, 15 Aug 2011 21:12:09 -0700
+Subject: HID: hid-multitouch: Add LG Display Multitouch device.
+
+From: Jeff Brown <jeffbrown@android.com>
+
+commit c50bb1a4005630f47b5da26336f74a485033a515 upstream.
+
+This panel is also known as the Dell ST2220Tc.
+
+Signed-off-by: jeffbrown@android.com
+Reviewed-By: Benjamin Tissoires <Benjamin_Tissoires@logitech.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/Kconfig | 1 +
+ drivers/hid/hid-core.c | 1 +
+ drivers/hid/hid-ids.h | 3 +++
+ drivers/hid/hid-multitouch.c | 5 +++++
+ 4 files changed, 10 insertions(+)
+
+--- a/drivers/hid/Kconfig
++++ b/drivers/hid/Kconfig
+@@ -328,6 +328,7 @@ config HID_MULTITOUCH
+ - Hanvon dual touch panels
+ - Ilitek dual touch panels
+ - IrTouch Infrared USB panels
++ - LG Display panels (Dell ST2220Tc)
+ - Lumio CrystalTouch panels
+ - MosArt dual-touch panels
+ - PenMount dual touch panels
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1399,6 +1399,7 @@ static const struct hid_device_id hid_ha
+ { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_LG, USB_DEVICE_ID_LG_MULTITOUCH) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) },
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -426,6 +426,9 @@
+ #define USB_DEVICE_ID_LD_HYBRID 0x2090
+ #define USB_DEVICE_ID_LD_HEATCONTROL 0x20A0
+
++#define USB_VENDOR_ID_LG 0x1fd2
++#define USB_DEVICE_ID_LG_MULTITOUCH 0x0064
++
+ #define USB_VENDOR_ID_LOGITECH 0x046d
+ #define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101
+ #define USB_DEVICE_ID_LOGITECH_HARMONY_FIRST 0xc110
+--- a/drivers/hid/hid-multitouch.c
++++ b/drivers/hid/hid-multitouch.c
+@@ -672,6 +672,11 @@ static const struct hid_device_id mt_dev
+ HID_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS,
+ USB_DEVICE_ID_IRTOUCH_INFRARED_USB) },
+
++ /* LG Display panels */
++ { .driver_data = MT_CLS_DEFAULT,
++ HID_USB_DEVICE(USB_VENDOR_ID_LG,
++ USB_DEVICE_ID_LG_MULTITOUCH) },
++
+ /* Lumio panels */
+ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
+ HID_USB_DEVICE(USB_VENDOR_ID_LUMIO,
--- /dev/null
+From f722013ee9fd24623df31dec9a91a6d02c3e2f2f Mon Sep 17 00:00:00 2001
+From: "THOMSON, Adam (Adam)" <adam.thomson@alcatel-lucent.com>
+Date: Tue, 14 Jun 2011 16:52:38 +0200
+Subject: mtd: nand_base: always initialise oob_poi before writing OOB data
+
+From: "THOMSON, Adam (Adam)" <adam.thomson@alcatel-lucent.com>
+
+commit f722013ee9fd24623df31dec9a91a6d02c3e2f2f upstream.
+
+In nand_do_write_ops() code it is possible for a caller to provide
+ops.oobbuf populated and ops.mode == MTD_OOB_AUTO, which currently
+means that the chip->oob_poi buffer isn't initialised to all 0xFF.
+The nand_fill_oob() method then carries out the task of copying
+the provided OOB data to oob_poi, but with MTD_OOB_AUTO it skips
+areas marked as unavailable by the layout struct, including the
+bad block marker bytes.
+
+An example of this causing issues is when the last OOB data read
+was from the start of a bad block where the markers are not 0xFF,
+and the caller wishes to write new OOB data at the beginning of
+another block. In this scenario the caller would provide OOB data,
+but nand_fill_oob() would skip the bad block marker bytes in
+oob_poi before copying the OOB data provided by the caller.
+This means that when the OOB data is written back to NAND,
+the block is inadvertently marked as bad without the caller knowing.
+This has been witnessed when using YAFFS2 where tags are stored
+in the OOB.
+
+To avoid this oob_poi is always initialised to 0xFF to make sure
+no left over data is inadvertently written back to the OOB area.
+
+Credits to Brian Norris <computersforpeace@gmail.com> for fixing this
+patch.
+
+Signed-off-by: Adam Thomson <adam.thomson@alcatel-lucent.com>
+Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/mtd/nand/nand_base.c | 27 ++++++++++++++++-----------
+ 1 file changed, 16 insertions(+), 11 deletions(-)
+
+--- a/drivers/mtd/nand/nand_base.c
++++ b/drivers/mtd/nand/nand_base.c
+@@ -2097,14 +2097,22 @@ static int nand_write_page(struct mtd_in
+
+ /**
+ * nand_fill_oob - [Internal] Transfer client buffer to oob
+- * @chip: nand chip structure
++ * @mtd: MTD device structure
+ * @oob: oob data buffer
+ * @len: oob data write length
+ * @ops: oob ops structure
+ */
+-static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob, size_t len,
+- struct mtd_oob_ops *ops)
++static uint8_t *nand_fill_oob(struct mtd_info *mtd, uint8_t *oob, size_t len,
++ struct mtd_oob_ops *ops)
+ {
++ struct nand_chip *chip = mtd->priv;
++
++ /*
++ * Initialise to all 0xFF, to avoid the possibility of left over OOB
++ * data from a previous OOB read.
++ */
++ memset(chip->oob_poi, 0xff, mtd->oobsize);
++
+ switch (ops->mode) {
+
+ case MTD_OOB_PLACE:
+@@ -2201,10 +2209,6 @@ static int nand_do_write_ops(struct mtd_
+ (chip->pagebuf << chip->page_shift) < (to + ops->len))
+ chip->pagebuf = -1;
+
+- /* If we're not given explicit OOB data, let it be 0xFF */
+- if (likely(!oob))
+- memset(chip->oob_poi, 0xff, mtd->oobsize);
+-
+ /* Don't allow multipage oob writes with offset */
+ if (oob && ops->ooboffs && (ops->ooboffs + ops->ooblen > oobmaxlen))
+ return -EINVAL;
+@@ -2226,8 +2230,11 @@ static int nand_do_write_ops(struct mtd_
+
+ if (unlikely(oob)) {
+ size_t len = min(oobwritelen, oobmaxlen);
+- oob = nand_fill_oob(chip, oob, len, ops);
++ oob = nand_fill_oob(mtd, oob, len, ops);
+ oobwritelen -= len;
++ } else {
++ /* We still need to erase leftover OOB data */
++ memset(chip->oob_poi, 0xff, mtd->oobsize);
+ }
+
+ ret = chip->write_page(mtd, chip, wbuf, page, cached,
+@@ -2401,10 +2408,8 @@ static int nand_do_write_oob(struct mtd_
+ if (page == chip->pagebuf)
+ chip->pagebuf = -1;
+
+- memset(chip->oob_poi, 0xff, mtd->oobsize);
+- nand_fill_oob(chip, ops->oobbuf, ops->ooblen, ops);
++ nand_fill_oob(mtd, ops->oobbuf, ops->ooblen, ops);
+ status = chip->ecc.write_oob(mtd, chip, page & chip->pagemask);
+- memset(chip->oob_poi, 0xff, mtd->oobsize);
+
+ if (status)
+ return status;
ath9k_hw-fix-regression-of-register-offset-for-ar9003-chips.patch
md-raid5-abort-any-pending-parity-operations-when-array-fails.patch
md-raid5-stripe_active-has-lock-semantics-add-barriers.patch
+mtd-nand_base-always-initialise-oob_poi-before-writing-oob-data.patch
+hid-add-support-for-macbookair4-2-keyboard.patch
+hid-hid-multitouch-add-lg-display-multitouch-device.patch
+hid-add-macbookair4-2-to-hid_have_special_driver.patch
+hid-add-support-macbookair-4-1-keyboard.patch
+hid-add-device-ids-for-macbook-pro-8-keyboards.patch
+hid-hid-apple-add-device-id-of-another-wireless-aluminium.patch
+hid-consolidate-macbookair-4-1-mappings.patch
+hid-apple-modern-macbook-airs-use-the-standard-apple-function-key-translations.patch