diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-01-26 18:21:43 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-01-26 18:21:43 +0200 |
| commit | 66e522e26549afab26d032e900ae9f6576c83b9d (patch) | |
| tree | 273ab042080b42f273d9a5f6bff9e7273daf076c /src/tmtspc/hid-tmtspc.c | |
| parent | 816a23aa8f6924517bf784f3d72fbae42f100493 (diff) | |
| download | hid-tmff2-66e522e26549afab26d032e900ae9f6576c83b9d.tar.gz hid-tmff2-66e522e26549afab26d032e900ae9f6576c83b9d.zip | |
Revert "use on_hid_hw_open instead of input_dev->open"
This reverts commit c26573d77369c042dc2b9a881a7f2ff88ddc0dd9.
+ `on_hid_hw_open` is apparently new enough that common distros don't
have it yet, so let's wait a few years and try again. The old method
works well enough and if not, just set `open_mode=0`.
Diffstat (limited to 'src/tmtspc/hid-tmtspc.c')
| -rw-r--r-- | src/tmtspc/hid-tmtspc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/tmtspc/hid-tmtspc.c b/src/tmtspc/hid-tmtspc.c index 031358a..a51ec01 100644 --- a/src/tmtspc/hid-tmtspc.c +++ b/src/tmtspc/hid-tmtspc.c @@ -197,15 +197,17 @@ static int tspc_send_open(struct t300rs_device_entry *tspc) return 0; } -static void tspc_open(void *data, int open_mode) +static int tspc_open(void *data, int open_mode) { struct t300rs_device_entry *tspc = data; if (!tspc) - return; + return -ENODEV; if (open_mode) tspc_send_open(tspc); + + return tspc->open(tspc->input_dev); } static int tspc_send_close(struct t300rs_device_entry *tspc) @@ -224,15 +226,18 @@ static int tspc_send_close(struct t300rs_device_entry *tspc) return 0; } -static void tspc_close(void *data, int open_mode) +static int tspc_close(void *data, int open_mode) { struct t300rs_device_entry *tspc = data; if (!tspc) - return; + return -ENODEV; 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) @@ -263,6 +268,9 @@ 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; |
