Commit Graph

156 Commits (feature/cpp-library)

Author SHA1 Message Date
nirenjan b7141a3e8b Add check for joystick when initializing library
Fix C++ inclusion
2015-12-06 12:57:15 -08:00
nirenjan f2ee9707cb Wrap public header in extern C 2015-12-05 23:22:11 -08:00
nirenjan 531c92ecab Add header file to x52test_SOURCES
The absence was causing `make distcheck' to fail.
2015-12-04 20:33:08 -08:00
nirenjan b7fe3e484c Enhance clock test to test all portions of clock 1 2015-12-04 19:34:19 -08:00
nirenjan f8a7257b54 Export vendor command interface
The vendor command interface allows the user to write a vendor request
packet using the known vendor interface. However, it is not intended for
regular use, since the existing API is better suited to abstract it away
from the user. Rather, the prime goal is for a test harness interface
that can be used to debug problems seen during regular library accesses.
2015-12-04 18:27:21 -08:00
nirenjan cd4fca0d2e Add tests for blink, shift & clock display 2015-12-04 17:58:34 -08:00
nirenjan ebf566d9be Add retry to libx52_vendor_command
Sometimes the vendor control request failes with LIBUSB_PIPE_ERROR. Most
of the time a retry fixes it right away. To allow for a transient
failure, make the function retry the control transfer up to 3 times
before failing.
2015-12-04 16:44:41 -08:00
nirenjan 21f5440349 Make x52test more verbose 2015-12-04 10:48:24 -08:00
nirenjan 9dcc3507ed Fix Readme & help output 2015-12-03 08:39:01 -08:00
nirenjan 5d0684a154 Add x52cli command for interfacing with the X52Pro
This adds a CLI frontend to the X52 library so that the user can send
the joystick commands without having to write any code.
2015-12-02 19:11:06 -08:00
nirenjan f4a81aba83 Move spec documents under docs folder 2015-12-02 08:29:45 -08:00
nirenjan 8813be2de2 Fix file extension
GitHub screws up the formatting if it is saved with .md extension
2015-12-01 08:32:20 -08:00
nirenjan 87fe93f6e9 Add parsed HID report
Report descriptor can be obtained from
/sys/bus/hid/devices/.../report_descriptor.

Once dumped in hex, the parser at
http://eleccelerator.com/usbdescreqparser/ can convert it to a human
readable format.
2015-12-01 08:29:57 -08:00
nirenjan dbac37b8ac Add README for kernel module 2015-12-01 08:29:12 -08:00
nirenjan b72eba6d4c Fix permissions on device attribute files
Build fails on Linux kernel version >= 4.0.0, due to a permissions check
disallowing S_IWOTH.
2015-12-01 08:23:28 -08:00
nirenjan c1f3b6abdf Add installation instructions 2015-11-30 23:37:22 -08:00
nirenjan edfff0a5f6 Add readme for libx52 2015-11-30 23:23:27 -08:00
nirenjan 77cf6c490f Move test program into src directory 2015-11-30 22:52:12 -08:00
nirenjan 032dda1dd4 Cleanup autotools code and add gitignore 2015-11-30 22:30:14 -08:00
nirenjan 5e4a6dc826 Use autotools to generate library 2015-11-30 22:12:16 -08:00
nirenjan d688334eb9 Add code to write clocks 2015-11-30 20:54:55 -08:00
nirenjan 995c5b3c63 Breakout functionality into individual files 2015-11-30 20:12:34 -08:00
nirenjan 2ccfd79bd6 Remove deprecated API functions 2015-11-30 20:02:54 -08:00
nirenjan 548f2e9357 Document X52 library functions
This is still a relative work-in-progress, since some of the functions
are being cleaned and enhanced to provide proper functionality similar
to the Windows driver.
2015-11-29 22:50:36 -08:00
nirenjan 4a1ca0badb Retrieve hidraw file from command line 2015-11-28 10:06:38 -08:00
nirenjan 0a541e18ba Update test cases for X52 library 2015-11-28 10:04:12 -08:00
nirenjan b5d33226c5 Implement all X52 Pro vendor commands
The current contents of the libx52 folder contain all the source code
necessary to implement the X52 Pro vendor API. These have been tested,
although the committed test file does not list all the APIs.
2015-10-31 23:19:10 -07:00
nirenjan 0ad08ac623 Merge pull request #3 from nirenjan/deprecated-macros
Replace err/dbg macros with pr_err/pr_debug
2014-10-19 05:23:05 +00:00
nirenjan e54dfd94d2 Use dev_err/dev_dbg when device is available
Previous commit used pr_err/pr_debug because it mistakenly assumed that
the device pointer was not available. This ensures that the driver uses
the dev_err and dev_dbg functions wherever it can.
2014-10-17 14:43:22 +00:00
nirenjan b752c3e46b Replace err/dbg macros with pr_err/pr_debug
err macro has been removed entirely from the Linux kernel starting from
around v3.5, while the dbg macro has been deprecated. Since the lines
that were using err/dbg did not have access to the device, simply log as
a generic kernel log.
2014-10-17 14:22:57 +00:00
nirenjan 46f9995959 Add X52 key mappings and moved pages document 2013-07-04 15:38:50 -07:00
nirenjan 84774018bf Add X52 MFD pages document
This document describes the API to update pages on the MFD.
2013-01-17 22:04:30 -08:00
Nirenjan Krishnan 2fd5f29ade Correct handling of URB for stick axes - closes #1
The le32_to_cpu function doesn't quite work for some reason. Manually
writing the 32-bit conversion seems to fix the axes reporting for
ABS_X, ABS_Y and ABS_RZ.
2012-10-25 00:01:05 -07:00
nirenjan 75346c745a Fix params to input_set_abs_params - should fix #1
This still could use a bit of investigation to see why
input_set_abs_params called with non-zero values for fuzz and flat
causes axis motion to be ignored, although it may be a driver
subsystem issue in Linux.
2012-10-24 15:14:33 -07:00
Nirenjan Krishnan 223331342e Add libx52 API files
Initial frmework of libx52. This library allows the user to write to
the X52 joystick MFD and LEDs.
2012-10-14 18:02:57 -07:00
Nirenjan Krishnan 76aaf6a6d8 Rename driver folder to kernel_module
Due to plans to scrap the kernel module approach and go with a full-fledged
userspace application, this commit renames the driver folder to kernel_module
so the folder contents are clear.
2012-10-14 12:55:52 -07:00
Nirenjan Krishnan 827c13bf85 Merge branch 'experimental'
This brings in changes to make the kernel module act like an input
device. However, this version does have one flaw, in that the axes
input for all the centered axes does not work. This is most likely
due to a bug in the invocation of input_set_abs_params. Only the
throttle and slider axes work, as does the hat. The other (minor)
issue is that the hat values show up as -32767 and +32767 instead
of -1 and +1 like the usbhid driver.
2012-10-11 21:10:26 -07:00
Nirenjan Krishnan a69ea22457 Fix bug where input is not getting reported
Because the joystick type was never set, the input irq handler never
called the x52pro_decode_urb function. This fixes that issue, however,
it still needs verification that the changes work.
2012-10-11 20:58:59 -07:00
Nirenjan Krishnan 0274c329a6 Add udev rules for making hidraw permissions 0644
This allows the programs that read hidraw for the X52 joystick to
not need root permissions.
2012-10-08 19:37:49 -07:00
Nirenjan Krishnan 7db56ee069 Rename driver name to 'saitek_x52'
This avoids any confusion with other devices named X52.
2012-10-08 18:37:27 -07:00
Nirenjan Krishnan a4ef90d3c1 Support for input devices - still experimental
This change adds an input device for the Saitek X52 pro flight control
system. However, with this change, there is some bug which causes a
kernel crash. Still debugging, but committing so that I don't lose data.
2012-10-08 16:21:24 -07:00
Nirenjan Krishnan a217fa486e Make driver more flexible for other devices
This adds a list of supported devices with flags for each device.
The flags control whether the MFD and/or LED are supported for
each supported device.

This also changes the deadzone structure to be more compliant with
the fuzz and flat parameters for absolute input.
2012-10-07 22:25:39 -07:00
Nirenjan Krishnan ebb4cc9042 Move common definitions to their own file
This change moves the common definitions to their own file so
that we can later rewrite the driver to accept the structure
as input.

A caveat with this approach is that it does prevent shell scripts
from updating the joystick, however, it eases the burden of
verification in the kernel, and it's not too hard to write
wrapper programs to write kernel structures to the files.
2012-10-07 00:08:40 -07:00
Nirenjan Krishnan dc6ef6fae0 Prevent rmmod while joystick is plugged in
Earlier versions of the module could be rmmod'ed while the X52 joystick
was still plugged in and running. Unplugging the joystick after the
module was removed resulted in a kernel crash.
2012-10-06 23:21:21 -07:00
Nirenjan Krishnan ce53d65021 Add blink LED support to driver
This commit also takes care of removing the device files when the
joystick is disconnected. Also, the line API files are renamed to
mfd_line[123].
2012-10-06 00:08:49 -07:00
Nirenjan Krishnan f1fdbe9c6a Move USB control messages to their own file
With this change, the X52 USB control API is moved to it's own
file in order to better separate the code and make it cleaner.

This change also renames the kernel module to saitek_x52.
2012-10-05 23:21:56 -07:00
Nirenjan Krishnan 60ff5826dd Add LED support to x52 joystick driver
This commit adds sysfs files to enable or disable the LEDs on the
X52 Pro joystick. This also fixes a minor bug with the brightness
API which was always complaining not-supported.
2012-10-05 10:38:34 -07:00
Nirenjan Krishnan d1dec19b95 Fix report format 2012-10-04 23:51:26 -07:00
Nirenjan Krishnan e57e8ced7f Update with HID raw output format
Tools folder now contains a program to read and dump the raw HID output
2012-10-03 01:02:21 -07:00
Nirenjan Krishnan 9006404f90 Move readjoy to its own folder under tools 2012-10-02 11:55:12 -07:00