HID: initial USI support patches

Started by Tero Kristo on Dec 10, 2021 · 10 messages from 2 authors · Last reply Dec 14, 2021

Series

5 patches, 4 files

+54 −10

Subsystems (2)

Maintainers (3)

STALE1796d LANDED

Status: Landed in mainline.

open the first message on its own page

  1. [PATCHv4 1/5] HID: Add map_msc() to avoid boilerplate code
    Related patches
  2. [PATCHv4 2/5] HID: hid-input: Add suffix also for HID_DG_PEN
    Related patches
  3. [PATCHv4 3/5] HID: Add hid usages for USI style pens
    Related patches
  4. [PATCHv4 4/5] HID: input: Make hidinput_find_field() static
    Related patches
  5. [PATCHv4 5/5] HID: debug: Add USI usages
    Related patches
Message details and related content
Hi,

As per request, this set contains initial USI support patches targeted
for 5.17. Any patches still under discussion dropped from this set.
Patch #3 is a split from previous revision, only containing the HID usage
definitions.

Series is based on top of hid/for-next.

-Tero

[PATCHv4 1/5] HID: Add map_msc() to avoid boilerplate code

Message details and related content
From: Mika Westerberg <mika.westerberg@linux.intel.com>

Since we are going to have more MSC events too, add map_msc() that can
be used to fill in necessary fields and avoid boilerplate code.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Benjamin Tissoires <redacted>
Signed-off-by: Tero Kristo <redacted>
---
 drivers/hid/hid-input.c | 6 ++----
 include/linux/hid.h     | 4 ++++
 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 03f994541981..ad718ceb8af3 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -52,6 +52,7 @@ static const struct {
 #define map_rel(c)	hid_map_usage(hidinput, usage, &bit, &max, EV_REL, (c))
 #define map_key(c)	hid_map_usage(hidinput, usage, &bit, &max, EV_KEY, (c))
 #define map_led(c)	hid_map_usage(hidinput, usage, &bit, &max, EV_LED, (c))
+#define map_msc(c)	hid_map_usage(hidinput, usage, &bit, &max, EV_MSC, (c))
 
 #define map_abs_clear(c)	hid_map_usage_clear(hidinput, usage, &bit, \
 		&max, EV_ABS, (c))
@@ -876,10 +877,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 
 		case 0x5b: /* TransducerSerialNumber */
 		case 0x6e: /* TransducerSerialNumber2 */
