linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix for N-trig touch panel with recent firmware
@ 2010-04-06 20:22 Stephane Chatty
  2010-04-06 20:28 ` Rafi Rubin
  2010-04-06 21:06 ` Jiri Kosina
  0 siblings, 2 replies; 4+ messages in thread
From: Stephane Chatty @ 2010-04-06 20:22 UTC (permalink / raw)
  To: linux-input, jkosina; +Cc: micki, rafi, dmitry.torokhov, chatty

Added an init message that avoids device freeze with recent firmware.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Rafi Rubin <rafi@seas.upenn.edu>

diff -rupN a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
--- a/drivers/hid/hid-ntrig.c	2010-03-20 02:17:57.000000000 +0100
+++ b/drivers/hid/hid-ntrig.c	2010-04-02 01:06:11.000000000 +0200
@@ -1,8 +1,8 @@
 /*
  *  HID driver for N-Trig touchscreens
  *
- *  Copyright (c) 2008 Rafi Rubin
- *  Copyright (c) 2009 Stephane Chatty
+ *  Copyright (c) 2008-2010 Rafi Rubin
+ *  Copyright (c) 2009-2010 Stephane Chatty
  *
  */
 
@@ -16,6 +16,8 @@
 #include <linux/device.h>
 #include <linux/hid.h>
 #include <linux/module.h>
+#include <linux/usb.h>
+#include "usbhid/usbhid.h"
 
 #include "hid-ids.h"
 
@@ -285,6 +287,7 @@ static int ntrig_probe(struct hid_device
 	struct ntrig_data *nd;
 	struct hid_input *hidinput;
 	struct input_dev *input;
+	struct hid_report *report;
 
 	if (id->driver_data)
 		hdev->quirks |= HID_QUIRK_MULTI_INPUT;
@@ -348,6 +351,11 @@ static int ntrig_probe(struct hid_device
 		}
 	}
 
+	report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0x0a]; 
+	if (report)
+		usbhid_submit_report(hdev, report, USB_DIR_OUT);
+
+
 	return 0;
 err_free:
 	kfree(nd);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix for N-trig touch panel with recent firmware
  2010-04-06 20:22 [PATCH] Fix for N-trig touch panel with recent firmware Stephane Chatty
@ 2010-04-06 20:28 ` Rafi Rubin
  2010-04-06 21:06 ` Jiri Kosina
  1 sibling, 0 replies; 4+ messages in thread
From: Rafi Rubin @ 2010-04-06 20:28 UTC (permalink / raw)
  To: Stephane Chatty; +Cc: linux-input, jkosina, micki, dmitry.torokhov, chatty

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I can confirm I tested this patch.  On a side note, Micki, you are quite right,
sending the reports does need to come after starting the device.

Rafi

