]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Dec 2013 17:50:43 +0000 (09:50 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Dec 2013 17:50:43 +0000 (09:50 -0800)
added patches:
hid-apple-option-to-swap-the-option-alt-and-command-flag-keys.patch
hid-roccat-fix-coverity-cid-141438.patch

queue-3.4/hid-apple-option-to-swap-the-option-alt-and-command-flag-keys.patch [new file with mode: 0644]
queue-3.4/hid-roccat-fix-coverity-cid-141438.patch [new file with mode: 0644]
queue-3.4/series

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 (file)
index 0000000..bf736e3
--- /dev/null
@@ -0,0 +1,68 @@
+From 43c831468b3d26dbe8f2e061ccaf1abaf9cc1b8b Mon Sep 17 00:00:00 2001
+From: Nanno Langstraat <langstr@gmail.com>
+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 <langstr@gmail.com>
+
+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 <langstr@gmail.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..36cdf83
--- /dev/null
@@ -0,0 +1,35 @@
+From 7be63f20b00840a6f1c718dcee00855688d64acd Mon Sep 17 00:00:00 2001
+From: Stefan Achatz <erazor_de@users.sourceforge.net>
+Date: Sun, 3 Nov 2013 06:25:33 +0100
+Subject: HID: roccat: fix Coverity CID 141438
+
+From: Stefan Achatz <erazor_de@users.sourceforge.net>
+
+commit 7be63f20b00840a6f1c718dcee00855688d64acd upstream.
+
+Add missing switch breaks.
+
+Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
+       }
+ }
index 82bc49b9b53f931d72cd0a0fd3d784b032516da5..3e6e0e75fad42af5f09a9d02bd0f521f540a0149 100644 (file)
@@ -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