summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkadiusz Miśkiewicz <arekm@maven.pl>2013-03-21 20:40:26 +0100
committerRichard Hughes <richard@hughsie.com>2013-03-22 19:43:50 +0000
commitfd0286e871bcf67d29aa622b66ecf362fe2d6ec0 (patch)
tree3e418c494b1e685e79bffc016a41167d5fd1f0e4
parente571f840e9fd945c94bc1c5fa494fde9d23fa2ad (diff)
downloadupower-fd0286e871bcf67d29aa622b66ecf362fe2d6ec0.tar.gz
Repair vendor handling for Logitech Unifying devices
Set proper vendor via udev rules for unifying devices and handle that in code. Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl> Signed-off-by: Richard Hughes <richard@hughsie.com>
-rw-r--r--rules/95-upower-csr.rules1
-rw-r--r--src/linux/up-device-unifying.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/rules/95-upower-csr.rules b/rules/95-upower-csr.rules
index bd171b2..b8d92fe 100644
--- a/rules/95-upower-csr.rules
+++ b/rules/95-upower-csr.rules
@@ -22,6 +22,7 @@ LABEL="up_csr_end"
# Unifying HID++ devices
SUBSYSTEM!="hid", GOTO="up_unifying_end"
+ATTRS{idVendor}=="046d", ENV{UPOWER_VENDOR}="Logitech, Inc."
ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c52b", DRIVER=="logitech-djdevice", ENV{UPOWER_BATTERY_TYPE}="unifying"
ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c532", DRIVER=="logitech-djdevice", ENV{UPOWER_BATTERY_TYPE}="unifying"
LABEL="up_unifying_end"
diff --git a/src/linux/up-device-unifying.c b/src/linux/up-device-unifying.c
index 4b659c3..633909f 100644
--- a/src/linux/up-device-unifying.c
+++ b/src/linux/up-device-unifying.c
@@ -123,6 +123,7 @@ up_device_unifying_coldplug (UpDevice *device)
const gchar *bus_address;
const gchar *device_file;
const gchar *type;
+ const gchar *vendor;
gboolean ret = FALSE;
gchar *endptr = NULL;
gchar *tmp;
@@ -198,9 +199,13 @@ up_device_unifying_coldplug (UpDevice *device)
goto out;
}
+ vendor = g_udev_device_get_property (native, "UPOWER_VENDOR");
+ if (vendor == NULL)
+ vendor = g_udev_device_get_property (native, "ID_VENDOR");
+
/* set some default values */
g_object_set (device,
- "vendor", g_udev_device_get_property (native, "ID_VENDOR"),
+ "vendor", vendor,
"type", up_device_unifying_get_device_kind (unifying),
"model", hidpp_device_get_model (unifying->priv->hidpp_device),
"has-history", TRUE,