-			usage->type = EV_MSC;
-			usage->code = MSC_SERIAL;
-			bit = input->mscbit;
-			max = MSC_MAX;
+			map_msc(MSC_SERIAL);
 			break;
 
 		default:  goto unknown;
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 313fa4a2554f..cc797d608951 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -1015,6 +1015,10 @@ static inline void hid_map_usage(struct hid_input *hidinput,
 		bmap = input->ledbit;
 		limit = LED_MAX;
 		break;
+	case EV_MSC:
+		bmap = input->mscbit;
+		limit = MSC_MAX;
+		break;
 	}
 
 	if (unlikely(c > limit || !bmap)) {
-- 
2.25.1

[PATCHv4 2/5] HID: hid-input: Add suffix also for HID_DG_PEN

Message details and related content
From: Mika Westerberg <mika.westerberg@linux.intel.com>

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 <redacted>
---
 drivers/hid/hid-input.c      | 1 +
 drivers/hid/hid-multitouch.c | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index ad718ceb8af3..78205e445652 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1741,6 +1741,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
 		case HID_GD_MOUSE:
 			suffix = "Mouse";
 			break;
+		case HID_DG_PEN:
 		case HID_DG_STYLUS:
 			suffix = "Pen";
 			break;
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 082376a6cb3d..99eabfb4145b 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -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";
-- 
2.25.1

[PATCHv4 3/5] HID: Add hid usages for USI style pens

Message details and related content
Add usage codes for USI style pens, based on the USB-HID usage table:
    https://usb.org/document-library/hid-usage-tables-122

See chapter 16, Digitizers Page (0x0D)

Signed-off-by: Tero Kristo <redacted>
---
 include/linux/hid.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index cc797d608951..b8634d17d11e 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -241,6 +241,7 @@ struct hid_item {
 #define HID_DG_TOUCH		0x000d0033
 #define HID_DG_UNTOUCH		0x000d0034
 #define HID_DG_TAP		0x000d0035
+#define HID_DG_TRANSDUCER_INDEX	0x000d0038
 #define HID_DG_TABLETFUNCTIONKEY	0x000d0039
 #define HID_DG_PROGRAMCHANGEKEY	0x000d003a
 #define HID_DG_BATTERYSTRENGTH	0x000d003b
@@ -253,6 +254,15 @@ struct hid_item {
 #define HID_DG_BARRELSWITCH	0x000d0044
 #define HID_DG_ERASER		0x000d0045
 #define HID_DG_TABLETPICK	0x000d0046
+#define HID_DG_PEN_COLOR			0x000d005c
+#define HID_DG_PEN_LINE_WIDTH			0x000d005e
+#define HID_DG_PEN_LINE_STYLE			0x000d0070
+#define HID_DG_PEN_LINE_STYLE_INK		0x000d0072
+#define HID_DG_PEN_LINE_STYLE_PENCIL		0x000d0073
+#define HID_DG_PEN_LINE_STYLE_HIGHLIGHTER	0x000d0074
+#define HID_DG_PEN_LINE_STYLE_CHISEL_MARKER	0x000d0075
+#define HID_DG_PEN_LINE_STYLE_BRUSH		0x000d0076
+#define HID_DG_PEN_LINE_STYLE_NO_PREFERENCE	0x000d0077
 
 #define HID_CP_CONSUMERCONTROL	0x000c0001
 #define HID_CP_NUMERICKEYPAD	0x000c0002
-- 
2.25.1

[PATCHv4 4/5] HID: input: Make hidinput_find_field() static

Message details and related content
From: Mika Westerberg <mika.westerberg@linux.intel.com>

This function is not called outside of hid-input.c so we can make it
static.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Benjamin Tissoires <redacted>
Signed-off-by: Tero Kristo <redacted>
---
 drivers/hid/hid-input.c | 4 ++--
 include/linux/hid.h     | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 78205e445652..1179ef1d257a 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1463,7 +1463,8 @@ void hidinput_report_event(struct hid_device *hid, struct hid_report *report)
 }
 EXPORT_SYMBOL_GPL(hidinput_report_event);
 
-int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field)
+static int hidinput_find_field(struct hid_device *hid, unsigned int type,
+			       unsigned int code, struct hid_field **field)
 {
 	struct hid_report *report;
 	int i, j;
@@ -1478,7 +1479,6 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int
 	}
 	return -1;
 }
