Commit Graph

325 Commits

Author SHA1 Message Date
Peter Hutterer
05e65b1310 Change ratbag_device_init into ratbag_device_new()
Same functionality

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-03 12:51:09 +10:00
Peter Hutterer
491fffad16 Drop ratbag_device_set_hidraw_device()
Unused as of 2fbf156403

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-03 12:51:09 +10:00
Peter Hutterer
2bcfb825c0 Misc code cleanups
Simplifying things, adding a bit of error checking, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-03 12:51:09 +10:00
Peter Hutterer
a1935a76ac Fix the log_bug_client macro
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-03 12:51:09 +10:00
Benjamin Tissoires
b9376bdc67 tools: split out some shared functions
Allows to reuse them in other tools

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-02 22:20:00 -04:00
Peter Hutterer
3afc1ffdd8 Merge pull request #3 from phomes/master
A few cleanups
2015-09-03 07:50:27 +10:00
Thomas Hindoe Paaboel Andersen
9011876d1b drop inconsistent null check
We do not check dev for null in any of the other functions. If it
was actually null then we would also already have got a null pointer
dereference earlier in the function.
2015-09-02 22:03:05 +02:00
Thomas Hindoe Paaboel Andersen
5f2d538e10 Avoid overflow when reading dpi list
LONG_MESSAGE_LENGTH is the length of the full message so we should
take the first parts of the union into account.
2015-09-02 21:59:06 +02:00
Thomas Hindoe Paaboel Andersen
f30ea0dc4d RATBAG_BUTTON_TYPE_UNKNOWN is not a ratbag_button_action
Just return a NULL. RATBAG_BUTTON_TYPE_UNKNOWN is 0 so no functional
change intendend here.
2015-09-02 21:40:05 +02:00
Benjamin Tissoires
d2d5566156 data: add an SVG for the MX Master
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-02 11:59:55 -04:00
Benjamin Tissoires
1e1dfd02fd Add a ratbag_device_get_svg_name() function
To retrieve which SVG file is associated to which device.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-02 11:02:03 -04:00
Benjamin Tissoires
4644614da5 hidppdrvs: remove terminating comma in LOGITECH_DEVICE() macro
Or it leads to interesting errors when adding fields to the table
of supported devices.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-02 10:48:49 -04:00
Benjamin Tissoires
77035a08ae etekcity: make sure action is valid before dereferencing it
This should never happen on the Etekcity Scroll Alpha, but we might end
up in a situation where this is required.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-02 10:36:40 -04:00
Benjamin Tissoires
9ccaaa9ea9 etekcity: retrieve the "on-to-go" setting
Still a mystery of what it is. Though I know how to get/set it, so let's
make it public until somebody claims what it is.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-02 10:35:33 -04:00
Benjamin Tissoires
9dd71c6b06 hidpp20drv: if the num_buttons has been filled, use it
Or we end up reading in non allocated memory in hidpp20drv_read_button().

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-02 10:26:52 -04:00
Peter Hutterer
531651088c Expand the get/set_user_data functions
Otherwise the symbol leak test won't recognize it and fails. It's not worth
hacking up that test to avoid implementing those few, so just write them out
instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-02 17:03:34 +10:00
Peter Hutterer
6ec078d43b Add hooks for getting/setting the default profile
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-02 17:03:34 +10:00
Peter Hutterer
8b1ebc4caa data: add an SVG for the G500s 2015-09-02 17:03:34 +10:00
Peter Hutterer
fe775e2b76 Fix doxygen for the driver interface
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-02 17:03:34 +10:00
Peter Hutterer
c01c37fcbf Implement ratbag_button_has_action_type
etekcity suppports macros already, the other two don't. hidpp10 doesn't
support any write stuff but let's claim we do anyway.

