hal: Branch 'master' - 2 commits

Joe Marcus Clarke marcus at kemper.freedesktop.org
Fri Feb 15 13:52:40 PST 2008


 hald/freebsd/hf-usb.c |   32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

New commits:
commit 2d6b50d779bb118d1be770ac304a355de730e15b
Merge: 4a4e560... 3831b5b...
Author: Joe Marcus Clarke <marcus at FreeBSD.org>
Date:   Fri Feb 15 16:52:41 2008 -0500

    Merge branch 'master' of ssh://marcus@git.freedesktop.org/git/hal

commit 4a4e560fa1cdad8b3f7e8de27becd20544ba5522
Author: Joe Marcus Clarke <marcus at FreeBSD.org>
Date:   Fri Feb 15 16:52:29 2008 -0500

    add support for Philips webcam devices
    
    Add support for Philips USB webcam devices (driven by the pwc driver).

diff --git a/hald/freebsd/hf-usb.c b/hald/freebsd/hf-usb.c
index ceb5249..22551c6 100644
--- a/hald/freebsd/hf-usb.c
+++ b/hald/freebsd/hf-usb.c
@@ -255,6 +255,23 @@ hf_usb_device_compute_udi (HalDevice *device)
 		      : "noserial");
 }
 
+static void
+hf_usb_add_webcam_properties (HalDevice *device)
+{
+  int unit;
+
+  g_return_if_fail(HAL_IS_DEVICE(device));
+
+  unit = hal_device_property_get_int(device, "freebsd.unit");
+  if (unit < 0)
+    unit = 0;
+
+  hal_device_property_set_string(device, "info.category", "video4linux");
+  hal_device_add_capability(device, "video4linux");
+  hf_device_property_set_string_printf(device, "video4linux.device", "/dev/video%i", unit);
+  hal_device_property_set_string(device, "info.product", "Video Device");
+}
+
 /* adapted from usbif_set_name() in linux2/physdev.c */
 static const char *
 hf_usb_get_interface_name (const usb_interface_descriptor_t *desc)
@@ -427,16 +444,11 @@ hf_usb_device_new (HalDevice *parent,
        * support is added, there will be a sysctl or some other way to
        * determine device class.
        */
-      int unit;
-
-      unit = hal_device_property_get_int(device, "freebsd.unit");
-      if (unit < 0)
-        unit = 0;
-
-      hal_device_property_set_string(device, "info.category", "video4linux");
-      hal_device_add_capability(device, "video4linux");
-      hf_device_property_set_string_printf(device, "video4linux.device", "/dev/video%i", unit);
-      hal_device_property_set_string(device, "info.product", "Video Device");
+      hf_usb_add_webcam_properties(device);
+    }
+  else if ((devname = hf_usb_get_devname(di, "pwc")))	/* Phillips Web Cam */
+    {
+      hf_usb_add_webcam_properties(device);
     }
 
   hf_usb_device_compute_udi(device);


More information about the hal-commit mailing list