Commit Graph

714 Commits

Author SHA1 Message Date
Benjamin Tissoires
f108ffa9ff hidpp20: remove internal project name
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-02 10:49:07 +01:00
Peter Hutterer
f233b6bf77 data: add a README on how do do the data files
And update all devices to match the the requirements

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-02 09:09:17 +01:00
Peter Hutterer
c95d8e05ca lur: Add a note that we're not doing OOM
Mostly inherited from our zalloc() implementation. But really,
if you have no memory left, should you be trying to talk to receivers?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-02 09:08:58 +01:00
Peter Hutterer
b3237fd001 lur: change new_from_hidraw to return an errno
Makes debugging slightly more useful than just returning NULL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-02 09:08:13 +01:00
Benjamin Tissoires
7704c102e4 lur: add lur_device_get/set_userdata
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
BT: move the functions in LIBLUR_0.4.0
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-02 09:08:05 +01:00
Peter Hutterer
55cb7447f9 lur: capitalize use of Logitech Unifying Receiver
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-02 14:40:41 +10:00
bentiss
77eaa70f77 Merge pull request #63 from phomes/G9-set-profile
hidpp10: write profile for G9
2016-03-01 23:45:30 +01:00
Thomas Hindoe Paaboel Andersen
70d864af09 hidpp10: write profile for G9 2016-03-01 23:37:54 +01:00
bentiss
15968c8e39 Merge pull request #62 from phomes/g9-features
hidpp10: Add button mappings for G9
2016-03-01 23:12:00 +01:00
bentiss
0558bd4101 Merge pull request #61 from phomes/cleanup
Follow up for #56
2016-03-01 23:10:56 +01:00
Thomas Hindoe Paaboel Andersen
3962ec7745 hidpp10: Add button mappings for G9
There are 10 buttons defined in the profile but only 9 physical
buttons. LGS also only allows to configure 9 of them. Button 5
is the "dead" button in the list.
2016-03-01 22:11:47 +01:00
Thomas Hindoe Paaboel Andersen
2164a3b549 libratbag: remove unused variable 2016-03-01 21:20:23 +01:00
Thomas Hindoe Paaboel Andersen
f0417a9535 hidpp10: Add definition for buttons on the G9 2016-03-01 21:20:18 +01:00
Thomas Hindoe Paaboel Andersen
9d9c42cc6a hidpp10: rename structs wrt _sym vs. _dual
Follow up for review in #56
2016-03-01 21:20:13 +01:00
Benjamin Tissoires
efd15a33fb configure.ac: libratbag 0.3
Soname bump for liblur and libratbag as they were not properly versioned.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
v0.3
2016-03-01 17:04:39 +01:00
Benjamin Tissoires
b804e117c1 hidpp20drv: fix segfault when a device is not powered on
We were returning 0 and libratbag tried to access the profiles afterward.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 16:59:32 +01:00
Benjamin Tissoires
b54d28ec1a tools: add a man for ratbag-command
Just duplicated the help.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 16:46:31 +01:00
Benjamin Tissoires
388dae76bc libratbag.sym: bump symbols version
0.1.0 never existed, the first release was 0.2 :)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 15:35:33 +01: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
Benjamin Tissoires
9aa8938eb8 hidpp20: profiles: make sure the mouse is in the profiles mode, not HID
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 15:05:50 +01:00
Benjamin Tissoires
25094daaed hidpp20: profiles: make sure device is compatible with our implementation
Get_Profile_Info gives valuable information to know if we are compatible
with a given device. Use it and bail out if we are not able to support
the device.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 14:57:19 +01:00
Benjamin Tissoires
39069623f2 hidpp20drv: bail out if the features are not working as expected
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 14:36:03 +01:00
Benjamin Tissoires
d5c74682f1 Add missing carriage return when the driver does not match
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 14:32:42 +01:00
Benjamin Tissoires
6cba2abd8e hidpp20: reorder profile initialization
Spec says the profile count is stored in byte 3 of
CMD_ONBOARD_PROFILES_GET_PROFILES_DESCR, so use this to allocate the proper
number of profiles.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 14:15:15 +01:00
Peter Hutterer
f58b91a9b2 When setting a button action, update our internal state on success
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2016-02-29 09:58:18 +10:00
Peter Hutterer
de08323609 Fix return for ratbag_button_get_special when we don't have a special action
Do what the doc says.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-24 10:51:28 +10:00
Peter Hutterer
5fcdfab2a6 Fix a doxygen ref
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-24 10:51:07 +10:00
Benjamin Tissoires
e07839bcee tools: remove no-install flag for lur-command
The resulting RPM complains about RPATH.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-18 14:25:18 +01:00
Benjamin Tissoires
2f6e1ceb73 libratbag v0.2
Doing just a first release of libratbag with its current features and
problems. This will help other tools to properly link against anything
libratbag >= 0.2

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
v0.2
2016-02-17 15:26:12 +01:00
bentiss
0df95f5c96 Merge pull request #60 from whot/master
Install the data files in $(datadir)
2016-02-17 08:13:17 +01:00
Peter Hutterer
9c37f5c300 Install the data files in $(datadir)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-17 16:46:46 +10:00
Benjamin Tissoires
c657178d22 hidpp10drv: fix capabilities for gaming mice
Missing from 960ee73da9.

