aboutsummaryrefslogtreecommitdiff
path: root/src/tmtspc
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2026-01-04 21:49:58 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2026-01-04 21:49:58 +0200
commitc26573d77369c042dc2b9a881a7f2ff88ddc0dd9 (patch)
tree3cfecb6395613274e0e3dcd0752c3ba6dc8a5363 /src/tmtspc
parent26995429a3b92047f0c2f9ab90fe4202c86fd72b (diff)
downloadhid-tmff2-c26573d77369c042dc2b9a881a7f2ff88ddc0dd9.tar.gz
hid-tmff2-c26573d77369c042dc2b9a881a7f2ff88ddc0dd9.zip
use on_hid_hw_open instead of input_dev->open
+ Seems some applications can mess with input_dev->open, still unclear how but on_hid_hw_open seems to be a bit more reliable so use it for now at least
Diffstat (limited to 'src/tmtspc')
-rw-r--r--src/tmtspc/hid-tmtspc.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/tmtspc/hid-tmtspc.c b/src/tmtspc/hid-tmtspc.c
index a51ec01..031358a 100644
--- a/src/tmtspc/hid-tmtspc.c
+++ b/src/tmtspc/hid-tmtspc.c
@@ -197,17 +197,15 @@ static int tspc_send_open(struct t300rs_device_entry *tspc)
return 0;
}
-static int tspc_open(void *data, int open_mode)
+static void tspc_open(void *data, int open_mode)
{
struct t300rs_device_entry *tspc = data;
if (!tspc)
- return -ENODEV;
+ return;
if (open_mode)
tspc_send_open(tspc);
-
- return tspc->open(tspc->input_dev);
}
static int tspc_send_close(struct t300rs_device_entry *tspc)
@@ -226,18 +224,15 @@ static int tspc_send_close(struct t300rs_device_entry *tspc)
return 0;
}
-static int tspc_close(void *data, int open_mode)
+static void tspc_close(void *data, int open_mode)
{
struct t300rs_device_entry *tspc = data;
if (!tspc)
- return -ENODEV;
+ return;
if (open_mode)
tspc_send_close(tspc);
-
- tspc->close(tspc->input_dev);
- return 0;
}
static int tspc_wheel_init(struct tmff2_device_entry *tmff2, int open_mode)
@@ -268,9 +263,6 @@ static int tspc_wheel_init(struct tmff2_device_entry *tmff2, int open_mode)
tspc->report = list_entry(report_list->next, struct hid_report, list);
tspc->ff_field = tspc->report->field[0];
- tspc->open = tspc->input_dev->open;
- tspc->close = tspc->input_dev->close;
-
if ((ret = tspc_interrupts(tspc)))
goto interrupt_err;