From: Greg Kroah-Hartman Date: Mon, 2 Dec 2013 17:50:43 +0000 (-0800) Subject: 3.4-stable patches X-Git-Tag: v3.4.72~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0791ea34c00168714774f76473424d8a411bc903;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: hid-apple-option-to-swap-the-option-alt-and-command-flag-keys.patch hid-roccat-fix-coverity-cid-141438.patch --- diff --git a/queue-3.4/hid-apple-option-to-swap-the-option-alt-and-command-flag-keys.patch b/queue-3.4/hid-apple-option-to-swap-the-option-alt-and-command-flag-keys.patch new file mode 100644 index 00000000000..bf736e34631 --- /dev/null +++ b/queue-3.4/hid-apple-option-to-swap-the-option-alt-and-command-flag-keys.patch @@ -0,0 +1,68 @@ +From 43c831468b3d26dbe8f2e061ccaf1abaf9cc1b8b Mon Sep 17 00:00:00 2001 +From: Nanno Langstraat +Date: Mon, 14 Oct 2013 16:07:15 +0200 +Subject: HID: apple: option to swap the 'Option' ("Alt") and 'Command' ("Flag") keys. + +From: Nanno Langstraat + +commit 43c831468b3d26dbe8f2e061ccaf1abaf9cc1b8b upstream. + +Use case: people who use both Apple and PC keyboards regularly, and desire to +keep&use their PC muscle memory. + +A particular use case: an Apple compact external keyboard connected to a PC +laptop. (This use case can't be covered well by X.org key remappings etc.) + +Signed-off-by: Nanno Langstraat +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/hid-apple.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +--- a/drivers/hid/hid-apple.c ++++ b/drivers/hid/hid-apple.c +@@ -48,6 +48,12 @@ module_param(iso_layout, uint, 0644); + MODULE_PARM_DESC(iso_layout, "Enable/Disable hardcoded ISO-layout of the keyboard. " + "(0 = disabled, [1] = enabled)"); + ++static unsigned int swap_opt_cmd = 0; ++module_param(swap_opt_cmd, uint, 0644); ++MODULE_PARM_DESC(swap_opt_cmd, "Swap the Option (\"Alt\") and Command (\"Flag\") keys. " ++ "(For people who want to keep Windows PC keyboard muscle memory. " ++ "[0] = as-is, Mac layout. 1 = swapped, Windows layout.)"); ++ + struct apple_sc { + unsigned long quirks; + unsigned int fn_on; +@@ -152,6 +158,14 @@ static const struct apple_key_translatio + { } + }; + ++static const struct apple_key_translation swapped_option_cmd_keys[] = { ++ { KEY_LEFTALT, KEY_LEFTMETA }, ++ { KEY_LEFTMETA, KEY_LEFTALT }, ++ { KEY_RIGHTALT, KEY_RIGHTMETA }, ++ { KEY_RIGHTMETA,KEY_RIGHTALT }, ++ { } ++}; ++ + static const struct apple_key_translation *apple_find_translation( + const struct apple_key_translation *table, u16 from) + { +@@ -244,6 +258,14 @@ static int hidinput_apple_event(struct h + } + } + ++ if (swap_opt_cmd) { ++ trans = apple_find_translation(swapped_option_cmd_keys, usage->code); ++ if (trans) { ++ input_event(input, usage->type, trans->to, value); ++ return 1; ++ } ++ } ++ + return 0; + } + diff --git a/queue-3.4/hid-roccat-fix-coverity-cid-141438.patch b/queue-3.4/hid-roccat-fix-coverity-cid-141438.patch new file mode 100644 index 00000000000..36cdf839ddb --- /dev/null +++ b/queue-3.4/hid-roccat-fix-coverity-cid-141438.patch @@ -0,0 +1,35 @@ +From 7be63f20b00840a6f1c718dcee00855688d64acd Mon Sep 17 00:00:00 2001 +From: Stefan Achatz +Date: Sun, 3 Nov 2013 06:25:33 +0100 +Subject: HID: roccat: fix Coverity CID 141438 + +From: Stefan Achatz + +commit 7be63f20b00840a6f1c718dcee00855688d64acd upstream. + +Add missing switch breaks. + +Signed-off-by: Stefan Achatz +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/hid-roccat-kovaplus.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/hid/hid-roccat-kovaplus.c ++++ b/drivers/hid/hid-roccat-kovaplus.c +@@ -623,9 +623,13 @@ static void kovaplus_keep_values_up_to_d + break; + case KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI: + kovaplus->actual_cpi = kovaplus_convert_event_cpi(button_report->data1); ++ break; + case KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY: + kovaplus->actual_x_sensitivity = button_report->data1; + kovaplus->actual_y_sensitivity = button_report->data2; ++ break; ++ default: ++ break; + } + } + diff --git a/queue-3.4/series b/queue-3.4/series index 82bc49b9b53..3e6e0e75fad 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -56,3 +56,5 @@ kvm-perform-an-invalid-memslot-step-for-gpa-base-change.patch kvm-fix-iommu-map-unmap-to-handle-memory-slot-moves.patch ftrace-fix-function-graph-with-loading-of-modules.patch media-lirc_zilog-don-t-use-dynamic-static-allocation.patch +hid-roccat-fix-coverity-cid-141438.patch +hid-apple-option-to-swap-the-option-alt-and-command-flag-keys.patch