From 4815848b0808f684b0bd9739035d54baaab05af3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 9 Nov 2011 12:53:56 -0800 Subject: [PATCH] 3.0 patches added patches: hid-add-device-ids-for-macbook-pro-8-keyboards.patch hid-add-macbookair4-2-to-hid_have_special_driver.patch hid-add-support-for-huijia-usb-gamepad-connector.patch hid-add-support-for-macbookair4-2-keyboard.patch hid-add-support-for-new-revision-of-apple-aluminum-keyboard.patch hid-add-support-macbookair-4-1-keyboard.patch hid-apple-modern-macbook-airs-use-the-standard-apple-function-key-translations.patch hid-consolidate-macbookair-4-1-mappings.patch hid-hid-apple-add-device-id-of-another-wireless-aluminium.patch hid-hid-multitouch-add-lg-display-multitouch-device.patch mtd-nand_base-always-initialise-oob_poi-before-writing-oob-data.patch --- ...vice-ids-for-macbook-pro-8-keyboards.patch | 79 +++++++++++++ ...ookair4-2-to-hid_have_special_driver.patch | 31 +++++ ...ort-for-huijia-usb-gamepad-connector.patch | 40 +++++++ ...d-support-for-macbookair4-2-keyboard.patch | 60 ++++++++++ ...-revision-of-apple-aluminum-keyboard.patch | 62 ++++++++++ ...-add-support-macbookair-4-1-keyboard.patch | 99 ++++++++++++++++ ...dard-apple-function-key-translations.patch | 41 +++++++ ...-consolidate-macbookair-4-1-mappings.patch | 60 ++++++++++ ...ice-id-of-another-wireless-aluminium.patch | 55 +++++++++ ...uch-add-lg-display-multitouch-device.patch | 69 +++++++++++ ...lise-oob_poi-before-writing-oob-data.patch | 107 ++++++++++++++++++ queue-3.0/series | 11 ++ 12 files changed, 714 insertions(+) create mode 100644 queue-3.0/hid-add-device-ids-for-macbook-pro-8-keyboards.patch create mode 100644 queue-3.0/hid-add-macbookair4-2-to-hid_have_special_driver.patch create mode 100644 queue-3.0/hid-add-support-for-huijia-usb-gamepad-connector.patch create mode 100644 queue-3.0/hid-add-support-for-macbookair4-2-keyboard.patch create mode 100644 queue-3.0/hid-add-support-for-new-revision-of-apple-aluminum-keyboard.patch create mode 100644 queue-3.0/hid-add-support-macbookair-4-1-keyboard.patch create mode 100644 queue-3.0/hid-apple-modern-macbook-airs-use-the-standard-apple-function-key-translations.patch create mode 100644 queue-3.0/hid-consolidate-macbookair-4-1-mappings.patch create mode 100644 queue-3.0/hid-hid-apple-add-device-id-of-another-wireless-aluminium.patch create mode 100644 queue-3.0/hid-hid-multitouch-add-lg-display-multitouch-device.patch create mode 100644 queue-3.0/mtd-nand_base-always-initialise-oob_poi-before-writing-oob-data.patch diff --git a/queue-3.0/hid-add-device-ids-for-macbook-pro-8-keyboards.patch b/queue-3.0/hid-add-device-ids-for-macbook-pro-8-keyboards.patch new file mode 100644 index 00000000000..70b576968ff --- /dev/null +++ b/queue-3.0/hid-add-device-ids-for-macbook-pro-8-keyboards.patch @@ -0,0 +1,79 @@ +From 213f9da80533940560bef8fa43b10c590895459c Mon Sep 17 00:00:00 2001 +From: Gökçen Eraslan +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 + +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 +Acked-by: Henrik Rydberg +Signed-off-by: Jiri Kosina +Cc: Chase Douglas +Signed-off-by: Greg Kroah-Hartman + +--- + 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) }, +@@ -1893,6 +1896,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 diff --git a/queue-3.0/hid-add-macbookair4-2-to-hid_have_special_driver.patch b/queue-3.0/hid-add-macbookair4-2-to-hid_have_special_driver.patch new file mode 100644 index 00000000000..8b88a7e4263 --- /dev/null +++ b/queue-3.0/hid-add-macbookair4-2-to-hid_have_special_driver.patch @@ -0,0 +1,31 @@ +From f6f554f09c5b831efdaf67c449e18ca06ee648fe Mon Sep 17 00:00:00 2001 +From: Jiri Kosina +Date: Wed, 10 Aug 2011 14:12:52 +0200 +Subject: HID: add MacBookAir4,2 to hid_have_special_driver[] + +From: Jiri Kosina + +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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) }, diff --git a/queue-3.0/hid-add-support-for-huijia-usb-gamepad-connector.patch b/queue-3.0/hid-add-support-for-huijia-usb-gamepad-connector.patch new file mode 100644 index 00000000000..c7a37117313 --- /dev/null +++ b/queue-3.0/hid-add-support-for-huijia-usb-gamepad-connector.patch @@ -0,0 +1,40 @@ +From 6d1db0777981e1626ae71243984ac300b61789ff Mon Sep 17 00:00:00 2001 +From: Clemens Werther +Date: Thu, 25 Aug 2011 15:35:14 +0200 +Subject: HID: add support for HuiJia USB Gamepad connector + +From: Clemens Werther + +commit 6d1db0777981e1626ae71243984ac300b61789ff upstream. + +Create each gamepad as a separate joystick + +Signed-off-by: Clemens Werther +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/hid-ids.h | 1 + + drivers/hid/usbhid/hid-quirks.c | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -277,6 +277,7 @@ + #define USB_DEVICE_ID_PENPOWER 0x00f4 + + #define USB_VENDOR_ID_GREENASIA 0x0e8f ++#define USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD 0x3013 + + #define USB_VENDOR_ID_GRETAGMACBETH 0x0971 + #define USB_DEVICE_ID_GRETAGMACBETH_HUEY 0x2005 +--- a/drivers/hid/usbhid/hid-quirks.c ++++ b/drivers/hid/usbhid/hid-quirks.c +@@ -47,6 +47,7 @@ static const struct hid_blacklist { + { USB_VENDOR_ID_AFATECH, USB_DEVICE_ID_AFATECH_AF9016, HID_QUIRK_FULLSPEED_INTERVAL }, + + { USB_VENDOR_ID_ETURBOTOUCH, USB_DEVICE_ID_ETURBOTOUCH, HID_QUIRK_MULTI_INPUT }, ++ { USB_VENDOR_ID_GREENASIA, USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD, HID_QUIRK_MULTI_INPUT }, + { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, + { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT }, + { USB_VENDOR_ID_TOUCHPACK, USB_DEVICE_ID_TOUCHPACK_RTS, HID_QUIRK_MULTI_INPUT }, diff --git a/queue-3.0/hid-add-support-for-macbookair4-2-keyboard.patch b/queue-3.0/hid-add-support-for-macbookair4-2-keyboard.patch new file mode 100644 index 00000000000..7a43455d8db --- /dev/null +++ b/queue-3.0/hid-add-support-for-macbookair4-2-keyboard.patch @@ -0,0 +1,60 @@ +From 5d922baa631058c7e37ae33e81c4d3e6437f8d1d Mon Sep 17 00:00:00 2001 +From: "Joshua V. Dillon" +Date: Fri, 5 Aug 2011 12:05:22 -0700 +Subject: HID: add support for MacBookAir4,2 keyboard. + +From: "Joshua V. Dillon" + +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 +Signed-off-by: Chase Douglas +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + 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 diff --git a/queue-3.0/hid-add-support-for-new-revision-of-apple-aluminum-keyboard.patch b/queue-3.0/hid-add-support-for-new-revision-of-apple-aluminum-keyboard.patch new file mode 100644 index 00000000000..6f2a5e01917 --- /dev/null +++ b/queue-3.0/hid-add-support-for-new-revision-of-apple-aluminum-keyboard.patch @@ -0,0 +1,62 @@ +From 4a4c879904aa0cc64629e14a49b64fb3d149bf1a Mon Sep 17 00:00:00 2001 +From: Dan Bastone +Date: Sun, 31 Jul 2011 07:40:49 -0400 +Subject: HID: add support for new revision of Apple aluminum keyboard + +From: Dan Bastone + +commit 4a4c879904aa0cc64629e14a49b64fb3d149bf1a upstream. + +Add USB device ids for the new revision (MB110LL/B) of Apple's wired aluminum +keyboard. I have only confirmed that the ANSI version is correct - it is +assumed that the ISO and JIS versions follow the standard numbering convention. + +Signed-off-by: Dan Bastone +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/hid-apple.c | 6 ++++++ + drivers/hid/hid-core.c | 3 +++ + drivers/hid/hid-ids.h | 3 +++ + 3 files changed, 12 insertions(+) + +--- a/drivers/hid/hid-apple.c ++++ b/drivers/hid/hid-apple.c +@@ -444,6 +444,12 @@ static const struct hid_device_id apple_ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS), + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | + APPLE_RDESC_JIS }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI), ++ .driver_data = APPLE_HAS_FN }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO), ++ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, ++ { 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), + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_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_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) }, + { 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) }, +--- 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_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_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 diff --git a/queue-3.0/hid-add-support-macbookair-4-1-keyboard.patch b/queue-3.0/hid-add-support-macbookair-4-1-keyboard.patch new file mode 100644 index 00000000000..326bac08395 --- /dev/null +++ b/queue-3.0/hid-add-support-macbookair-4-1-keyboard.patch @@ -0,0 +1,99 @@ +From d762cc290b9f17e346f4297fd5984b70ce71ef66 Mon Sep 17 00:00:00 2001 +From: Nobuhiro Iwamatsu +Date: Sat, 1 Oct 2011 15:54:53 +0900 +Subject: HID: Add support MacbookAir 4,1 keyboard + +From: Nobuhiro Iwamatsu + +commit d762cc290b9f17e346f4297fd5984b70ce71ef66 upstream. + +Added USB device IDs and keyboard map for MacBookAir 4,1 keyboard. + +Signed-off-by: Nobuhiro Iwamatsu +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + 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 diff --git a/queue-3.0/hid-apple-modern-macbook-airs-use-the-standard-apple-function-key-translations.patch b/queue-3.0/hid-apple-modern-macbook-airs-use-the-standard-apple-function-key-translations.patch new file mode 100644 index 00000000000..cf89e8f3596 --- /dev/null +++ b/queue-3.0/hid-apple-modern-macbook-airs-use-the-standard-apple-function-key-translations.patch @@ -0,0 +1,41 @@ +From 21404b772a1c65f7b935b8c0fddc388a949f4e31 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +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 + +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 +Cc: Jiri Kosina +Cc: Joshua V Dillon +Cc: Chase Douglas +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/hid-apple.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/hid/hid-apple.c ++++ b/drivers/hid/hid-apple.c +@@ -183,9 +183,6 @@ 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 diff --git a/queue-3.0/hid-consolidate-macbookair-4-1-mappings.patch b/queue-3.0/hid-consolidate-macbookair-4-1-mappings.patch new file mode 100644 index 00000000000..ebb0254fafa --- /dev/null +++ b/queue-3.0/hid-consolidate-macbookair-4-1-mappings.patch @@ -0,0 +1,60 @@ +From da617c7cb915545dda4280df888dd6f8d5697420 Mon Sep 17 00:00:00 2001 +From: Jiri Kosina +Date: Wed, 5 Oct 2011 16:54:45 +0200 +Subject: HID: consolidate MacbookAir 4,1 mappings + +From: Jiri Kosina + +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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 diff --git a/queue-3.0/hid-hid-apple-add-device-id-of-another-wireless-aluminium.patch b/queue-3.0/hid-hid-apple-add-device-id-of-another-wireless-aluminium.patch new file mode 100644 index 00000000000..00fb7bee04a --- /dev/null +++ b/queue-3.0/hid-hid-apple-add-device-id-of-another-wireless-aluminium.patch @@ -0,0 +1,55 @@ +From ad734bc1565364f9e4b70888d3ce5743b3c1030a Mon Sep 17 00:00:00 2001 +From: Andreas Krist +Date: Fri, 28 Oct 2011 18:50:39 +0200 +Subject: HID: hid-apple: add device ID of another wireless aluminium + +From: Andreas Krist + +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 +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + 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 diff --git a/queue-3.0/hid-hid-multitouch-add-lg-display-multitouch-device.patch b/queue-3.0/hid-hid-multitouch-add-lg-display-multitouch-device.patch new file mode 100644 index 00000000000..19ef6015624 --- /dev/null +++ b/queue-3.0/hid-hid-multitouch-add-lg-display-multitouch-device.patch @@ -0,0 +1,69 @@ +From c50bb1a4005630f47b5da26336f74a485033a515 Mon Sep 17 00:00:00 2001 +From: Jeff Brown +Date: Mon, 15 Aug 2011 21:12:09 -0700 +Subject: HID: hid-multitouch: Add LG Display Multitouch device. + +From: Jeff Brown + +commit c50bb1a4005630f47b5da26336f74a485033a515 upstream. + +This panel is also known as the Dell ST2220Tc. + +Signed-off-by: jeffbrown@android.com +Reviewed-By: Benjamin Tissoires +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -314,6 +314,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 +@@ -1398,6 +1398,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 +@@ -423,6 +423,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, diff --git a/queue-3.0/mtd-nand_base-always-initialise-oob_poi-before-writing-oob-data.patch b/queue-3.0/mtd-nand_base-always-initialise-oob_poi-before-writing-oob-data.patch new file mode 100644 index 00000000000..0a87b7239f2 --- /dev/null +++ b/queue-3.0/mtd-nand_base-always-initialise-oob_poi-before-writing-oob-data.patch @@ -0,0 +1,107 @@ +From f722013ee9fd24623df31dec9a91a6d02c3e2f2f Mon Sep 17 00:00:00 2001 +From: "THOMSON, Adam (Adam)" +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)" + +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 for fixing this +patch. + +Signed-off-by: Adam Thomson +Signed-off-by: Artem Bityutskiy +Signed-off-by: Greg Kroah-Hartman + + +--- + 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; diff --git a/queue-3.0/series b/queue-3.0/series index a129a608fc9..3ead79586cc 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -249,3 +249,14 @@ pm-suspend-off-by-one-in-pm_suspend.patch crypto-cryptd-use-subsys_initcall-to-prevent-races-with-aesni.patch dp83640-use-proper-function-to-free-transmit-time-stamping.patch ath9k_hw-fix-regression-of-register-offset-for-ar9003-chips.patch +mtd-nand_base-always-initialise-oob_poi-before-writing-oob-data.patch +hid-add-support-for-new-revision-of-apple-aluminum-keyboard.patch +hid-add-support-for-huijia-usb-gamepad-connector.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 -- 2.47.3