aboutsummaryrefslogtreecommitdiff
path: root/src/tmtspc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tmtspc')
-rw-r--r--src/tmtspc/hid-tmtspc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tmtspc/hid-tmtspc.c b/src/tmtspc/hid-tmtspc.c
index 3f85ba7..caaa378 100644
--- a/src/tmtspc/hid-tmtspc.c
+++ b/src/tmtspc/hid-tmtspc.c
@@ -301,6 +301,22 @@ static __u8 *tspc_wheel_fixup(struct hid_device *hdev, __u8 *rdesc,
return rdesc;
}
+static ssize_t tspc_alt_mode_store(void *data, const char *buf, size_t count)
+{
+ struct t300rs_device_entry *tspc = data;
+ if (!tspc)
+ return -ENODEV;
+
+ /* blindly trusting that this works for now */
+ usb_control_msg(tspc->usbdev,
+ usb_sndctrlpipe(tspc->usbdev, 0),
+ 83, 0x41, 0xb, 0, 0, 0,
+ USB_CTRL_SET_TIMEOUT
+ );
+
+ return count;
+}
+
int tspc_populate_api(struct tmff2_device_entry *tmff2)
{
tmff2->play_effect = t300rs_play_effect;
@@ -317,6 +333,8 @@ int tspc_populate_api(struct tmff2_device_entry *tmff2)
tmff2->open = tspc_open;
tmff2->close = tspc_close;
+ tmff2->alt_mode_store = tspc_alt_mode_store;
+
tmff2->wheel_init = tspc_wheel_init;
tmff2->wheel_destroy = tspc_wheel_destroy;