Skip to content

Commit 31175a8

Browse files
Pinglinuxdtor
authored andcommitted
Input: wacom - use switch statement for wacom_tpc_irq()
And add two new data formats. Tested-by: Chris Bagwell <[email protected]> Reviewed-by: Chris Bagwell <[email protected]> Signed-off-by: Ping Cheng <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 8b4a0c1 commit 31175a8

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

drivers/input/tablet/wacom_wac.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -832,12 +832,24 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
832832

833833
dbg("wacom_tpc_irq: received report #%d", data[0]);
834834

835-
if (len == WACOM_PKGLEN_TPC1FG || data[0] == WACOM_REPORT_TPC1FG)
836-
return wacom_tpc_single_touch(wacom, len);
837-
else if (data[0] == WACOM_REPORT_TPC2FG)
838-
return wacom_tpc_mt_touch(wacom);
839-
else if (data[0] == WACOM_REPORT_PENABLED)
840-
return wacom_tpc_pen(wacom);
835+
switch (len) {
836+
case WACOM_PKGLEN_TPC1FG:
837+
return wacom_tpc_single_touch(wacom, len);
838+
839+
case WACOM_PKGLEN_TPC2FG:
840+
return wacom_tpc_mt_touch(wacom);
841+
842+
default:
843+
switch (data[0]) {
844+
case WACOM_REPORT_TPC1FG:
845+
case WACOM_REPORT_TPCHID:
846+
case WACOM_REPORT_TPCST:
847+
return wacom_tpc_single_touch(wacom, len);
848+
849+
case WACOM_REPORT_PENABLED:
850+
return wacom_tpc_pen(wacom);
851+
}
852+
}
841853

842854
return 0;
843855
}

drivers/input/tablet/wacom_wac.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
#define WACOM_REPORT_INTUOSPAD 12
4040
#define WACOM_REPORT_TPC1FG 6
4141
#define WACOM_REPORT_TPC2FG 13
42+
#define WACOM_REPORT_TPCHID 15
43+
#define WACOM_REPORT_TPCST 16
4244

4345
/* device quirks */
4446
#define WACOM_QUIRK_MULTI_INPUT 0x0001

0 commit comments

Comments
 (0)