Input: hid-input: Add suport for the brightness control keys on HP keyboards

Started by Keng-Yu Lin on Jul 6, 2012 · 2 messages from 2 authors · Last reply Jul 9, 2012

Subsystems (2)

Maintainers (3)

STALE5260d

open the first message on its own page

Message details and related content
The keys are found on the keyboards bundled with HP All-In-One machines
with USB VID/PID of 04ca:004d and 04f2:1061.

Signed-off-by: Keng-Yu Lin <redacted>
---
 drivers/hid/hid-input.c |    9 +++++++++
 include/linux/hid.h     |    1 +
 2 files changed, 10 insertions(+)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index f333139..ecb8e48 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -648,6 +648,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		}
 		break;
 
+	case HID_UP_HPVENDOR2:
+		set_bit(EV_REP, input->evbit);
+		switch (usage->hid & HID_USAGE) {
+		case 0x003: map_key_clear(KEY_BRIGHTNESSDOWN);	break;
+		case 0x004: map_key_clear(KEY_BRIGHTNESSUP);	break;
+		default:    goto ignore;
+		}
+		break;
+
 	case HID_UP_MSVENDOR:
 		goto ignore;
 
diff --git a/include/linux/hid.h b/include/linux/hid.h
index c235e4e..4365959 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -198,6 +198,7 @@ struct hid_item {
 #define HID_UP_DIGITIZER	0x000d0000
 #define HID_UP_PID		0x000f0000
 #define HID_UP_HPVENDOR         0xff7f0000
+#define HID_UP_HPVENDOR2        0xff010000
 #define HID_UP_MSVENDOR		0xff000000
 #define HID_UP_CUSTOM		0x00ff0000
 #define HID_UP_LOGIVENDOR	0xffbc0000
-- 
1.7.9.5
Message details and related content
On Fri, 6 Jul 2012, Keng-Yu Lin wrote:
quoted hunk
The keys are found on the keyboards bundled with HP All-In-One machines
with USB VID/PID of 04ca:004d and 04f2:1061.

Signed-off-by: Keng-Yu Lin <redacted>
---
 drivers/hid/hid-input.c |    9 +++++++++
 include/linux/hid.h     |    1 +
 2 files changed, 10 insertions(+)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index f333139..ecb8e48 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -648,6 +648,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		}
 		break;
 
+	case HID_UP_HPVENDOR2:
+		set_bit(EV_REP, input->evbit);
+		switch (usage->hid & HID_USAGE) {
+		case 0x003: map_key_clear(KEY_BRIGHTNESSDOWN);	break;
+		case 0x004: map_key_clear(KEY_BRIGHTNESSUP);	break;
+		default:    goto ignore;
+		}
+		break;
+
 	case HID_UP_MSVENDOR:
 		goto ignore;
 
diff --git a/include/linux/hid.h b/include/linux/hid.h
index c235e4e..4365959 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -198,6 +198,7 @@ struct hid_item {
 #define HID_UP_DIGITIZER	0x000d0000
 #define HID_UP_PID		0x000f0000
 #define HID_UP_HPVENDOR         0xff7f0000
+#define HID_UP_HPVENDOR2        0xff010000
Let's hope these vendor-specific usage pages don't start out-of-control 
spreading.

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help