linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / usb / media / sn9c102_tas5130d1b.c
similarity index 89%
rename from drivers/media/video/sn9c102/sn9c102_tas5130d1b.c
rename to drivers/usb/media/sn9c102_tas5130d1b.c
index 9ecb090..a0728f0 100644 (file)
@@ -42,8 +42,8 @@ static int tas5130d1b_init(struct sn9c102_device* cam)
 }
 
 
-static int tas5130d1b_set_ctrl(struct sn9c102_device* cam,
-                              const struct v4l2_control* ctrl)
+static int tas5130d1b_set_ctrl(struct sn9c102_device* cam, 
+                               const struct v4l2_control* ctrl)
 {
        int err = 0;
 
@@ -62,8 +62,8 @@ static int tas5130d1b_set_ctrl(struct sn9c102_device* cam,
 }
 
 
-static int tas5130d1b_set_crop(struct sn9c102_device* cam,
-                              const struct v4l2_rect* rect)
+static int tas5130d1b_set_crop(struct sn9c102_device* cam, 
+                               const struct v4l2_rect* rect)
 {
        struct sn9c102_sensor* s = &tas5130d1b;
        u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 104,
@@ -82,8 +82,8 @@ static int tas5130d1b_set_crop(struct sn9c102_device* cam,
 }
 
 
-static int tas5130d1b_set_pix_format(struct sn9c102_device* cam,
-                                    const struct v4l2_pix_format* pix)
+static int tas5130d1b_set_pix_format(struct sn9c102_device* cam, 
+                                     const struct v4l2_pix_format* pix)
 {
        int err = 0;
 
@@ -153,17 +153,13 @@ static struct sn9c102_sensor tas5130d1b = {
 
 int sn9c102_probe_tas5130d1b(struct sn9c102_device* cam)
 {
-       const struct usb_device_id tas5130d1b_id_table[] = {
-               { USB_DEVICE(0x0c45, 0x6025), },
-               { USB_DEVICE(0x0c45, 0x60aa), },
-               { }
-       };
+       /* This sensor has no identifiers, so let's attach it anyway */
+       sn9c102_attach_sensor(cam, &tas5130d1b);
 
        /* Sensor detection is based on USB pid/vid */
-       if (!sn9c102_match_id(cam, tas5130d1b_id_table))
+       if (le16_to_cpu(tas5130d1b.usbdev->descriptor.idProduct) != 0x6025 &&
+           le16_to_cpu(tas5130d1b.usbdev->descriptor.idProduct) != 0x60aa)
                return -ENODEV;
 
-       sn9c102_attach_sensor(cam, &tas5130d1b);
-
        return 0;
 }