aboutsummaryrefslogtreecommitdiff
path: root/src/hid-tmff2.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2026-01-26 18:21:43 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2026-01-26 18:21:43 +0200
commit66e522e26549afab26d032e900ae9f6576c83b9d (patch)
tree273ab042080b42f273d9a5f6bff9e7273daf076c /src/hid-tmff2.h
parent816a23aa8f6924517bf784f3d72fbae42f100493 (diff)
downloadhid-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/hid-tmff2.h')
-rw-r--r--src/hid-tmff2.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/hid-tmff2.h b/src/hid-tmff2.h
index 213bebe..6ad1d82 100644
--- a/src/hid-tmff2.h
+++ b/src/hid-tmff2.h
@@ -82,8 +82,8 @@ struct tmff2_device_entry {
int (*wheel_destroy)(void *data);
/* optional callbacks */
- void (*open)(void *data, int);
- void (*close)(void *data, int);
+ int (*open)(void *data, int);
+ int (*close)(void *data, int);
int (*set_gain)(void *data, uint16_t gain);
int (*set_range)(void *data, uint16_t range);
/* switch_mode is required to not do anything if we're alredy in the
@@ -128,6 +128,9 @@ struct t300rs_device_entry {
struct hid_field *ff_field;
struct usb_device *usbdev;
+ int (*open)(struct input_dev *dev);
+ void (*close)(struct input_dev *dev);
+
int mode;
int attachment;
u8 buffer_length;
@@ -139,8 +142,8 @@ int t300rs_upload_effect(void *, const struct tmff2_effect_state *);
int t300rs_update_effect(void *, const struct tmff2_effect_state *);
int t300rs_stop_effect(void *, const struct tmff2_effect_state *);
-void t300rs_open(void *, int);
-void t300rs_close(void *, int);
+int t300rs_open(void *, int);
+int t300rs_close(void *, int);
int t300rs_set_gain(void *, uint16_t);
int t300rs_set_range(void *, uint16_t);
int t300rs_set_autocenter(void *, uint16_t);