aboutsummaryrefslogtreecommitdiff
path: root/hid-tmt248.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-03-21 21:47:10 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2022-03-21 21:47:10 +0200
commit3eba47f56dcb539b3dd475b9906ed9af7bd8db7f (patch)
treead6393de9c90782483afbd5d384a028ee09a8e41 /hid-tmt248.c
parentd12951deac141dcd026bc59ed9c0550f6630f345 (diff)
downloadhid-tmff2-3eba47f56dcb539b3dd475b9906ed9af7bd8db7f.tar.gz
hid-tmff2-3eba47f56dcb539b3dd475b9906ed9af7bd8db7f.zip
annotate t248 rdesc
Diffstat (limited to 'hid-tmt248.c')
-rw-r--r--hid-tmt248.c97
1 files changed, 90 insertions, 7 deletions
diff --git a/hid-tmt248.c b/hid-tmt248.c
index 1c51ba8..2881ffc 100644
--- a/hid-tmt248.c
+++ b/hid-tmt248.c
@@ -51,7 +51,80 @@ static const signed short t248_effects[] = {
/* TODO: sort through this stuff */
static u8 t248_pc_rdesc_fixed[] = {
-0x05, 0x01, 0x09, 0x04, 0xa1, 0x01, 0x09, 0x01, 0xa1, 0x00, 0x85, 0x07, 0x09, 0x30, 0x15, 0x00, 0x27, 0xff, 0xff, 0x00, 0x00, 0x35, 0x00, 0x47, 0xff, 0xff, 0x00, 0x00, 0x75, 0x10, 0x95, 0x01, 0x81, 0x02, 0x09, 0x31, 0x26, 0xff, 0x03, 0x46, 0xff, 0x03, 0x81, 0x02, 0x09, 0x35, 0x81, 0x02, 0x09, 0x36, 0x81, 0x02, 0x75, 0x08, 0x26, 0xff, 0x00, 0x46, 0xff, 0x00, 0x09, 0x40, 0x81, 0x02, 0x09, 0x41, 0x81, 0x02, 0x09, 0x33, 0x81, 0x02, 0x09, 0x34, 0x81, 0x02, 0x09, 0x32, 0x81, 0x02, 0x09, 0x37, 0x81, 0x02, 0x05, 0x09, 0x19, 0x01, 0x29, 0x1a, 0x25, 0x01, 0x45, 0x01, 0x75, 0x01, 0x95, 0x1a, 0x81, 0x02, 0x75, 0x06, 0x95, 0x01, 0x81, 0x03, 0x05, 0x01, 0x09, 0x39, 0x25, 0x07, 0x46, 0x3b, 0x01, 0x55, 0x00, 0x65, 0x14, 0x75, 0x04, 0x81, 0x42, 0x65, 0x00, 0x81, 0x03, 0x85, 0x0a, 0x06, 0x00, 0xff, 0x09, 0x0a, 0x75, 0x08, 0x95, 0x3f, 0x26, 0xff, 0x00, 0x46, 0xff, 0x00, 0x91, 0x02, 0x85, 0x02, 0x09, 0x02, 0x81, 0x02, 0x09, 0x14, 0x85, 0x14 0x81, 0x02, 0xc0, 0xc0
+ 0x05, 0x01, /* Usage page (Generic Desktop) */
+ 0x09, 0x04, /* Usage (Joystick) */
+ 0xa1, 0x01, /* Collection (Application) */
+ 0x09, 0x01, /* Usage (Pointer) */
+ 0xa1, 0x00, /* Collection (Physical) */
+ 0x85, 0x07, /* Report ID (7) */
+ 0x09, 0x30, /* Usage (X) */
+ 0x15, 0x00, /* Logical minimum (0) */
+ 0x27, 0xff, 0xff, 0x00, 0x00, /* Logical maximum (65535) */
+ 0x35, 0x00, /* Physical minimum (0) */
+ 0x47, 0xff, 0xff, 0x00, 0x00, /* Physical maximum (65535) */
+ 0x75, 0x10, /* Report size (16) */
+ 0x95, 0x01, /* Report count (1) */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x09, 0x31, /* Usage (Y) TODO: clutch? */
+ 0x26, 0xff, 0x03, /* Logical maximum (1023) */
+ 0x46, 0xff, 0x03, /* Physical maximum (1023) */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x09, 0x35, /* Usage (Rz) TODO: brake? */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x09, 0x36, /* Usage (Slider) */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x75, 0x08, /* Report size (8) */
+ 0x26, 0xff, 0x00, /* Logical maximum (255) */
+ 0x46, 0xff, 0x00, /* Physical maximum (255) */
+ 0x09, 0x40, /* Usage (Vx) TODO: what is this? */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x09, 0x41, /* Usage (Vy) TODO: --||-- */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x09, 0x33, /* Usage (Rx) TODO: --||-- */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x09, 0x34, /* Usage (Ry) TODO: --||-- */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x09, 0x32, /* Usage (Z) TODO: --||-- (gas?) */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x09, 0x37, /* Usage (Dial) */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x05, 0x09, /* Usage page (Button) */
+ 0x19, 0x01, /* Usage minimum (1) */
+ 0x29, 0x1a, /* Usage maximum (13) */
+ 0x25, 0x01, /* Logical maximum (1) */
+ 0x45, 0x01, /* Physical maximum (1) */
+ 0x75, 0x01, /* Report size (1) */
+ 0x95, 0x1a, /* Report count (26) */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x75, 0x06, /* Report size (6) */
+ 0x95, 0x01, /* Report count (1) */
+ 0x81, 0x03, /* Usage (Variable, Absolute, Constant) */
+ 0x05, 0x01, /* Usage page (Generic Desktop) */
+ 0x09, 0x39, /* Usage (Hat Switch) */
+ 0x25, 0x07, /* Logical maximum (7) */
+ 0x46, 0x3b, 0x01, /* Physical maximum (315) */
+ 0x55, 0x00, /* Unit exponent (0) */
+ 0x65, 0x14, /* Unit (Eng rot, Angular Pos) */
+ 0x75, 0x04, /* Report size (4) */
+ 0x81, 0x42, /* Input (Variable, Absolute, NullState) */
+ 0x65, 0x00, /* Input (None) */
+ 0x81, 0x03, /* Input (Variable, Absolute, Constant) */
+ 0x85, 0x60, /* Report ID (96), prev 10 */
+ 0x06, 0x00, 0xff, /* Usage page (Vendor 1) */
+ 0x09, 0x60, /* Usage (96), prev 10 */
+ 0x75, 0x08, /* Report size (8) */
+ 0x95, 0x3f, /* Report count (63) */
+ 0x26, 0xff, 0x00, /* Logical maximum (256) */
+ 0x46, 0xff, 0x00, /* Physical maximum (256) */
+ 0x91, 0x02, /* Output (Variable, Absolute) */
+ 0x85, 0x02, /* Report ID (2) */
+ 0x09, 0x02, /* Usage (2) */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0x09, 0x14, /* Usage (20) */
+ 0x85, 0x14, /* Report ID (20) */
+ 0x81, 0x02, /* Input (Variable, Absolute) */
+ 0xc0, /* End collection */
+ 0xc0, /* End collection */
};
static int t248_interrupts(struct t300rs_device_entry *t248)
@@ -185,6 +258,14 @@ static int t248_close(void *data)
return 0;
}
+static __u8 *t248_wheel_fixup(struct hid_device *hdev, __u8 *rdesc,
+ unsigned int *rsize)
+{
+ rdesc = t248_pc_rdesc_fixed;
+ *rsize = sizeof(t248_pc_rdesc_fixed);
+ return rdesc;
+}
+
int t248_populate_api(struct tmff2_device_entry *tmff2)
{
tmff2->play_effect = t300rs_play_effect;
@@ -192,15 +273,17 @@ int t248_populate_api(struct tmff2_device_entry *tmff2)
tmff2->update_effect = t300rs_update_effect;
tmff2->stop_effect = t300rs_stop_effect;
- tmff2->wheel_init = t248_wheel_init;
- tmff2->wheel_destroy = t248_wheel_destroy;
-
- tmff2->open = t248_open;
- tmff2->close = t248_close;
tmff2->set_gain = t300rs_set_gain;
+ tmff2->set_autocenter = t300rs_set_autocenter;
/* T248 only has 900 degree range, instead of T300RS 1080 */
tmff2->set_range = t248_set_range;
- tmff2->set_autocenter = t300rs_set_autocenter;
+ tmff2->wheel_fixup = t248_wheel_fixup;
+
+ tmff2->open = t248_open;
+ tmff2->close = t248_close;
+
+ tmff2->wheel_init = t248_wheel_init;
+ tmff2->wheel_destroy = t248_wheel_destroy;
return 0;
}