X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fsn9c102%2Fsn9c102_tas5130d1b.c;fp=drivers%2Fusb%2Fmedia%2Fsn9c102_tas5130d1b.c;h=9ecb09032b683fc0c1835c4f4c95e9bc402eb98d;hb=a2f44b27303a5353859d77a3e96a1d3f33f56ab7;hp=a0728f0ae00cdd72ea5890aab6835176f9e192fb;hpb=134734d875a0a48d994ef20b9905209b4b8b6f75;p=linux-2.6.git diff --git a/drivers/usb/media/sn9c102_tas5130d1b.c b/drivers/media/video/sn9c102/sn9c102_tas5130d1b.c similarity index 89% rename from drivers/usb/media/sn9c102_tas5130d1b.c rename to drivers/media/video/sn9c102/sn9c102_tas5130d1b.c index a0728f0ae..9ecb09032 100644 --- a/drivers/usb/media/sn9c102_tas5130d1b.c +++ b/drivers/media/video/sn9c102/sn9c102_tas5130d1b.c @@ -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,13 +153,17 @@ static struct sn9c102_sensor tas5130d1b = { int sn9c102_probe_tas5130d1b(struct sn9c102_device* cam) { - /* This sensor has no identifiers, so let's attach it anyway */ - sn9c102_attach_sensor(cam, &tas5130d1b); + const struct usb_device_id tas5130d1b_id_table[] = { + { USB_DEVICE(0x0c45, 0x6025), }, + { USB_DEVICE(0x0c45, 0x60aa), }, + { } + }; /* Sensor detection is based on USB pid/vid */ - if (le16_to_cpu(tas5130d1b.usbdev->descriptor.idProduct) != 0x6025 && - le16_to_cpu(tas5130d1b.usbdev->descriptor.idProduct) != 0x60aa) + if (!sn9c102_match_id(cam, tas5130d1b_id_table)) return -ENODEV; + sn9c102_attach_sensor(cam, &tas5130d1b); + return 0; }