The driver hook for this isn't ideal, read_button is called during init but
we should set all this up during probe and then use read_button exclusively to
update the button, not set the capabilities as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-02 17:03:34 +10:00
Peter Hutterer
0d4a7486de Add some more documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-02 09:05:53 +10:00
Peter Hutterer
2bc1ca0dce Remove a documentation FIXME, a wheel click is different to a middle click
This is the physical description of the button, so there's a distinct
difference between the two, even when the logical action is the same.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-02 09:05:53 +10:00
Peter Hutterer
0a6dd96185 Shuffle things around in the public header
Move the struct declarations together (and move ratbag_device to the ratbag
device page), have the defgroup tags at the top of the file.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-02 09:05:53 +10:00
Benjamin Tissoires
4b9eae11d9 tools: cmd_info: if there is no profile, it's a bug...
...but we should not go further


Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-01 18:10:09 -04:00
Benjamin Tissoires
3d752a6d9d etekcity: add a svg representing the mouse and buttons
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-01 18:10:09 -04:00
bentiss
c46c334697 Merge pull request #2 from phomes/master
misc cleanups
2015-09-01 18:09:31 -04:00
Thomas Hindoe Paaboel Andersen
1439ba0f66 remove needless null check
profile was already dereferenced earlier in the function and cannot
be null anyway from the current callers of the function.

Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
2015-09-01 22:36:19 +02:00
Thomas Hindoe Paaboel Andersen
89559b3720 fix error path in hidpp10drv_probe
If we goto err early then both dev and drv_data will contain
garbage values. We free one and dereference the other. Let's
null them and add proper checks.

Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
2015-09-01 22:34:34 +02:00
bentiss
ad0ac1b6ea Merge pull request #1 from phomes/master
fix indentation
2015-09-01 12:05:38 -04:00
Thomas Hindoe Paaboel Andersen
6e21d75b5c fix indentation 2015-09-01 17:39:06 +02:00
Benjamin Tissoires
adc6b44242 update TODO
separate x/y resolution -> check!
has_capability for resolution -> check!
sensitivity -> new item

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-01 09:53:01 -04:00
Benjamin Tissoires
f476f03762 make ratbag_resolution_init() return the struct resolution pointer
It is a common pattern to have:
ratbag_resolution_init(...)
profile->resolution.modes[i].xxx = yyy;
ratbag_resolution_set_cap(&profile->resolution.modes[i], zzz)

So instead of dealing with the internal fields of profile/resolution/modes,
just return the resolution that has been initialized.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-01 09:49:18 -04:00
Benjamin Tissoires
051f92f980 etekcity: fix support of per axis resolution
In the end, we just ignore the sensitivity setting.
On the Etekcity, it looks like it is ignored by the mouse, or
maybe the Windows software just messes things up and should
not update the per-axis dpi when playing with sensitivity.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-01 09:48:11 -04:00
Peter Hutterer
99a9752104 Add per-resolution capabilities
Currently only the hooks for x/y resolution, the rest is unimplemented. Also
the etekcity driver needs an update here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-01 17:30:47 +10:00
Peter Hutterer
9383097fd2 Namespace the ratbag capabilities to the ratbag device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-01 17:25:55 +10:00
Peter Hutterer
ef33019b98 Update TODO
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-01 17:20:39 +10:00
Peter Hutterer
e182faa452 hidpp: add a couple of HID++ task_id mappings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-01 11:18:39 +10:00
Peter Hutterer
b4d6c3064a hidpp: add a couple of HID++ control_id mappings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-01 11:18:39 +10:00
Peter Hutterer
ef15072691 hidpp: replace the button mappings structs with a macro
No functional changes, this is in preparation for the future to make
replacing bits a bit easier - hopefully we only have to change the macro and
not every element then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-01 11:18:39 +10:00
Peter Hutterer
5cb15524d4 hidpp: move the button lookup tables to the generic code
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-01 10:55:19 +10:00
Thomas Hindoe Paaboel Andersen
29c0220eb2 etekcity: fix check for Y sensitivity 2015-09-01 09:06:27 +10:00
Benjamin Tissoires
c288ab0cbf etekcity: do not unref the active profile while in probe()
Left over from 49d70577c ("Replace get_active_profile with
profile_is_active")


Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-31 16:56:47 -04:00
Peter Hutterer
63e0ddc550 Add a LOG_LEVEL_RAW log level
Lower than debug, for spitting out all the protocol codes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-28 15:08:51 +10:00
Peter Hutterer
499ba42b16 doc: more documentation comments
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-28 12:27:46 +10:00
Peter Hutterer
36f92cf91e Always init at least one resolution mode
The one mode may be disabled and not configurable, but it's still more
predictable to have one that none.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-28 12:21:49 +10:00
Peter Hutterer
d620683e38 Add a helper function to init a resolution mode
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-28 12:21:49 +10:00
Peter Hutterer
ddfd408183 driver-hidpp10: return ENOTSUP for missing bits, not just -1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-28 12:06:17 +10:00
Peter Hutterer
aa27fbae8d Remove the get_active_profile driver hook
Long-term we should have probe() and read_profile(), the latter of which
should read each profile and fill in _all_ information.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-28 12:05:52 +10:00
Peter Hutterer
f5340d31e3 Remove the old resolution/report rate getters/setters
They already got removed from the library, only the declarations were left.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-28 11:57:58 +10:00
Peter Hutterer
57dffdcb26 Add documentation for the resolutions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-28 11:30:49 +10:00