summaryrefslogtreecommitdiff
path: root/src/linux/up-backend.c
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2012-08-07 00:11:19 +0200
committerRichard Hughes <richard@hughsie.com>2012-10-30 20:05:30 +0000
commit95184593504bca5240ecd296db98954decd2c5a5 (patch)
tree0c5d457a2ed0b50e3bfcc8257a979372c0dd8767 /src/linux/up-backend.c
parent2f03ad62b520fc5c02e3ff9eb5bffc4275eb88dc (diff)
downloadupower-95184593504bca5240ecd296db98954decd2c5a5.tar.gz
Add support for Logitech Unifying devices
This had support for Logitech devices working with an USB Unifying receiver. This has been tested for at least the Logitech K750 solar keyboard, the M705 and the M505 mouses. Multiple receivers are also supported. Signed-off-by: Julien Danjou <julien@danjou.info> Signed-off-by: Richard Hughes <richard@hughsie.com>
Diffstat (limited to 'src/linux/up-backend.c')
-rw-r--r--src/linux/up-backend.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c
index 52b430e..0ca6ca7 100644
--- a/src/linux/up-backend.c
+++ b/src/linux/up-backend.c
@@ -36,6 +36,7 @@
#include "up-device-supply.h"
#include "up-device-csr.h"
+#include "up-device-lg-unifying.h"
#include "up-device-wup.h"
#include "up-device-hid.h"
#include "up-input.h"
@@ -166,20 +167,27 @@ up_backend_device_new (UpBackend *backend, GUdevDevice *native)
/* check input device */
input = up_input_new ();
ret = up_input_coldplug (input, backend->priv->daemon, native);
- if (!ret) {
- g_object_unref (input);
- goto out;
- }
-
- /* we now have a lid */
- up_daemon_set_lid_is_present (backend->priv->daemon, TRUE);
+ if (ret) {
+ /* we now have a lid */
+ up_daemon_set_lid_is_present (backend->priv->daemon, TRUE);
- /* not a power device */
- up_device_list_insert (backend->priv->managed_devices, G_OBJECT (native), G_OBJECT (input));
+ /* not a power device */
+ up_device_list_insert (backend->priv->managed_devices, G_OBJECT (native), G_OBJECT (input));
- /* no valid input object */
- device = NULL;
+ /* no valid input object */
+ device = NULL;
+ } else {
+ g_object_unref (input);
+ /* see if this is a Unifying mouse or keyboard */
+ device = UP_DEVICE (up_device_unifying_new ());
+ ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
+ if (!ret) {
+ g_object_unref (device);
+ /* no valid input object */
+ device = NULL;
+ }
+ }
} else {
native_path = g_udev_device_get_sysfs_path (native);
g_warning ("native path %s (%s) ignoring", native_path, subsys);