Skip to contentSkip to conversation

HID: hid-input: Add eraser usage to hidinput_configure_usage

PATCH In review Ping Cheng 3 participants 3 messages Sep 21, 2017 – Oct 2, 2017 1 message not in the archive HID

lore
Share & tools
lore

Ping Cheng

author
#0 lore raw

PATCH 1/1 HID: hid-input: Add eraser usage to hidinput_configure_usage

Some tablets report eraser usage to indicate the eraser tool. But, hidinput_configure_usage doesn't support it, which led the usage falls into default as ABS_MISC.

---
 drivers/hid/hid-input.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hid/hid-input.c +4 -0
index 199f6a01fc62..4d36b08494fd 100644
@@ -797,6 +797,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			map_key_clear(BTN_STYLUS);
 			break;
 
+		case 0x45: /* ERASER */
+			map_key_clear(BTN_TOUCH);
+			break;
+
 		case 0x46: /* TabletPick */
 		case 0x5a: /* SecondaryBarrelSwitch */
 			map_key_clear(BTN_STYLUS2);
Signature · 1 line
2.13.5
#1 lore raw
Quoted 14 lines · Ping Cheng

Some tablets report eraser usage to indicate the eraser tool. But, hidinput_configure_usage doesn't support it, which led the usage falls into default as ABS_MISC.

---
 drivers/hid/hid-input.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hid/hid-input.c +0 -0
index 199f6a01fc62..4d36b08494fd 100644

drivers/hid/hid-input.c static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · line 801

Quoted 5 lines
drivers/hid/hid-input.c +2 -0
@@ -797,6 +797,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                        map_key_clear(BTN_STYLUS);
                        break;
 
+               case 0x45: /* ERASER */
+                       map_key_clear(BTN_TOUCH);

Surely you mean BTN_TOOL_RUBBER?

Thanks.

Signature · 1 line
Dmitry

A message that is not in the archive (sent off-list or not yet received): CAF8JNhJ3=-uP0Q_FxvLnj-evubBovRttX6F8jTG50aEqwJV80w@mail.gmail.com

maintainer
#3 lore raw
Quoted 21 lines · Ping Cheng
Quoted 21 lines

drivers/hid/hid-input.c static void hidinput_configure_usage(struct

Quoted 14 lines

Some tablets report eraser usage to indicate the eraser tool. But, hidinput_configure_usage doesn't support it, which led the usage falls into default as ABS_MISC.

Signed-off-by Ping Cheng <[email protected] <javascript:;>>
---
 drivers/hid/hid-input.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hid/hid-input.c +0 -0
index 199f6a01fc62..4d36b08494fd 100644
@@ -797,6 +797,10 @@ static void hidinput_configure_usage(struct

hid_input *hidinput, struct hid_fiel

Quoted 5 lines
drivers/hid/hid-input.c +2 -0
                        map_key_clear(BTN_STYLUS);
                        break;
 
+               case 0x45: /* ERASER */
+                       map_key_clear(BTN_TOUCH);
Quoted 6 lines
Quoted 1 line

Surely you mean BTN_TOOL_RUBBER?

No, I meant BTN_TOUCH since INVERT usage decides if an eraser is in proximity and send BTN_TOOL_RUBBER bit. Eraser usage means it is actually touching the device.

The reasoning makes sense, but it is indeed confusing, so I believe a small comment explaining it would be appropriate. Could you please add it and resend?

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs