Commit c0ee1d57 authored by Mika Westerberg's avatar Mika Westerberg Committed by Benjamin Tissoires
Browse files

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: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarTero Kristo <tero.kristo@linux.intel.com>
[bentiss: amended to keep the same name for hid-multitouch devices]
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20211210111138.1248187-3-tero.kristo@linux.intel.com
parent 8aa45b54
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1739,6 +1739,16 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
		case HID_GD_MOUSE:
			suffix = "Mouse";
			break;
		case HID_DG_PEN:
			/*
			 * yes, there is an issue here:
			 *  DG_PEN -> "Stylus"
			 *  DG_STYLUS -> "Pen"
			 * But changing this now means users with config snippets
			 * will have to change it and the test suite will not be happy.
			 */
			suffix = "Stylus";
			break;
		case HID_DG_STYLUS:
			suffix = "Pen";
			break;
+0 −3
Original line number Diff line number Diff line
@@ -1606,9 +1606,6 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
	case HID_DG_STYLUS:
		/* force BTN_STYLUS to allow tablet matching in udev */
		__set_bit(BTN_STYLUS, hi->input->keybit);
		fallthrough;
	case HID_DG_PEN:
		suffix = "Stylus";
		break;
	default:
		suffix = "UNKNOWN";