aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2026-08-09avoid signed overflow when scaling gainKai Krakow
+ FF_GAIN and the driver gain both use the full 16-bit range. Their product can exceed INT_MAX. Signed overflow is undefined and happens for common settings such as 75 percent times 75 percent. Use a u32 intermediate for the scaling operation. + Pass the configured gain directly when initializing or updating the hardware. This also removes two redundant multiply-divide expressions which could overflow before cancelling out.
2026-08-09use an unsigned 16-bit type for gainKai Krakow
+ Gain is documented and sent to the hardware as a value in the range 0 to 65535, but the module parameter and sysfs attribute accept wider integer values. Store gain as a u16 and parse sysfs writes with kstrtou16 so out-of-range values are rejected instead of being silently changed. + This constrains only the configured value. Calculations combining gain values still require a wider intermediate to cover the product of two full-range 16-bit values.
2026-01-26Revert "use on_hid_hw_open instead of input_dev->open"Kimplul
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`.
2026-01-04use on_hid_hw_open instead of input_dev->openKimplul
+ Seems some applications can mess with input_dev->open, still unclear how but on_hid_hw_open seems to be a bit more reliable so use it for now at least
2025-12-01fix possibly uninitialized variableKimplul
2025-11-23remove extra whitespaceKimplul
2025-11-23correct tspc range to be 1080Kimplul
2025-11-23fix TS-XW -> TS-PC in init messageKimplul
2025-11-23add alt mode sysfs fileKimplul
2025-11-23add tspc mode switch for testingKimplul
2025-11-23apply initial tspc patchesKimplul
+ Courtesy of @BDave95
2025-11-03minimize critical section in work handlerKimplul
+ Effects handlers were being called in a locked context, which in this case happened to work due to how `hid_hw_request` is implemented. Now, only the selected state is updated and the heavy lifting of making the wheel aware of the requested changes is done after the critical section.
2025-07-28Merge branch 'refactor-duration' of github.com:MmAaXx500/hid-tmff2 into ↵Kimplul
MmAaXx500-refactor-duration
2025-07-24refactor effect length calculationMmAaXx500
- do the calculation in only one place - avoid losing 1 ms (if it ever matters)
2025-07-24fix periodic effect length on updateMmAaXx500
Avoid subtracting twice from the length of the effect first time in t300rs_calculate_periodic_values second time in t300rs_update_periodic
2025-01-26irqsave/irqrestore spinlocksKimplul
2024-12-18make firmware check a warningKimplul
+ Apparently this allows the T-GT II to work, as it shows up as a PS4 T300 RS, just that it has a different firmware version. Eventually I should maybe look into the firmware response a bit closer and check if I can fish out wheel information or something along those lines to improve wheel detection.
2024-11-24fix report_fixup() on linux 6.12MmAaXx500
"HID: change return type of report_fixup() to const" fe73965
2024-09-01Merge pull request #110 from MmAaXx500/forcecorrect_p3Kimplul
Effect corrections part3
2024-09-01fix styleMmAaXx500
2024-09-01fix incorrect return typeMmAaXx500
2024-09-01fix missing cpu_to_le16MmAaXx500
2024-08-22rework envelope handlingMmAaXx500
2024-08-08make some functions static to silence warningsKimplul
2024-07-26use single packet in constant effect updateMmAaXx500
2024-07-26use single packet in periodic effect updateMmAaXx500
2024-07-19fix ramp effect upload and updateMmAaXx500
2024-07-13Merge pull request #107 from MmAaXx500/forcecorrect_p2Kimplul
Effect corrections part2
2024-07-13style fixesMmAaXx500
2024-07-11always update all condition effect parametersMmAaXx500
2024-07-01Consider the delay to determine the length of the effectMmAaXx500
2024-06-25fix condition effect handlingMmAaXx500
- unified handling of all condition effects for uploads and updates - added new saturation parameters - added right, left, and right&left update type for saturation - added right&left update type for coefficient
2024-06-20Merge pull request #105 from MmAaXx500/forcecorrectKimplul
Force effect corrections part1
2024-06-20fix periodic effect offset calculationMmAaXx500
2024-06-20fix periodic effect magnitude and phase calculationMmAaXx500
2024-06-17correct constant force levelMmAaXx500
2024-06-16convert FF_RUMBLE ourselvesKimplul
2024-06-16move effect repeat count to wheelKimplul
+ This avoids a slight stutter when an effect is restarted. I also had a bug in the original code that effectively stopped the playing of some effects, whoops
2024-04-21Add support for TS-XW Raceryassine
2024-04-04fix error ladder in tmff2_wheel_initKimplul
2023-12-04make it more unlikely to fill up USB bufferKimplul
2023-10-08docs: general tidbitsKimplul
2023-10-04src, deps, docs: updateRaySlash
- Update the effects documents - Rename `hid-tm*` to `tm*` for folders - Move `Makefile` and `Kbuild` to root - Add `deps/` and move in [hid-tminit](https://github.com/scarburato/hid-tminit/commit/9375f6c7d83af5dd6c8b8fe30351d0f36043b20a)
2023-10-02src: initial refactoringRaySlash