aboutsummaryrefslogtreecommitdiff
path: root/src/tmt300rs/hid-tmt300rs.c
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/tmt300rs/hid-tmt300rs.c
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/tmt300rs/hid-tmt300rs.c')
-rw-r--r--src/tmt300rs/hid-tmt300rs.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/tmt300rs/hid-tmt300rs.c b/src/tmt300rs/hid-tmt300rs.c
index 00eecee..689466f 100644
--- a/src/tmt300rs/hid-tmt300rs.c
+++ b/src/tmt300rs/hid-tmt300rs.c
@@ -1287,31 +1287,26 @@ static int t300rs_send_close(struct t300rs_device_entry *t300rs)
return t300rs_send_int(t300rs);
}
-int t300rs_open(void *data, int open_mode)
+void t300rs_open(void *data, int open_mode)
{
struct t300rs_device_entry *t300rs = data;
if (!t300rs)
- return -ENODEV;
+ return;
if (open_mode && t300rs_send_open(t300rs))
hid_warn(t300rs->hdev, "failed sending open command\n");
-
- return t300rs->open(t300rs->input_dev);
}
-int t300rs_close(void *data, int open_mode)
+void t300rs_close(void *data, int open_mode)
{
struct t300rs_device_entry *t300rs = data;
int ret = 0;
if (!t300rs)
- return -ENODEV;
+ return;
if (open_mode && (ret = t300rs_send_close(t300rs)))
hid_warn(t300rs->hdev, "failed sending close command\n");
-
- t300rs->close(t300rs->input_dev);
- return ret;
}
static int t300rs_check_firmware(struct t300rs_device_entry *t300rs)
@@ -1469,9 +1464,6 @@ static int t300rs_wheel_init(struct tmff2_device_entry *tmff2, int open_mode)
t300rs->report = list_entry(report_list->next, struct hid_report, list);
t300rs->ff_field = t300rs->report->field[0];
- t300rs->open = t300rs->input_dev->open;
- t300rs->close = t300rs->input_dev->close;
-
/* TODO: PS4 advanced mode? */
alt_mode = (t300rs->mode = (t300rs->hdev->product == TMT300RS_PS3_ADV_ID));
if ((t300rs->attachment = t300rs_get_attachment(t300rs)) < 0)