]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.5-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Aug 2012 15:38:31 +0000 (08:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Aug 2012 15:38:31 +0000 (08:38 -0700)
added patches:
hid-hid-multitouch-fix-input-mode-feature-command.patch

queue-3.5/hid-hid-multitouch-fix-input-mode-feature-command.patch [new file with mode: 0644]
queue-3.5/series

diff --git a/queue-3.5/hid-hid-multitouch-fix-input-mode-feature-command.patch b/queue-3.5/hid-hid-multitouch-fix-input-mode-feature-command.patch
new file mode 100644 (file)
index 0000000..fbec82e
--- /dev/null
@@ -0,0 +1,67 @@
+From 4aceed37e315e8eaa26cb4c8dfd619a32fa24669 Mon Sep 17 00:00:00 2001
+From: Benjamin Tissoires <benjamin.tissoires@enac.fr>
+Date: Tue, 19 Jun 2012 14:39:52 +0200
+Subject: HID: hid-multitouch: fix input mode feature command
+
+From: Benjamin Tissoires <benjamin.tissoires@enac.fr>
+
+commit 4aceed37e315e8eaa26cb4c8dfd619a32fa24669 upstream.
+
+Zytronic panels shows a new way of setting the Input Mode feature.
+This feature is put in the second usage in the HID feature, instead
+of the first, as the majority of the multitouch devices.
+
+This patch adds a detection step when the feature is presented to know
+where the feature is located in the report. We can then trigger the right
+command to the device. This removes the magic number "0" in the function
+mt_set_input_mode.
+
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Cc: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hid/hid-multitouch.c |   13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+--- a/drivers/hid/hid-multitouch.c
++++ b/drivers/hid/hid-multitouch.c
+@@ -83,6 +83,7 @@ struct mt_device {
+       unsigned last_field_index;      /* last field index of the report */
+       unsigned last_slot_field;       /* the last field of a slot */
+       __s8 inputmode;         /* InputMode HID feature, -1 if non-existent */
++      __s8 inputmode_index;   /* InputMode HID feature index in the report */
+       __s8 maxcontact_report_id;      /* Maximum Contact Number HID feature,
+                                  -1 if non-existent */
+       __u8 num_received;      /* how many contacts we received */
+@@ -260,10 +261,20 @@ static void mt_feature_mapping(struct hi
+               struct hid_field *field, struct hid_usage *usage)
+ {
+       struct mt_device *td = hid_get_drvdata(hdev);
++      int i;
+       switch (usage->hid) {
+       case HID_DG_INPUTMODE:
+               td->inputmode = field->report->id;
++              td->inputmode_index = 0; /* has to be updated below */
++
++              for (i=0; i < field->maxusage; i++) {
++                      if (field->usage[i].hid == usage->hid) {
++                              td->inputmode_index = i;
++                              break;
++                      }
++              }
++
+               break;
+       case HID_DG_CONTACTMAX:
+               td->maxcontact_report_id = field->report->id;
+@@ -618,7 +629,7 @@ static void mt_set_input_mode(struct hid
+       re = &(hdev->report_enum[HID_FEATURE_REPORT]);
+       r = re->report_id_hash[td->inputmode];
+       if (r) {
+-              r->field[0]->value[0] = 0x02;
++              r->field[0]->value[td->inputmode_index] = 0x02;
+               usbhid_submit_report(hdev, r, USB_DIR_OUT);
+       }
+ }
index 798706560c9e4197263deb9fd893f62039ba8a96..83c8507f2c03d191bdad8de67c5145b58ab60b72 100644 (file)
@@ -24,3 +24,4 @@ asoc-wm8962-redo-early-init-of-the-part-on-resume.patch
 alsa-hda-add-support-for-realtek-alc282.patch
 alsa-hda-turn-on-pin_out-from-hdmi-playback-prepare.patch
 alsa-hda-don-t-power-up-when-not-powered-down.patch
+hid-hid-multitouch-fix-input-mode-feature-command.patch