diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-09-29 17:27:04 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-11-23 14:38:13 +0200 |
| commit | 2a1f7f59d37ed178796b921efbab3dfae33ddfce (patch) | |
| tree | 6a7d06da83c4590dab866999d78fab9b5104d664 | |
| parent | 175e9c54d0b63d3c19d1c26088bc1da64c302c7f (diff) | |
| download | hid-tmff2-2a1f7f59d37ed178796b921efbab3dfae33ddfce.tar.gz hid-tmff2-2a1f7f59d37ed178796b921efbab3dfae33ddfce.zip | |
add tspc mode switch for testing
| -rw-r--r-- | src/tmtspc/hid-tmtspc.c | 18 |
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; |
