Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e5efb2243 | ||
|
|
5416f537bf | ||
|
|
3db0eef19a | ||
|
|
d132ca633f | ||
|
|
02a07521ae | ||
|
|
ab76f16c32 | ||
|
|
a0b20c7055 | ||
|
|
11ed3dd91e | ||
|
|
776dccf8f9 | ||
|
|
96088a6c56 | ||
|
|
eb3766ac30 |
@@ -16,7 +16,8 @@ And that's basically it
|
|||||||
## What devices are supported?
|
## What devices are supported?
|
||||||
### Bases:
|
### Bases:
|
||||||
1. MOZA R3, R5, R9, R12, R16, R21
|
1. MOZA R3, R5, R9, R12, R16, R21
|
||||||
2. ...
|
2. Cammus C5
|
||||||
|
3. ...
|
||||||
|
|
||||||
## What works?
|
## What works?
|
||||||
1. FFB (all effects from device descriptor)
|
1. FFB (all effects from device descriptor)
|
||||||
@@ -59,6 +60,9 @@ To unload module:
|
|||||||
|
|
||||||
**[Android App](https://play.google.com/store/apps/details?id=com.gudsen.mozapithouse)**
|
**[Android App](https://play.google.com/store/apps/details?id=com.gudsen.mozapithouse)**
|
||||||
|
|
||||||
|
### Cammus
|
||||||
|
**[Android App](https://play.google.com/store/apps/details?id=com.cammus.simulator)**
|
||||||
|
|
||||||
## Known issues with the driver
|
## Known issues with the driver
|
||||||
- Buttons above 80 simply don't show up. This is a Linux limitation and we're trying to fix that in the upstream
|
- Buttons above 80 simply don't show up. This is a Linux limitation and we're trying to fix that in the upstream
|
||||||
|
|
||||||
|
|||||||
@@ -9,4 +9,7 @@
|
|||||||
#define USB_DEVICE_ID_MOZA_R12 0x0006
|
#define USB_DEVICE_ID_MOZA_R12 0x0006
|
||||||
#define USB_DEVICE_ID_MOZA_R16_R21 0x0000
|
#define USB_DEVICE_ID_MOZA_R16_R21 0x0000
|
||||||
|
|
||||||
|
#define USB_VENDOR_ID_CAMMUS 0x3416
|
||||||
|
#define USB_DEVICE_ID_CAMMUS_C5 0x0301
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ static const struct hid_device_id pidff_wheel_devices[] = {
|
|||||||
.driver_data = PIDFF_QUIRK_FIX_WHEEL_DIRECTION | PIDFF_QUIRK_FIX_PERIODIC_ENVELOPE },
|
.driver_data = PIDFF_QUIRK_FIX_WHEEL_DIRECTION | PIDFF_QUIRK_FIX_PERIODIC_ENVELOPE },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_MOZA, USB_DEVICE_ID_MOZA_R16_R21),
|
{ HID_USB_DEVICE(USB_VENDOR_ID_MOZA, USB_DEVICE_ID_MOZA_R16_R21),
|
||||||
.driver_data = PIDFF_QUIRK_FIX_WHEEL_DIRECTION | PIDFF_QUIRK_FIX_PERIODIC_ENVELOPE },
|
.driver_data = PIDFF_QUIRK_FIX_WHEEL_DIRECTION | PIDFF_QUIRK_FIX_PERIODIC_ENVELOPE },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_CAMMUS, USB_DEVICE_ID_CAMMUS_C5),
|
||||||
|
.driver_data = PIDFF_QUIRK_NO_DELAY_EFFECT },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(hid, pidff_wheel_devices);
|
MODULE_DEVICE_TABLE(hid, pidff_wheel_devices);
|
||||||
@@ -69,9 +71,9 @@ static int universal_pidff_probe(struct hid_device *hdev,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = hid_pidff_init_with_quirks(hdev, id);
|
ret = hid_pidff_init_quirks(hdev, id);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
hid_warn(hdev, "Force feedback not supported\n");
|
hid_warn(hdev, "Force feedback is not supported\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
40
hid-pidff.c
40
hid-pidff.c
@@ -369,7 +369,9 @@ static void pidff_set_effect_report(struct pidff_device *pidff,
|
|||||||
pidff->effect_direction->value[0] =
|
pidff->effect_direction->value[0] =
|
||||||
pidff_rescale(direction, 0xffff, pidff->effect_direction);
|
pidff_rescale(direction, 0xffff, pidff->effect_direction);
|
||||||
|
|
||||||
pidff->set_effect[PID_START_DELAY].value[0] = effect->replay.delay;
|
if (!(pidff->quirks & PIDFF_QUIRK_NO_DELAY_EFFECT)) {
|
||||||
|
pidff->set_effect[PID_START_DELAY].value[0] = effect->replay.delay;
|
||||||
|
}
|
||||||
|
|
||||||
hid_hw_request(pidff->hid, pidff->reports[PID_SET_EFFECT],
|
hid_hw_request(pidff->hid, pidff->reports[PID_SET_EFFECT],
|
||||||
HID_REQ_SET_REPORT);
|
HID_REQ_SET_REPORT);
|
||||||
@@ -814,7 +816,9 @@ static void pidff_autocenter(struct pidff_device *pidff, u16 magnitude)
|
|||||||
pidff->set_effect[PID_TRIGGER_REPEAT_INT].value[0] = 0;
|
pidff->set_effect[PID_TRIGGER_REPEAT_INT].value[0] = 0;
|
||||||
pidff_set(&pidff->set_effect[PID_GAIN], magnitude);
|
pidff_set(&pidff->set_effect[PID_GAIN], magnitude);
|
||||||
pidff->set_effect[PID_DIRECTION_ENABLE].value[0] = 1;
|
pidff->set_effect[PID_DIRECTION_ENABLE].value[0] = 1;
|
||||||
pidff->set_effect[PID_START_DELAY].value[0] = 0;
|
if (!(pidff->quirks & PIDFF_QUIRK_NO_DELAY_EFFECT)) {
|
||||||
|
pidff->set_effect[PID_START_DELAY].value[0] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
hid_hw_request(pidff->hid, pidff->reports[PID_SET_EFFECT],
|
hid_hw_request(pidff->hid, pidff->reports[PID_SET_EFFECT],
|
||||||
HID_REQ_SET_REPORT);
|
HID_REQ_SET_REPORT);
|
||||||
@@ -1316,9 +1320,9 @@ static int pidff_check_autocenter(struct pidff_device *pidff,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if the device is PID and initialize it
|
* Check if the device is PID and initialize it, with quirks
|
||||||
*/
|
*/
|
||||||
int hid_pidff_init(struct hid_device *hid)
|
int hid_pidff_init_quirks(struct hid_device *hid, const struct hid_device_id *id)
|
||||||
{
|
{
|
||||||
struct pidff_device *pidff;
|
struct pidff_device *pidff;
|
||||||
struct hid_input *hidinput = list_entry(hid->inputs.next,
|
struct hid_input *hidinput = list_entry(hid->inputs.next,
|
||||||
@@ -1340,6 +1344,8 @@ int hid_pidff_init(struct hid_device *hid)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pidff->hid = hid;
|
pidff->hid = hid;
|
||||||
|
pidff->quirks |= id->driver_data;
|
||||||
|
hid_dbg(dev, "Device quirks: %d\n", pidff->quirks);
|
||||||
|
|
||||||
hid_device_io_start(hid);
|
hid_device_io_start(hid);
|
||||||
|
|
||||||
@@ -1417,29 +1423,3 @@ int hid_pidff_init(struct hid_device *hid)
|
|||||||
kfree(pidff);
|
kfree(pidff);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Check if the device is PID and initialize it
|
|
||||||
* Add quirks after initialisation
|
|
||||||
*/
|
|
||||||
int hid_pidff_init_with_quirks(struct hid_device *hid, const struct hid_device_id *id)
|
|
||||||
{
|
|
||||||
int error = hid_pidff_init(hid);
|
|
||||||
|
|
||||||
if (error)
|
|
||||||
return error;
|
|
||||||
|
|
||||||
struct hid_input *hidinput = list_entry(hid->inputs.next,
|
|
||||||
struct hid_input, list);
|
|
||||||
struct input_dev *dev = hidinput->input;
|
|
||||||
struct pidff_device *pidff = dev->ff->private;
|
|
||||||
|
|
||||||
/* set quirks on the pidff device */
|
|
||||||
hid_device_io_start(hid);
|
|
||||||
pidff->quirks |= id->driver_data;
|
|
||||||
hid_device_io_stop(hid);
|
|
||||||
|
|
||||||
hid_dbg(dev, "Device quirks: %d\n", pidff->quirks);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#define PIDFF_QUIRK_NO_DELAY_EFFECT BIT(2)
|
#define PIDFF_QUIRK_NO_DELAY_EFFECT BIT(2)
|
||||||
|
|
||||||
|
|
||||||
int hid_pidff_init(struct hid_device *hid);
|
int hid_pidff_init_quirks(struct hid_device *hid, const struct hid_device_id *id);
|
||||||
int hid_pidff_init_with_quirks(struct hid_device *hid, const struct hid_device_id *id);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user