diff mbox

Posiflex 0d3a:a000 touchscreen press not recognized in kernel 3.9.4

Message ID 51C1D4C8.5040201@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benjamin Tissoires June 19, 2013, 3:56 p.m. UTC
Hi Jan,

On 06/19/2013 11:23 AM, Jan Kandziora wrote:
> Am 19.06.2013 09:50, schrieb Benjamin Tissoires:
>>
>> Ok, I will need at least the dmesg log and the output of hid-recorder
>> [1] if your device is handled through hid-generic.
>> Hid-replay will then allow me to virtually plug your device on my
>> laptop so that I can replay and find out why the btn_left events are
>> not emitted anymore.
>>
> Logs are attached. I've first pressed onto the center of the touch, then
> onto the lower right corner, then drawn a wave line from upper left to
> lower left, then from lower left to upper right.
> 
> Thanks for your help.
> 
> 	Jan
> 

Thanks for the logs. The problem comes from a commit introduced in 3.3 which discards the BTN_LEFT information.

If possible, can you apply and test the following patch?

Cheers,
Benjamin

From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Date: Wed, 19 Jun 2013 17:49:05 +0200
Subject: [PATCH] HID: input: fix false positive out of range values

Commit 6da7066906e977d42104a859c490f5f9a300488c introduced in 3.3
"HID: ignore absolute values which don't fit between logical min and max"
prevents some Posiflex touch screen to work because they do not provide
logical min and max for their buttons.
Thus, logical min and max are at 0, discarding the buttons events, and
preventing the device to report appropriate X Y.

Adding a check on "min < max" solves the problem.

Reported-by: Jan Kandziora <jjj@gmx.de>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
 drivers/hid/hid-input.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jan Kandziora June 19, 2013, 4:42 p.m. UTC | #1
Am 19.06.2013 17:56, schrieb Benjamin Tissoires:
> 
> Thanks for the logs. The problem comes from a commit introduced in 3.3 which discards the BTN_LEFT information.
> 
> If possible, can you apply and test the following patch?
> 
It works. Many thanks for making a patch that quick.

Kind regards

	Jan
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiri Kosina June 19, 2013, 9:54 p.m. UTC | #2
On Wed, 19 Jun 2013, Benjamin Tissoires wrote:

> From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Date: Wed, 19 Jun 2013 17:49:05 +0200
> Subject: [PATCH] HID: input: fix false positive out of range values
> 
> Commit 6da7066906e977d42104a859c490f5f9a300488c introduced in 3.3
> "HID: ignore absolute values which don't fit between logical min and max"
> prevents some Posiflex touch screen to work because they do not provide
> logical min and max for their buttons.
> Thus, logical min and max are at 0, discarding the buttons events, and
> preventing the device to report appropriate X Y.
> 
> Adding a check on "min < max" solves the problem.
> 
> Reported-by: Jan Kandziora <jjj@gmx.de>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Thanks. I am applying this with Jan's Tested-by: (and I am also extending 
the comnent preceeding the condition to better explain this case).
diff mbox

Patch

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index c526a3c..930f1bb 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1045,6 +1045,7 @@  void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
 	 * section 5.10 and 6.2.25
 	 */
 	if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
+	    (field->logical_minimum < field->logical_maximum) &&
 	    (value < field->logical_minimum ||
 	     value > field->logical_maximum)) {
 		dbg_hid("Ignoring out-of-range value %x\n", value);