-EXPORT_SYMBOL_GPL(hidinput_find_field);
 
 struct hid_field *hidinput_get_led_field(struct hid_device *hid)
 {
diff --git a/include/linux/hid.h b/include/linux/hid.h
index b8634d17d11e..6b482c855605 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -904,7 +904,6 @@ extern void hidinput_disconnect(struct hid_device *);
 
 int hid_set_field(struct hid_field *, unsigned, __s32);
 int hid_input_report(struct hid_device *, int type, u8 *, u32, int);
-int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
 struct hid_field *hidinput_get_led_field(struct hid_device *hid);
 unsigned int hidinput_count_leds(struct hid_device *hid);
 __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
-- 
2.25.1

[PATCHv4 5/5] HID: debug: Add USI usages

Message details and related content
From: Mika Westerberg <mika.westerberg@linux.intel.com>

Add USI defined usages to the HID debug code.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Tero Kristo <redacted>
---
 drivers/hid/hid-debug.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 7a92e2a04a09..26c31d759914 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -141,8 +141,10 @@ static const struct hid_usage_entry hid_usage_table[] = {
     {0, 0x33, "Touch"},
     {0, 0x34, "UnTouch"},
     {0, 0x35, "Tap"},
+    {0, 0x38, "Transducer Index"},
     {0, 0x39, "TabletFunctionKey"},
     {0, 0x3a, "ProgramChangeKey"},
+    {0, 0x3B, "Battery Strength"},
     {0, 0x3c, "Invert"},
     {0, 0x42, "TipSwitch"},
     {0, 0x43, "SecondaryTipSwitch"},
@@ -160,7 +162,40 @@ static const struct hid_usage_entry hid_usage_table[] = {
     {0, 0x59, "ButtonType"},
     {0, 0x5A, "SecondaryBarrelSwitch"},
     {0, 0x5B, "TransducerSerialNumber"},
+    {0, 0x5C, "Preferred Color"},
+    {0, 0x5D, "Preferred Color is Locked"},
+    {0, 0x5E, "Preferred Line Width"},
+    {0, 0x5F, "Preferred Line Width is Locked"},
     {0, 0x6e, "TransducerSerialNumber2"},
+    {0, 0x70, "Preferred Line Style"},
+      {0, 0x71, "Preferred Line Style is Locked"},
+      {0, 0x72, "Ink"},
+      {0, 0x73, "Pencil"},
+      {0, 0x74, "Highlighter"},
+      {0, 0x75, "Chisel Marker"},
+      {0, 0x76, "Brush"},
+      {0, 0x77, "No Preference"},
+    {0, 0x80, "Digitizer Diagnostic"},
+    {0, 0x81, "Digitizer Error"},
+      {0, 0x82, "Err Normal Status"},
+      {0, 0x83, "Err Transducers Exceeded"},
+      {0, 0x84, "Err Full Trans Features Unavailable"},
+      {0, 0x85, "Err Charge Low"},
+    {0, 0x90, "Transducer Software Info"},
+      {0, 0x91, "Transducer Vendor Id"},
+      {0, 0x92, "Transducer Product Id"},
+    {0, 0x93, "Device Supported Protocols"},
+    {0, 0x94, "Transducer Supported Protocols"},
+      {0, 0x95, "No Protocol"},
+      {0, 0x96, "Wacom AES Protocol"},
+      {0, 0x97, "USI Protocol"},
+      {0, 0x98, "Microsoft Pen Protocol"},
+    {0, 0xA0, "Supported Report Rates"},
+      {0, 0xA1, "Report Rate"},
+      {0, 0xA2, "Transducer Connected"},
+      {0, 0xA3, "Switch Disabled"},
+      {0, 0xA4, "Switch Unimplemented"},
+      {0, 0xA5, "Transducer Switches"},
   { 15, 0, "PhysicalInterfaceDevice" },
     {0, 0x00, "Undefined"},
     {0, 0x01, "Physical_Interface_Device"},
-- 
2.25.1

Re: [PATCHv4 2/5] HID: hid-input: Add suffix also for HID_DG_PEN

Message details and related content

On Fri, Dec 10, 2021 at 12:12 PM Tero Kristo [off-list ref] wrote:
From: Mika Westerberg <mika.westerberg@linux.intel.com>

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".
FWIW, I was thinking at the following:
---
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 837585f4e673..fe0da7bf24a9 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1775,6 +1775,15 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
                        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;
---
Because the current patch breaks the test suite.

Cheers,
Benjamin
quoted hunk
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Tero Kristo <redacted>
---
 drivers/hid/hid-input.c      | 1 +
 drivers/hid/hid-multitouch.c | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index ad718ceb8af3..78205e445652 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1741,6 +1741,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
                case HID_GD_MOUSE:
                        suffix = "Mouse";
                        break;
+               case HID_DG_PEN:
                case HID_DG_STYLUS:
                        suffix = "Pen";
                        break;
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 082376a6cb3d..99eabfb4145b 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -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";
--
2.25.1

Re: [PATCHv4 2/5] HID: hid-input: Add suffix also for HID_DG_PEN

Message details and related content
On 10/12/2021 18:21, Benjamin Tissoires wrote:
quoted hunk

On Fri, Dec 10, 2021 at 12:12 PM Tero Kristo [off-list ref] wrote:
quoted
From: Mika Westerberg <mika.westerberg@linux.intel.com>

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".
FWIW, I was thinking at the following:
---
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 837585f4e673..fe0da7bf24a9 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1775,6 +1775,15 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
                        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;
---

Because the current patch breaks the test suite.
Ah I see, do you want me to re-post in this form?

-Tero
Cheers,
Benjamin
quoted
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Tero Kristo <redacted>
---
 drivers/hid/hid-input.c      | 1 +
 drivers/hid/hid-multitouch.c | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index ad718ceb8af3..78205e445652 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1741,6 +1741,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
                case HID_GD_MOUSE:
                        suffix = "Mouse";
                        break;
+               case HID_DG_PEN:
                case HID_DG_STYLUS:
                        suffix = "Pen";
                        break;
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 082376a6cb3d..99eabfb4145b 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -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";
-- 
2.25.1

2 more quoted lines

Re: [PATCHv4 2/5] HID: hid-input: Add suffix also for HID_DG_PEN

Message details and related content
On Fri, Dec 10, 2021 at 6:51 PM Tero Kristo [off-list ref] wrote:

On 10/12/2021 18:21, Benjamin Tissoires wrote:
quoted

On Fri, Dec 10, 2021 at 12:12 PM Tero Kristo
[off-list ref] wrote:
quoted
From: Mika Westerberg <mika.westerberg@linux.intel.com>

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".
FWIW, I was thinking at the following:
---
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 837585f4e673..fe0da7bf24a9 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1775,6 +1775,15 @@ static struct hid_input
*hidinput_allocate(struct hid_device *hid,
                        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;

8 more quoted lines

Nah, no need for a repost. I fixed the patch locally and pushed to
for-5.17/core.

Cheers,
Benjamin
-Tero
quoted
Cheers,
Benjamin
quoted
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Tero Kristo <redacted>
---
 drivers/hid/hid-input.c      | 1 +
 drivers/hid/hid-multitouch.c | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index ad718ceb8af3..78205e445652 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1741,6 +1741,7 @@ static struct hid_input
*hidinput_allocate(struct hid_device *hid,
                case HID_GD_MOUSE:
                        suffix = "Mouse";
                        break;
+               case HID_DG_PEN:
                case HID_DG_STYLUS:
                        suffix = "Pen";
                        break;
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 082376a6cb3d..99eabfb4145b 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -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";

8 more quoted lines

Re: [PATCHv4 2/5] HID: hid-input: Add suffix also for HID_DG_PEN

Message details and related content
On 14/12/2021 14:35, Benjamin Tissoires wrote:
On Fri, Dec 10, 2021 at 6:51 PM Tero Kristo [off-list ref] wrote:
quoted
On 10/12/2021 18:21, Benjamin Tissoires wrote:
quoted
On Fri, Dec 10, 2021 at 12:12 PM Tero Kristo
[off-list ref] wrote:
quoted
From: Mika Westerberg <mika.westerberg@linux.intel.com>

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".
FWIW, I was thinking at the following:
---
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 837585f4e673..fe0da7bf24a9 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1775,6 +1775,15 @@ static struct hid_input
*hidinput_allocate(struct hid_device *hid,
                         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;

6 more quoted lines

Thanks a lot!

-Tero

Cheers,
Benjamin
quoted
-Tero
quoted
Cheers,
Benjamin
quoted
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Tero Kristo <redacted>
---
  drivers/hid/hid-input.c      | 1 +
  drivers/hid/hid-multitouch.c | 3 ---
  2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index ad718ceb8af3..78205e445652 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1741,6 +1741,7 @@ static struct hid_input
*hidinput_allocate(struct hid_device *hid,
                 case HID_GD_MOUSE:
                         suffix = "Mouse";
                         break;
+               case HID_DG_PEN:
                 case HID_DG_STYLUS:
                         suffix = "Pen";
                         break;
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 082376a6cb3d..99eabfb4145b 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -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";

6 more quoted lines

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