X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fsn9c102%2Fsn9c102_tas5110c1b.c;fp=drivers%2Fusb%2Fmedia%2Fsn9c102_tas5110c1b.c;h=294eb02fbd8873cc948e599164c728a80416b458;hb=a2f44b27303a5353859d77a3e96a1d3f33f56ab7;hp=32ddf236cafed990b242404473cc3dc41f82f102;hpb=134734d875a0a48d994ef20b9905209b4b8b6f75;p=linux-2.6.git diff --git a/drivers/usb/media/sn9c102_tas5110c1b.c b/drivers/media/video/sn9c102/sn9c102_tas5110c1b.c similarity index 87% rename from drivers/usb/media/sn9c102_tas5110c1b.c rename to drivers/media/video/sn9c102/sn9c102_tas5110c1b.c index 32ddf236c..294eb02fb 100644 --- a/drivers/usb/media/sn9c102_tas5110c1b.c +++ b/drivers/media/video/sn9c102/sn9c102_tas5110c1b.c @@ -44,8 +44,8 @@ static int tas5110c1b_init(struct sn9c102_device* cam) } -static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, - const struct v4l2_control* ctrl) +static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, + const struct v4l2_control* ctrl) { int err = 0; @@ -61,8 +61,8 @@ static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, } -static int tas5110c1b_set_crop(struct sn9c102_device* cam, - const struct v4l2_rect* rect) +static int tas5110c1b_set_crop(struct sn9c102_device* cam, + const struct v4l2_rect* rect) { struct sn9c102_sensor* s = &tas5110c1b; int err = 0; @@ -81,8 +81,8 @@ static int tas5110c1b_set_crop(struct sn9c102_device* cam, } -static int tas5110c1b_set_pix_format(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix) +static int tas5110c1b_set_pix_format(struct sn9c102_device* cam, + const struct v4l2_pix_format* pix) { int err = 0; @@ -142,14 +142,18 @@ static struct sn9c102_sensor tas5110c1b = { int sn9c102_probe_tas5110c1b(struct sn9c102_device* cam) { - /* This sensor has no identifiers, so let's attach it anyway */ - sn9c102_attach_sensor(cam, &tas5110c1b); + const struct usb_device_id tas5110c1b_id_table[] = { + { USB_DEVICE(0x0c45, 0x6001), }, + { USB_DEVICE(0x0c45, 0x6005), }, + { USB_DEVICE(0x0c45, 0x60ab), }, + { } + }; /* Sensor detection is based on USB pid/vid */ - if (le16_to_cpu(tas5110c1b.usbdev->descriptor.idProduct) != 0x6001 && - le16_to_cpu(tas5110c1b.usbdev->descriptor.idProduct) != 0x6005 && - le16_to_cpu(tas5110c1b.usbdev->descriptor.idProduct) != 0x60ab) + if (!sn9c102_match_id(cam, tas5110c1b_id_table)) return -ENODEV; + sn9c102_attach_sensor(cam, &tas5110c1b); + return 0; }