Stephane Chatty wrote:
> Added an init message that avoids device freeze with recent firmware.
> 
> Signed-off-by: Stephane Chatty <chatty@enac.fr>
> Tested-by: Rafi Rubin <rafi@seas.upenn.edu>
> 
> diff -rupN a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
> --- a/drivers/hid/hid-ntrig.c	2010-03-20 02:17:57.000000000 +0100
> +++ b/drivers/hid/hid-ntrig.c	2010-04-02 01:06:11.000000000 +0200
> @@ -1,8 +1,8 @@
>  /*
>   *  HID driver for N-Trig touchscreens
>   *
> - *  Copyright (c) 2008 Rafi Rubin
> - *  Copyright (c) 2009 Stephane Chatty
> + *  Copyright (c) 2008-2010 Rafi Rubin
> + *  Copyright (c) 2009-2010 Stephane Chatty
>   *
>   */
>  
> @@ -16,6 +16,8 @@
>  #include <linux/device.h>
>  #include <linux/hid.h>
>  #include <linux/module.h>
> +#include <linux/usb.h>
> +#include "usbhid/usbhid.h"
>  
>  #include "hid-ids.h"
>  
> @@ -285,6 +287,7 @@ static int ntrig_probe(struct hid_device
>  	struct ntrig_data *nd;
>  	struct hid_input *hidinput;
>  	struct input_dev *input;
> +	struct hid_report *report;
>  
>  	if (id->driver_data)
>  		hdev->quirks |= HID_QUIRK_MULTI_INPUT;
> @@ -348,6 +351,11 @@ static int ntrig_probe(struct hid_device
>  		}
>  	}
>  
> +	report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0x0a]; 
> +	if (report)
> +		usbhid_submit_report(hdev, report, USB_DIR_OUT);
> +
> +
>  	return 0;
>  err_free:
>  	kfree(nd);
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAku7mVAACgkQwuRiAT9o609EcACdHm83W1+a78Cudgg0Hn2bXNV/
FzgAnipS24BjtTvTi691db4NzPcViZqx
=AIfV
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix for N-trig touch panel with recent firmware
  2010-04-06 20:22 [PATCH] Fix for N-trig touch panel with recent firmware Stephane Chatty
  2010-04-06 20:28 ` Rafi Rubin
@ 2010-04-06 21:06 ` Jiri Kosina
  2010-04-06 21:12   ` Stéphane Chatty
  1 sibling, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2010-04-06 21:06 UTC (permalink / raw)
  To: Stephane Chatty; +Cc: linux-input, micki, rafi, dmitry.torokhov, chatty

On Tue, 6 Apr 2010, Stephane Chatty wrote:

> Added an init message that avoids device freeze with recent firmware.
> 
> Signed-off-by: Stephane Chatty <chatty@enac.fr>
> Tested-by: Rafi Rubin <rafi@seas.upenn.edu>
> 
> diff -rupN a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
> --- a/drivers/hid/hid-ntrig.c	2010-03-20 02:17:57.000000000 +0100
> +++ b/drivers/hid/hid-ntrig.c	2010-04-02 01:06:11.000000000 +0200
> @@ -1,8 +1,8 @@
>  /*
>   *  HID driver for N-Trig touchscreens
>   *
> - *  Copyright (c) 2008 Rafi Rubin
> - *  Copyright (c) 2009 Stephane Chatty
> + *  Copyright (c) 2008-2010 Rafi Rubin
> + *  Copyright (c) 2009-2010 Stephane Chatty
>   *
>   */
>  
> @@ -16,6 +16,8 @@
>  #include <linux/device.h>
>  #include <linux/hid.h>
>  #include <linux/module.h>
> +#include <linux/usb.h>
> +#include "usbhid/usbhid.h"
>  
>  #include "hid-ids.h"
>  
> @@ -285,6 +287,7 @@ static int ntrig_probe(struct hid_device
>  	struct ntrig_data *nd;
>  	struct hid_input *hidinput;
>  	struct input_dev *input;
> +	struct hid_report *report;
>  
>  	if (id->driver_data)
>  		hdev->quirks |= HID_QUIRK_MULTI_INPUT;
> @@ -348,6 +351,11 @@ static int ntrig_probe(struct hid_device
>  		}
>  	}
>  
> +	report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0x0a]; 
> +	if (report)
> +		usbhid_submit_report(hdev, report, USB_DIR_OUT);
> +
> +

Thanks guys, I have queued the patch in my tree.

I will also put a one-line comment above this chunk of code to explain why 
is it actually needed, if you don't mind.

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix for N-trig touch panel with recent firmware
  2010-04-06 21:06 ` Jiri Kosina
@ 2010-04-06 21:12   ` Stéphane Chatty
  0 siblings, 0 replies; 4+ messages in thread
From: Stéphane Chatty @ 2010-04-06 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, Micki Balanga, Rafi Rubin, Dmitry Torokhov


Le 6 avr. 10 à 23:06, Jiri Kosina a écrit :
>>
>> +	report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash 
>> [0x0a];
>> +	if (report)
>> +		usbhid_submit_report(hdev, report, USB_DIR_OUT);
>> +
>> +
>
> Thanks guys, I have queued the patch in my tree.
>
> I will also put a one-line comment above this chunk of code to  
> explain why
> is it actually needed, if you don't mind.

Thanks, and sorry for forgetting the comment.

St.

--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-06 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-06 20:22 [PATCH] Fix for N-trig touch panel with recent firmware Stephane Chatty
2010-04-06 20:28 ` Rafi Rubin
2010-04-06 21:06 ` Jiri Kosina
2010-04-06 21:12   ` Stéphane Chatty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).