All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Schedel <r.schedel@yahoo.de>
To: Jiri Kosina <jkosina@suse.cz>
Cc: linux-input@vger.kernel.org
Subject: [PATCH] hid: Support 171 byte variant of Samsung USB IR receiver (0419:0001)
Date: Fri, 11 Dec 2009 00:37:11 +0100	[thread overview]
Message-ID: <4B218627.7050006@yahoo.de> (raw)

From: Robert Schedel <r.schedel@yahoo.de>

Extends the existing Samsung USB IrDA (0419:0001) quirk with newly reported 171 byte variant. Refactors duplicate trace call into local helper function.

Signed-off-by: Robert Schedel <r.schedel@yahoo.de>

---
 drivers/hid/hid-samsung.c |   25 +++++++++++++++++++------
  1 file changed, 19 insertions(+), 6 deletions(-)

Hello all,

the attached patch adds support for a new variant of a Samsung USB IR receiver with a 171 byte report descriptor. This variant seems to have a similar array min/max quirk as other variants added to hid-samsung before.

The original bug report for the new variant is available at the second half of this ticket page:

  https://bugs.launchpad.net/bugs/326986

Patch applies to kernel 2.6.32.

Regards,
Robert Schedel

diff -rupN linux-2.6.32-orig/drivers/hid/hid-samsung.c linux-2.6.32/drivers/hid/hid-samsung.c
--- linux-2.6.32-orig/drivers/hid/hid-samsung.c	2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32/drivers/hid/hid-samsung.c	2009-12-10 23:20:07.633321274 +0100
@@ -39,7 +39,17 @@
  *
  * 3. 135 byte report descriptor
  * Report #4 has an array field with logical range 0..17 instead of 1..14.
+ *
+ * 4. 171 byte report descriptor
+ * Report #3 has an array field with logical range 0..1 instead of 1..3.
  */
+static inline void samsung_dev_trace(struct hid_device *hdev,
+		unsigned int rsize)
+{
+	dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report "
+			"descriptor\n", rsize);
+}
+
 static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		unsigned int rsize)
 {
@@ -47,8 +57,7 @@ static void samsung_report_fixup(struct 
 			rdesc[177] == 0x75 && rdesc[178] == 0x30 &&
 			rdesc[179] == 0x95 && rdesc[180] == 0x01 &&
 			rdesc[182] == 0x40) {
-		dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report "
-				"descriptor\n", 184);
+		samsung_dev_trace(hdev, 184);
 		rdesc[176] = 0xff;
 		rdesc[178] = 0x08;
 		rdesc[180] = 0x06;
@@ -56,17 +65,21 @@ static void samsung_report_fixup(struct 
 	} else
 	if (rsize == 203 && rdesc[192] == 0x15 && rdesc[193] == 0x0 &&
 			rdesc[194] == 0x25 && rdesc[195] == 0x12) {
-		dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report "
-				"descriptor\n", 203);
+		samsung_dev_trace(hdev, 203);
 		rdesc[193] = 0x1;
 		rdesc[195] = 0xf;
 	} else
 	if (rsize == 135 && rdesc[124] == 0x15 && rdesc[125] == 0x0 &&
 			rdesc[126] == 0x25 && rdesc[127] == 0x11) {
-		dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report "
-				"descriptor\n", 135);
+		samsung_dev_trace(hdev, 135);
 		rdesc[125] = 0x1;
 		rdesc[127] = 0xe;
+	} else
+	if (rsize == 171 && rdesc[160] == 0x15 && rdesc[161] == 0x0 &&
+			rdesc[162] == 0x25 && rdesc[163] == 0x01) {
+		samsung_dev_trace(hdev, 171);
+		rdesc[161] = 0x1;
+		rdesc[163] = 0x3;
 	}
 }
 

             reply	other threads:[~2009-12-10 23:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-10 23:37 Robert Schedel [this message]
2009-12-11 10:01 ` [PATCH] hid: Support 171 byte variant of Samsung USB IR receiver (0419:0001) Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B218627.7050006@yahoo.de \
    --to=r.schedel@yahoo.de \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.