Skip to content

Commit c0ee1d5

Browse files
westeribentiss
authored andcommitted
HID: hid-input: Add suffix also for HID_DG_PEN
This and HID_DG_STYLUS are pretty much the same thing so add suffix for HID_DG_PEN too. This makes the input device name look better. While doing this, remove the suffix override from hid-multitouch, as it is now handled by hid-input. Also, the suffix override done by hid-multitouch was wrong, as it mapped HID_DG_PEN => "Stylus" and HID_DG_STYLUS => "Pen". Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> [bentiss: amended to keep the same name for hid-multitouch devices] Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20211210111138.1248187-3-tero.kristo@linux.intel.com
1 parent 8aa45b5 commit c0ee1d5

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

drivers/hid/hid-input.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,16 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
17391739
case HID_GD_MOUSE:
17401740
suffix = "Mouse";
17411741
break;
1742+
case HID_DG_PEN:
1743+
/*
1744+
* yes, there is an issue here:
1745+
* DG_PEN -> "Stylus"
1746+
* DG_STYLUS -> "Pen"
1747+
* But changing this now means users with config snippets
1748+
* will have to change it and the test suite will not be happy.
1749+
*/
1750+
suffix = "Stylus";
1751+
break;
17421752
case HID_DG_STYLUS:
17431753
suffix = "Pen";
17441754
break;

drivers/hid/hid-multitouch.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,9 +1606,6 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
16061606
case HID_DG_STYLUS:
16071607
/* force BTN_STYLUS to allow tablet matching in udev */
16081608
__set_bit(BTN_STYLUS, hi->input->keybit);
1609-
fallthrough;
1610-
case HID_DG_PEN:
1611-
suffix = "Stylus";
16121609
break;
16131610
default:
16141611
suffix = "UNKNOWN";

0 commit comments

Comments
 (0)