* [PATCH] HID: corsair: fix mapping of non-keyboard usages
@ 2016-02-16 17:38 =?UTF-8?q?Cl=C3=A9ment=20Vuchener?=
2016-02-18 8:12 ` Benjamin Tissoires
2016-02-23 13:23 ` Jiri Kosina
0 siblings, 2 replies; 3+ messages in thread
From: =?UTF-8?q?Cl=C3=A9ment=20Vuchener?= @ 2016-02-16 17:38 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Benjamin Tissoires, linux-kernel, linux-input
This fixes a bug where the Volume Up key was ignored because it uses the same usage code as G18. Special Corsair usage codes are in the keyboard page, other pages should be left to the generic driver.
Signed-off-by: Clément Vuchener <clement.vuchener@gmail.com>
---
drivers/hid/hid-corsair.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/hid/hid-corsair.c b/drivers/hid/hid-corsair.c
index 5855196..717704e 100644
--- a/drivers/hid/hid-corsair.c
+++ b/drivers/hid/hid-corsair.c
@@ -595,6 +595,9 @@ static int corsair_input_mapping(struct hid_device *dev,
{
int gkey;
+ if ((usage->hid & HID_USAGE_PAGE) != HID_UP_KEYBOARD)
+ return 0;
+
gkey = corsair_usage_to_gkey(usage->hid & HID_USAGE);
if (gkey != 0) {
hid_map_usage_clear(input, usage, bit, max, EV_KEY,
--
2.5.0
--
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 related [flat|nested] 3+ messages in thread
* Re: [PATCH] HID: corsair: fix mapping of non-keyboard usages
2016-02-16 17:38 [PATCH] HID: corsair: fix mapping of non-keyboard usages =?UTF-8?q?Cl=C3=A9ment=20Vuchener?=
@ 2016-02-18 8:12 ` Benjamin Tissoires
2016-02-23 13:23 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Tissoires @ 2016-02-18 8:12 UTC (permalink / raw)
To: =?UTF-8?q?Cl=C3=A9ment=20Vuchener?=
Cc: Jiri Kosina, linux-kernel, linux-input
On Feb 16 2016 or thereabouts, =?UTF-8?q?Cl=C3=A9ment=20Vuchener?= wrote:
> This fixes a bug where the Volume Up key was ignored because it uses the same usage code as G18. Special Corsair usage codes are in the keyboard page, other pages should be left to the generic driver.
>
> Signed-off-by: Clément Vuchener <clement.vuchener@gmail.com>
Looks good to me.
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cheers,
Benjamin
> ---
> drivers/hid/hid-corsair.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hid/hid-corsair.c b/drivers/hid/hid-corsair.c
> index 5855196..717704e 100644
> --- a/drivers/hid/hid-corsair.c
> +++ b/drivers/hid/hid-corsair.c
> @@ -595,6 +595,9 @@ static int corsair_input_mapping(struct hid_device *dev,
> {
> int gkey;
>
> + if ((usage->hid & HID_USAGE_PAGE) != HID_UP_KEYBOARD)
> + return 0;
> +
> gkey = corsair_usage_to_gkey(usage->hid & HID_USAGE);
> if (gkey != 0) {
> hid_map_usage_clear(input, usage, bit, max, EV_KEY,
> --
> 2.5.0
>
--
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] 3+ messages in thread
* Re: [PATCH] HID: corsair: fix mapping of non-keyboard usages
2016-02-16 17:38 [PATCH] HID: corsair: fix mapping of non-keyboard usages =?UTF-8?q?Cl=C3=A9ment=20Vuchener?=
2016-02-18 8:12 ` Benjamin Tissoires
@ 2016-02-23 13:23 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2016-02-23 13:23 UTC (permalink / raw)
To: Clément Vuchener; +Cc: Benjamin Tissoires, linux-kernel, linux-input
On Tue, 16 Feb 2016, =?UTF-8?q?Cl=C3=A9ment=20Vuchener?= wrote:
> This fixes a bug where the Volume Up key was ignored because it uses the
> same usage code as G18. Special Corsair usage codes are in the keyboard
> page, other pages should be left to the generic driver.
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-23 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 17:38 [PATCH] HID: corsair: fix mapping of non-keyboard usages =?UTF-8?q?Cl=C3=A9ment=20Vuchener?=
2016-02-18 8:12 ` Benjamin Tissoires
2016-02-23 13:23 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox