[colord/f16] The ColorHug has a different VID and PID for new devices.
Richard Hughes
rhughes at fedoraproject.org
Mon May 21 17:53:52 UTC 2012
commit 309abdda910719adda869570e4f107485960aa0d
Author: Richard Hughes <richard at hughsie.com>
Date: Mon May 21 18:52:33 2012 +0100
The ColorHug has a different VID and PID for new devices.
0001-The-ColorHug-has-a-new-VID-and-PID.patch | 74 +++++++++++++++++++++++++
colord.spec | 7 ++-
2 files changed, 80 insertions(+), 1 deletions(-)
---
diff --git a/0001-The-ColorHug-has-a-new-VID-and-PID.patch b/0001-The-ColorHug-has-a-new-VID-and-PID.patch
new file mode 100644
index 0000000..93671be
--- /dev/null
+++ b/0001-The-ColorHug-has-a-new-VID-and-PID.patch
@@ -0,0 +1,74 @@
+From d34d3f5d5ad8765b48f6fb9d1bf48e543c2bf900 Mon Sep 17 00:00:00 2001
+From: Richard Hughes <richard at hughsie.com>
+Date: Fri, 18 May 2012 07:36:04 +0100
+Subject: [PATCH 3/4] The ColorHug has a new VID and PID
+
+Also recognise the old vendor and product IDs, as there is no new firmware
+available yet that uses the new values.
+---
+ rules/69-cd-sensors.rules.in | 2 ++
+ src/sensors/cd-sensor-colorhug-private.h | 8 ++++++--
+ src/sensors/cd-sensor-colorhug.c | 8 +++++++-
+ 3 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/rules/69-cd-sensors.rules.in b/rules/69-cd-sensors.rules.in
+index 7188b8b..829b6c1 100644
+--- a/rules/69-cd-sensors.rules.in
++++ b/rules/69-cd-sensors.rules.in
+@@ -70,6 +70,8 @@ ATTRS{idVendor}=="0765", ATTRS{idProduct}=="5001", ENV{COLORD_SENSOR}="1", ENV{C
+
+ # ColorHug
+ ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f8da", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorhug", ENV{COLORD_SENSOR_CAP_LCD}="1"
++ATTRS{idVendor}=="273f", ATTRS{idProduct}=="1000", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorhug", ENV{COLORD_IGNORE}="1"
++ATTRS{idVendor}=="273f", ATTRS{idProduct}=="1001", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorhug", ENV{COLORD_SENSOR_CAP_LCD}="1"
+
+ # color calibration device
+ ENV{COLORD_SENSOR}=="*?", ENV{COLOR_MEASUREMENT_DEVICE}="1"
+diff --git a/src/sensors/cd-sensor-colorhug-private.h b/src/sensors/cd-sensor-colorhug-private.h
+index 418763b..fe3b35a 100644
+--- a/src/sensors/cd-sensor-colorhug-private.h
++++ b/src/sensors/cd-sensor-colorhug-private.h
+@@ -26,8 +26,8 @@
+ #include <gusb.h>
+
+ /* device constants */
+-#define CH_USB_VID 0x04d8
+-#define CH_USB_PID 0xf8da
++#define CH_USB_VID 0x273f
++#define CH_USB_PID 0x1001
+ #define CH_USB_CONFIG 0x0001
+ #define CH_USB_INTERFACE 0x0000
+ #define CH_USB_HID_EP 0x0001
+@@ -35,6 +35,10 @@
+ #define CH_USB_HID_EP_OUT (CH_USB_HID_EP | 0x00)
+ #define CH_USB_HID_EP_SIZE 64
+
++/* old device constants */
++#define CH_USB_VID_LEGACY 0x04d8
++#define CH_USB_PID_LEGACY 0xf8da
++
+ /* the default timeout in client tools */
+ #define CH_DEVICE_USB_TIMEOUT 5000 /* ms */
+
+diff --git a/src/sensors/cd-sensor-colorhug.c b/src/sensors/cd-sensor-colorhug.c
+index 4b1e5ca..1ae7d35 100644
+--- a/src/sensors/cd-sensor-colorhug.c
++++ b/src/sensors/cd-sensor-colorhug.c
+@@ -474,7 +474,13 @@ cd_sensor_lock_async (CdSensor *sensor,
+ priv->device = g_usb_device_list_find_by_vid_pid (priv->device_list,
+ CH_USB_VID,
+ CH_USB_PID,
+- &error);
++ NULL);
++ if (priv->device == NULL) {
++ priv->device = g_usb_device_list_find_by_vid_pid (priv->device_list,
++ CH_USB_VID_LEGACY,
++ CH_USB_PID_LEGACY,
++ &error);
++ }
+ if (priv->device == NULL) {
+ g_simple_async_report_gerror_in_idle (G_OBJECT (sensor),
+ callback,
+--
+1.7.10.2
+
diff --git a/colord.spec b/colord.spec
index 047a8b2..641a0ef 100644
--- a/colord.spec
+++ b/colord.spec
@@ -1,11 +1,12 @@
Summary: Color daemon
Name: colord
Version: 0.1.18
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2+ and LGPLv2+
URL: http://www.freedesktop.org/software/colord/
Source0: http://www.freedesktop.org/software/colord/releases/%{name}-%{version}.tar.xz
Patch0: 0001-Do-not-enable-PrivateNetwork-yes-as-it-breaks-hotplu.patch
+Patch1: 0001-The-ColorHug-has-a-new-VID-and-PID.patch
BuildRequires: dbus-devel
BuildRequires: docbook-utils
@@ -41,6 +42,7 @@ Files for development with %{name}.
%prep
%setup -q
%patch0 -p1 -b .fix-device-hotplug
+%patch1 -p1 -b .colorhug-new-vid-pid
%build
%configure \
@@ -113,6 +115,9 @@ exit 0
%{_datadir}/vala/vapi/*.vapi
%changelog
+* Mon May 21 2012 Richard Hughes <richard at hughsie.com> 0.1.18-3
+- The ColorHug has a different VID and PID for new devices.
+
* Thu Mar 29 2012 Richard Hughes <richard at hughsie.com> 0.1.18-2
- Disable PrivateNetwork=1 as it breaks sensor hotplug.
More information about the scm-commits
mailing list