LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Philippe Troin <phil@fifi.org>
To: linux-kernel@vger.kernel.org
Cc: jkosina@suse.cz
Subject: Re: USB HID: Missing keys on Gyration Media Center Universal Remote Control
Date: 16 Jun 2008 16:31:56 -0700	[thread overview]
Message-ID: <871w2xnehf.fsf@old-tantale.fifi.org> (raw)

Jiri & all,

What's the status on this bug?

I used this patch for 2.6.24:

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 0b27da7..fc6e77e 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -802,6 +802,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		case HID_UP_LOGIVENDOR:
 			set_bit(EV_REP, input->evbit);
 			switch(usage->hid & HID_USAGE) {
+				case 0x000: map_key_clear(KEY_TV);
 				/* Reported on Logitech Ultra X Media Remote */
 				case 0x004: map_key_clear(KEY_AGAIN);		break;
 				case 0x00d: map_key_clear(KEY_HOME);		break;
@@ -1039,6 +1040,28 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
 		return;
 	}
 
+	/* "Sleep" key */
+	if (hid->vendor == 0x0c16 && hid->product == 0x0002 &&
+			((usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK) &&
+			((usage->hid & 0xf0) == 0x80)  &&
+			((usage->hid & 0xf) == 0x2)) {
+		input_event(input, usage->type, usage->code, 1);
+		input_sync(input);
+		input_event(input, usage->type, usage->code, 0);
+		input_sync(input);
+		return;
+	}
+	/* "TV" key */
+	if (hid->vendor == 0x0c16 && hid->product == 0x0002 &&
+			((usage->hid & HID_USAGE_PAGE) == HID_UP_LOGIVENDOR) &&
+			((usage->hid & HID_USAGE) == 0x0000)) {
+		input_event(input, usage->type, usage->code, 1);
+		input_sync(input);
+		input_event(input, usage->type, usage->code, 0);
+		input_sync(input);
+		return;
+	}
+
 	/* Handling MS keyboards special buttons */
 	if (IS_MS_KB(hid) && usage->hid == (HID_UP_MSVENDOR | 0xff05)) {
 		int key = 0;


It was working fine.

With 2.6.25.6, I've been trying to use the following patch.  It's a
slight modification of a patch posted previously by Jiri.

diff -ru vanilla.orig/drivers/hid/hid-input-quirks.c vanilla/drivers/hid/hid-input-quirks.c
--- vanilla.orig/drivers/hid/hid-input-quirks.c	2008-04-16 19:49:44.000000000 -0700
+++ vanilla/drivers/hid/hid-input-quirks.c	2008-06-09 14:47:01.000000000 -0700
@@ -418,6 +418,27 @@
 		input_event(input, usage->type, REL_WHEEL, -value);
 		return 1;
 	}
+	/* "Sleep" key */
+	if (hid->vendor == 0x0c16 && hid->product == 0x0002 &&
+	    (usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK &&
+	    (usage->hid & 0xf0) == 0x80 &&
+	    (usage->hid & 0xf) == 0x2) {
+		input_event(input, usage->type, usage->code, 1);
+		input_sync(input);
+		input_event(input, usage->type, usage->code, 0);
+		input_sync(input);
+		return 0;
+	}
+	/* "TV" key */
+	if (hid->vendor == 0x0c16 && hid->product == 0x0002 &&
+	    (usage->hid & HID_USAGE_PAGE) == HID_UP_LOGIVENDOR &&
+	    (usage->hid & HID_USAGE) == 0x0000) {
+		input_event(input, usage->type, usage->code, 1);
+		input_sync(input);
+		input_event(input, usage->type, usage->code, 0);
+		input_sync(input);
+		return 0;
+	}
 	return 0;
 }
 
diff -ru vanilla.orig/drivers/hid/hid-input.c vanilla/drivers/hid/hid-input.c
--- vanilla.orig/drivers/hid/hid-input.c	2008-04-16 19:49:44.000000000 -0700
+++ vanilla/drivers/hid/hid-input.c	2008-06-09 14:49:43.000000000 -0700
@@ -724,7 +724,12 @@
 
 		case HID_UP_LOGIVENDOR:
 
-			goto ignore;
+		  set_bit(EV_REP, input->evbit);
+		  switch(usage->hid & HID_USAGE) {
+		  	case 0x027: map_key_clear(KEY_TV); break;
+		  	default: goto ignore;
+		  };
+		  break;
 		
 		case HID_UP_PID:
 

However this patch does not seem to work at all:

 * the Power button keeps repeating the power key once pressed

 * the home (windows MCE green button) and the four keys below it
   (shortcuts to movies, music, photos, tv) do not work.

Is there anything I can help with to get a working patch?

Thanks,
Phil.

             reply	other threads:[~2008-06-17  0:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-16 23:31 Philippe Troin [this message]
2008-06-17 14:00 ` Jiri Kosina
2008-06-17 16:34   ` Philippe Troin
2008-06-18  9:40 ` Jiri Kosina
2008-06-19 20:48   ` Philippe Troin
2008-08-01  0:28     ` Philippe Troin
2008-08-01  9:29       ` Jiri Kosina
  -- strict thread matches above, loose matches on Subject: below --
2007-12-28 16:48 Adolfo R. Brandes
2008-01-09 14:12 ` Jiri Kosina
2008-01-09 17:53   ` Adolfo R. Brandes
2008-01-17 13:26 ` Jiri Kosina
2008-01-18 17:01   ` Adolfo R. Brandes
2008-01-18 17:58     ` Adolfo R. Brandes
2008-02-11 20:17       ` Jiri Kosina
2008-02-12 13:23         ` Adolfo R. Brandes
2008-02-12 15:09           ` Adolfo R. Brandes
2008-02-19 12:43             ` Jiri Kosina
2008-02-19 13:04               ` 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=871w2xnehf.fsf@old-tantale.fifi.org \
    --to=phil@fifi.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: USB HID: Missing keys on Gyration Media Center Universal Remote Control' \
    /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

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