In case a hid++ 1.0 device has only 1 profile enabled under LGS, libratbag
exports only 1 profile, and thus the profile and button keys capabilities
are missing.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-11 11:16:30 +01:00
Peter Hutterer
2e1321cf93 Remove ratbag_profile_is_default from header file too
Missing from ff2d9713f7

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-11 17:18:46 +10:00
Peter Hutterer
e1c3449d03 Merge branch 'WIP/remove_default_profile' of https://github.com/bentiss/libratbag 2016-02-11 11:01:22 +10:00
Peter Hutterer
04e6f765d1 Merge pull request #59 from bentiss/WIP/remove_has_capability
Remove has_capability driver stub
2016-02-11 10:51:09 +10:00
Benjamin Tissoires
ff2d9713f7 Remove the default profile capability
We do not have any driver using it, and we are not sure this will even
be required. Before releasing a version with this, remove it. We
can always re-add this later if the need appears.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-10 15:22:25 +01:00
Benjamin Tissoires
960ee73da9 remove .has_capability() driver hook
Most of the capabilities can be inferred from
ratbag_device_init_profiles():
- if a device has more than one profile, we should be able to switch
  between its profiles
- likewise, more than one profile means that the buttons can be remapped
- more than one resolution means that we can change the resolution.

We need to add a stub in driver-test for .set_active_profile() now that
RATBAG_DEVICE_CAP_SWITCHABLE_PROFILES is correctly set.

We manually add the macro capability for all drivers that present it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-10 15:08:35 +01:00
Benjamin Tissoires
80fd187c3c Dynamically allocate the resolutions
We were limited to MAX_RESOLUTIONS (10). Also, this allows to know
during ratbag_device_init_profiles() if the device supports
switchable resolutions.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-10 14:39:38 +01:00
Benjamin Tissoires
df088466ae hidpp20drv: rework the initialisation process
Do not interleave some internal ratbag initialisation with the hidpp20
initial reading.
During early init, we are just interested in knowing how many
profiles/resolutions/buttons the device supports, so we should not read
more than required.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-10 14:34:14 +01:00
Benjamin Tissoires
3c3277a403 hidpp20drv: rework hidpp20drv_read_profile()
The current code might call some other function when the device supports
onboard profiles. We should not query those extra functions given that
the profiles should give us all we need.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-10 14:34:11 +01:00
Benjamin Tissoires
2f1c28598c hidpp20drv: extract hidpp20drv_read_resolution_dpi_2201()
Dissociate the reading of the data from the device of the actual storing
of those data in the profiles. This will allow to call
hidpp20drv_read_resolution_dpi_2201() without having profiles to know how
many sensors are in the device.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-10 14:34:03 +01:00
Benjamin Tissoires
0fccfc2338 test: check for the active resolution in the device
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2016-02-09 15:15:46 +01:00
Benjamin Tissoires
638c6fb560 remove dead code in ratbag_profile_is_active()
The driver hook .get_active_profile() has been removed for a while now,
so remove this ugly #if 0.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-09 14:42:55 +01:00
Benjamin Tissoires
0c826ef251 fix copy/paste error in ratbag_profile_set_default()
It does not make sense to check for .set_active_profile() and then
use .set_default_profile().

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-09 14:42:52 +01:00
Benjamin Tissoires
400823f37e drv-hidpp20: enable the profile when switching to it
libratbag external API is currently not aware whether a given profile is
enabled or not. Before switching to a disabled profile, we need to enable
it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-09 14:42:49 +01:00
Benjamin Tissoires
54fa8b6fa4 drv-hidpp20: implement set_current_profile()
Only enabled for PROFILES_8100.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-09 14:42:45 +01:00
Benjamin Tissoires
f3679bc8e7 hidpp20: fix return value of hidpp20_onboard_profiles_write()
data is a uint8_t*, so its size could never be 256, the size of the
profile.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-02-09 14:42:40 +01:00
bentiss
2bfab83470 Merge pull request #57 from NoXPhasma/NoXPhasma-patch-1
Add G500 profile to G9x mice
2016-01-12 14:06:46 +01:00
NoXPhasma
65e104d588 Add G500 profile to G9x mice 2016-01-12 12:58:26 +01:00
bentiss
accece5ed0 Merge pull request #56 from phomes/G9-profile-parse
hidpp10: Parse G9 profile
2016-01-08 09:48:12 +01:00