summaryrefslogtreecommitdiff
path: root/src/linux/up-backend.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2011-01-04 18:05:09 +0000
committerRichard Hughes <richard@hughsie.com>2011-01-04 18:05:09 +0000
commit17b7aef701c1dfac0376149aba64fbcdde278a32 (patch)
treeede0820c06e657b0ec57253b70f5e2019a2f99a0 /src/linux/up-backend.c
parentc507b516d47b5eb8b3084efb93b71aaaa92a78c1 (diff)
linux: use the number of active DRM devices to determine the system docked status
Not ideal, but better than relying on ACPI.
Diffstat (limited to 'src/linux/up-backend.c')
-rw-r--r--src/linux/up-backend.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c
index e8fb492..c671d2d 100644
--- a/src/linux/up-backend.c
+++ b/src/linux/up-backend.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2009 Richard Hughes <richard@hughsie.com>
+ * Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
*
* Licensed under the GNU General Public License Version 2
*
@@ -39,6 +39,7 @@
#include "up-device-wup.h"
#include "up-device-hid.h"
#include "up-input.h"
+#include "up-dock.h"
#ifdef HAVE_IDEVICE
#include "up-device-idevice.h"
#endif /* HAVE_IDEVICE */
@@ -55,6 +56,7 @@ struct UpBackendPrivate
UpDeviceList *device_list;
GUdevClient *gudev_client;
UpDeviceList *managed_devices;
+ UpDock *dock;
};
enum {
@@ -298,6 +300,7 @@ up_backend_coldplug (UpBackend *backend, UpDaemon *daemon)
GList *devices;
GList *l;
guint i;
+ gboolean ret;
const gchar *subsystems[] = {"power_supply", "usb", "tty", "input", NULL};
backend->priv->daemon = g_object_ref (daemon);
@@ -318,6 +321,12 @@ up_backend_coldplug (UpBackend *backend, UpDaemon *daemon)
g_list_free (devices);
}
+ /* add dock update object */
+ backend->priv->dock = up_dock_new ();
+ ret = up_dock_coldplug (backend->priv->dock, daemon);
+ if (!ret)
+ g_warning ("failed to coldplug dock devices");
+
return TRUE;
}