linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hid: gyration remote support
@ 2008-07-01 16:24 Daniel Walker
  2008-07-01 16:24 ` [PATCH] hid: gyration sleep button quirk Daniel Walker
  2008-07-03 16:17 ` Jiri Kosina
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Walker @ 2008-07-01 16:24 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Philippe Troin, Adolfo R. Brandes, linux-input

This adds in a quirk for the additional un-mapped buttons on the
gyration MCE remote.

Defines are now alphabetical.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
---
 drivers/hid/hid-input-quirks.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c
index 4c2052c..e6a937a 100644
--- a/drivers/hid/hid-input-quirks.c
+++ b/drivers/hid/hid-input-quirks.c
@@ -89,6 +89,29 @@ static int quirk_logitech_ultrax_remote(struct hid_usage *usage, struct input_de
 	return 1;
 }
 
+static int quirk_gyration_remote(struct hid_usage *usage, struct input_dev *input,
+			      unsigned long **bit, int *max)
+{
+	if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
+		return 0;
+
+	set_bit(EV_REP, input->evbit);
+	switch(usage->hid & HID_USAGE) {
+		/* Reported on Gyration MCE Remote */
+		case 0x00d: map_key_clear(KEY_HOME);		break;
+		case 0x024: map_key_clear(KEY_DVD);		break;
+		case 0x025: map_key_clear(KEY_PVR);		break;
+		case 0x046: map_key_clear(KEY_MEDIA);		break;
+		case 0x047: map_key_clear(KEY_MP3);		break;
+		case 0x049: map_key_clear(KEY_CAMERA);		break;
+		case 0x04a: map_key_clear(KEY_VIDEO);		break;
+
+		default:
+			return 0;
+	}
+	return 1;
+}
+
 static int quirk_chicony_tactical_pad(struct hid_usage *usage, struct input_dev *input,
 			      unsigned long **bit, int *max)
 {
@@ -303,6 +326,9 @@ static int quirk_sunplus_wdesktop(struct hid_usage *usage, struct input_dev *inp
 #define VENDOR_ID_EZKEY				0x0518
 #define DEVICE_ID_BTC_8193			0x0002
 
+#define VENDOR_ID_GYRATION			0x0c16
+#define DEVICE_ID_GYRATION_REMOTE		0x0002
+
 #define VENDOR_ID_LOGITECH			0x046d
 #define DEVICE_ID_LOGITECH_RECEIVER		0xc101
 #define DEVICE_ID_S510_RECEIVER			0xc50c
@@ -337,6 +363,8 @@ static const struct hid_input_blacklist {
 
 	{ VENDOR_ID_EZKEY, DEVICE_ID_BTC_8193, quirk_btc_8193 },
 
+	{ VENDOR_ID_GYRATION, DEVICE_ID_GYRATION_REMOTE, quirk_gyration_remote },
+
 	{ VENDOR_ID_LOGITECH, DEVICE_ID_LOGITECH_RECEIVER, quirk_logitech_ultrax_remote },
 	{ VENDOR_ID_LOGITECH, DEVICE_ID_S510_RECEIVER, quirk_logitech_wireless },
 	{ VENDOR_ID_LOGITECH, DEVICE_ID_S510_RECEIVER_2, quirk_logitech_wireless },
-- 
1.5.5.1.1.g0dfaf8



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

* [PATCH] hid: gyration sleep button quirk
  2008-07-01 16:24 [PATCH] hid: gyration remote support Daniel Walker
@ 2008-07-01 16:24 ` Daniel Walker
  2008-07-03 16:17 ` Jiri Kosina
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Walker @ 2008-07-01 16:24 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Philippe Troin, Adolfo R. Brandes, linux-input

This patch is based on one provided by Jiri Kosina to handle the sleep
button. I just added some cleanup and integrated it into my series.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
---
 drivers/hid/hid-input-quirks.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c
index e6a937a..16feea0 100644
--- a/drivers/hid/hid-input-quirks.c
+++ b/drivers/hid/hid-input-quirks.c
@@ -466,6 +466,18 @@ int hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struc
 		input_event(input, usage->type, REL_WHEEL, -value);
 		return 1;
 	}
+
+	/* Gyration MCE remote "Sleep" key */
+	if (hid->vendor == VENDOR_ID_GYRATION &&
+	    hid->product == DEVICE_ID_GYRATION_REMOTE &&
+	    (usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK &&
+	    (usage->hid & 0xff) == 0x82) {
+		input_event(input, usage->type, usage->code, 1);
+		input_sync(input);
+		input_event(input, usage->type, usage->code, 0);
+		input_sync(input);
+		return 1;
+	}
 	return 0;
 }
 
-- 
1.5.5.1.1.g0dfaf8


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

* Re: [PATCH] hid: gyration sleep button quirk
  2008-07-01 16:24 [PATCH] hid: gyration remote support Daniel Walker
  2008-07-01 16:24 ` [PATCH] hid: gyration sleep button quirk Daniel Walker
@ 2008-07-03 16:17 ` Jiri Kosina
  2008-07-03 16:33   ` Daniel Walker
  1 sibling, 1 reply; 5+ messages in thread
From: Jiri Kosina @ 2008-07-03 16:17 UTC (permalink / raw)
  To: Daniel Walker; +Cc: Philippe Troin, Adolfo R. Brandes, linux-input

On Tue, 1 Jul 2008, Daniel Walker wrote:

> This patch is based on one provided by Jiri Kosina to handle the sleep
> button. I just added some cleanup and integrated it into my series.
>
> Signed-off-by: Daniel Walker <dwalker@mvista.com>
> ---
> drivers/hid/hid-input-quirks.c |   12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
[ ... ]

On Tue, 1 Jul 2008, Daniel Walker wrote:

> This adds in a quirk for the additional un-mapped buttons on the
> gyration MCE remote.
>
> Defines are now alphabetical.
>
> Signed-off-by: Daniel Walker <dwalker@mvista.com>

Hi Daniel,

thanks a lot. Could you please fold these two patches into one, and send 
it to me? I will then merge it into my tree.
I don't think there is a reason to have this split into two separate 
patches.

Thanks,

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH] hid: gyration sleep button quirk
  2008-07-03 16:17 ` Jiri Kosina
@ 2008-07-03 16:33   ` Daniel Walker
  2008-07-04 12:46     ` Jiri Kosina
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2008-07-03 16:33 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Philippe Troin, Adolfo R. Brandes, linux-input


On Thu, 2008-07-03 at 18:17 +0200, Jiri Kosina wrote:

> Hi Daniel,
> 
> thanks a lot. Could you please fold these two patches into one, and send 
> it to me? I will then merge it into my tree.
> I don't think there is a reason to have this split into two separate 
> patches.

They're split due to authorship .. The second patch is largely your
work ..

Daniel


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

* Re: [PATCH] hid: gyration sleep button quirk
  2008-07-03 16:33   ` Daniel Walker
@ 2008-07-04 12:46     ` Jiri Kosina
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Kosina @ 2008-07-04 12:46 UTC (permalink / raw)
  To: Daniel Walker; +Cc: Philippe Troin, Adolfo R. Brandes, linux-input

On Thu, 3 Jul 2008, Daniel Walker wrote:

>> thanks a lot. Could you please fold these two patches into one, and 
>> send it to me? I will then merge it into my tree. I don't think there 
>> is a reason to have this split into two separate patches.
> They're split due to authorship .. The second patch is largely your
> work ..

Applied to my tree, thanks a lot.

-- 
Jiri Kosina
SUSE Labs

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

end of thread, other threads:[~2008-07-04 12:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01 16:24 [PATCH] hid: gyration remote support Daniel Walker
2008-07-01 16:24 ` [PATCH] hid: gyration sleep button quirk Daniel Walker
2008-07-03 16:17 ` Jiri Kosina
2008-07-03 16:33   ` Daniel Walker
2008-07-04 12:46     ` Jiri Kosina

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