Commit Graph

29 Commits

Author SHA1 Message Date
Lyude
e543723856 Add support for the gskill-mx780
This commit adds complete (with the exception of LEDs and a few other
small things) support for configuring the G.Skill Ripjaws MX780. So far
this has been tested on firmware versions 19 and 21, and both of them
seem to work perfectly with this.

Changes since v1:
- Lots of style fixes
- Remove reset hook, comment out with #if 0 in case of usage in the
  future
- Add ret = -EAGAIN check in the loop in gskill_general_cmd()
- Explain why we wait longer then the spec says to in
  gskill_general_cmd()
- Check that buf[0] is set to GSKILL_GENERAL_CMD in gskill_general_cmd()
- Add some notes as to why we don't use gskill_general_cmd() in
  gskill_select_profile()
- Cleanup return codes, change gskill_general_cmd() so it only returns
  valid error codes. In places not using gskill_general_cmd(), do
    return rc < 0 ? rc : -EPROTO;
- Split command for selecting the macro to read/write from into it's own
  function, just like we do with the profile
- Move profile count workaround into it's own function, make explicit
  note of why it's needed
- Add proper support for reading/writing profile/macro names, ensure
  they aren't left blank so as to not confuse G.Skill's software
- Use HID kbd modifier codes for translating macro kbd modifier codes
- Use AS_MASK instead of (1 << foo) (apparently we already had this :)

Signed-off-by: Lyude <cpaul@redhat.com>
2016-10-06 14:12:10 +02:00
Peter Hutterer
b6294d4f93 Add a new header for PID/VIDs that we need to care about
Beats having the same #define in multiple places

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-29 09:56:22 +10:00
Benjamin Tissoires
19f87790bb Add liblur versioning and pkg-config
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2016-03-01 15:34:46 +01:00
Peter Hutterer
23e3a09968 Add liblur, a library for logitech unifying receivers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-10 09:16:03 +10:00
Benjamin Tissoires
3e8bf85c04 hidpp10: build a table of available dpi settings
Each hidpp10 device should have a udev property named either
RATBAG_HIDPP10_DPI or RATBAG_HIDPP10_DPI_LIST. These properties ensure
that we know the mapping between the raw value of the dpi reported by the
mouse and the actual value.

Older devices (using the scheme 1 or 2 of hidpp10_get_current_resolution)
have to use the DPI_LIST to be able to map 0x80+.
Newer devices (using scheme 3) use the DPI setting with min, max, step.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-11-25 11:21:51 +01:00
Peter Hutterer
99e1002701 Build libratbag-util as helper library
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-10-23 09:49:56 -04:00
Peter Hutterer
74457d111d Use the hidpp.la helper library in libratbag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-10-23 07:21:38 +10:00
Peter Hutterer
c024de52ea Merge hidpp10.la and hidpp20.la together into one single helper lib
No real reason to keep the two separate, and if we do and need to include both
libraries, we get double-defined symbols (all the ones in hidpp-generic.c).
This is a helper lib only anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-10-23 07:21:38 +10:00
Benjamin Tissoires
06c742d172 tools: add a tool to dump the memory of hidpp20 devices
Mostly copy/paste from hidpp10-dump-page

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-10-20 17:38:19 -04:00
Peter Hutterer
0cb1fe44ad tools: ad a hidpp10-dump-page tool to dump a HID++1.0 device's memory
For protocol debugging, it's a lot easier to go have a simple helper than
having to go through the whole of libratbag.

And remove the page-dump helper from the main code.

Note that this tool needs a /dev/hidraw device directly, not an event node. It
is a debugging tool after all.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-10-16 08:22:11 +10:00
Benjamin Tissoires
2bc5b1910a Add roccat implementation
This driver is basically a duplicate of the Etekcity.
After the copy-paste, I renamed all the the "etekcity"
by "roccat" and then rev-engineered the various constants.

Still a WIP, but it is getting usable.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-11 17:44:58 -04:00
Peter Hutterer
28a94d0974 Add a test suite
Two components are added here: a test driver that takes a struct
ratbag_test_device and sets that device up as a ratbag device.
That device is returned to the tests and then checked for sanity.

The ratbag_device_new_test_device() requires the environment variable
RATBAG_TEST set, otherwise we abort. It's also 'hidden' in a separate source
file, so it won't show up in doxygen. And if the test are disabled, this
function does nothing and the test driver never gets registered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-03 16:28:43 -04:00
Benjamin Tissoires
88a2aea3c2 etekcity: retrieve and dump the macros
Still not hooked up in the library, but re-assigning back a different
hard-coded macro works.

This also re-introduce the dependency on libevdev for the lib.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-27 17:49:16 -04:00
Peter Hutterer
872d522364 hidpp: move the shared defines into a generic header
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-24 15:03:29 +10:00
Peter Hutterer
529a69e120 Split HID++ 1.0 into a separate driver
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 15:11:57 +10:00
Peter Hutterer
b15923d620 Rename the unifying driver to hidpp20
This driver is really a driver for HID++ 2.0 devices, not just for devices on
the unifying receiver.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 11:11:47 +10:00
Benjamin Tissoires
b8637f0bc3 Add first hid++ 2.0 protocol support
The Logitech devices talk HID++, and we need a lib to handle that.
The first implemented command is the get protocol version which allows
to know if the device is using hid++ 1.0 or 2.0.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 14:12:08 -04:00
Benjamin Tissoires
c32c1471cb hidpp10: switch to libratbag debug system
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 12:13:45 -04:00
Peter Hutterer
95c8baa043 Move the m705 driver to libratbag proper
Note that this doesn't do anything yet, it's stubbed out everywhere except for
the button mapping bit where we already had some testing code from uLogitech.

This also adds the ID for the m570 trackball - a device I have available here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-20 16:08:57 +10:00
Peter Hutterer
9e37ce059b Rename etekcity.c to driver-etekcity.c
Better namespacing for drivers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-20 14:59:46 +10:00
Peter Hutterer
279bceb2d7 Drop unifying src files, use hidpp10 instead
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-20 14:59:46 +10:00
Peter Hutterer
f36f4d22a7 Start moving uLogitech files into libratbag proper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-20 14:59:46 +10:00
Benjamin Tissoires
8f723d084d Do not require libevdev to compile it
we don't use it for now, so drop the requirement.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-19 14:35:03 -04:00
Benjamin Tissoires
8d5088b9c6 Add ratbag-hidraw to deal with low level hidraw communication
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-14 23:12:25 -04:00
Benjamin Tissoires
b98477a7ec Retrieve through udev the hidraw node associated to the given input device
Most gaming mice use a specific HID protocol to configure the device.
Allow to retrieve the hidraw node associated to the mouse so we can talk
to it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-14 17:39:23 -04:00
Benjamin Tissoires
f5474cf9ec Add first implementation of etekcity
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-14 17:39:14 -04:00
Benjamin Tissoires
b7564682f4 Borrow libinput-util.c to handle lists, array and bitfields
Some valuable helpers from libinput.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-14 17:39:06 -04:00
Benjamin Tissoires
5c206ff205 Add a context for libratbag
This is useful to have some udev helpers, or the list of drivers.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-14 17:38:35 -04:00
Peter Hutterer
3fefe97451 Scaffolding for a libratbag, a mouse configuration library
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-13 11:55:07 +10:00