diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-07-26 13:17:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-27 10:06:44 -0400 |
commit | 5da162e7e2246851b6d5899688bba5b25a7fea3e (patch) | |
tree | 54e63b14613511bd77a829d8a84c6665785470a6 /drivers/media | |
parent | 1250ac6d4ab716dafe0ac245fd31cd3a7cbc0a98 (diff) |
V4L/DVB (8519): gspca: Set the specific per webcam information in driver_info for sonixb.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/sonixb.c | 134 |
1 files changed, 57 insertions, 77 deletions
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c index 93d365456591..3db49a854fe2 100644 --- a/drivers/media/video/gspca/sonixb.c +++ b/drivers/media/video/gspca/sonixb.c | |||
@@ -58,6 +58,12 @@ struct sd { | |||
58 | __u8 reg11; | 58 | __u8 reg11; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | /* flags used in the device id table */ | ||
62 | #define F_GAIN 0x01 /* has gain */ | ||
63 | #define F_AUTO 0x02 /* has autogain */ | ||
64 | #define F_SIF 0x04 /* sif or vga */ | ||
65 | #define F_H18 0x08 /* long (18 b) or short (12 b) frame header */ | ||
66 | |||
61 | #define COMP2 0x8f | 67 | #define COMP2 0x8f |
62 | #define COMP 0xc7 /* 0x87 //0x07 */ | 68 | #define COMP 0xc7 /* 0x87 //0x07 */ |
63 | #define COMP1 0xc9 /* 0x89 //0x09 */ | 69 | #define COMP1 0xc9 /* 0x89 //0x09 */ |
@@ -751,74 +757,28 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
751 | { | 757 | { |
752 | struct sd *sd = (struct sd *) gspca_dev; | 758 | struct sd *sd = (struct sd *) gspca_dev; |
753 | struct cam *cam; | 759 | struct cam *cam; |
754 | __u16 product; | ||
755 | int sif = 0; | 760 | int sif = 0; |
756 | 761 | ||
757 | /* nctrls depends upon the sensor, so we use a per cam copy */ | 762 | /* nctrls depends upon the sensor, so we use a per cam copy */ |
758 | memcpy(&sd->sd_desc, gspca_dev->sd_desc, sizeof(struct sd_desc)); | 763 | memcpy(&sd->sd_desc, gspca_dev->sd_desc, sizeof(struct sd_desc)); |
759 | gspca_dev->sd_desc = &sd->sd_desc; | 764 | gspca_dev->sd_desc = &sd->sd_desc; |
760 | 765 | ||
761 | sd->fr_h_sz = 12; /* default size of the frame header */ | 766 | /* copy the webcam info from the device id */ |
762 | sd->sd_desc.nctrls = 2; /* default nb of ctrls */ | 767 | sd->sensor = (id->driver_info >> 24) & 0xff; |
763 | product = id->idProduct; | 768 | if (id->driver_info & (F_GAIN << 16)) |
764 | /* switch (id->idVendor) { */ | 769 | sd->sensor_has_gain = 1; |
765 | /* case 0x0c45: * Sonix */ | 770 | if (id->driver_info & (F_AUTO << 16)) |
766 | switch (product) { | 771 | sd->sd_desc.dq_callback = do_autogain; |
767 | case 0x6001: /* SN9C102 */ | 772 | if (id->driver_info & (F_SIF << 16)) |
768 | case 0x6005: /* SN9C101 */ | 773 | sif = 1; |
769 | case 0x6007: /* SN9C101 */ | 774 | if (id->driver_info & (F_H18 << 16)) |
770 | sd->sensor = SENSOR_TAS5110; | 775 | sd->fr_h_sz = 18; /* size of frame header */ |
771 | sd->sensor_has_gain = 1; | 776 | else |
772 | sd->sd_desc.nctrls = 4; | 777 | sd->fr_h_sz = 12; |
773 | sd->sd_desc.dq_callback = do_autogain; | 778 | sd->sd_desc.nctrls = (id->driver_info >> 8) & 0xff; |
774 | sif = 1; | 779 | sd->sensor_addr = id->driver_info & 0xff; |
775 | break; | ||
776 | case 0x6009: /* SN9C101 */ | ||
777 | case 0x600d: /* SN9C101 */ | ||
778 | case 0x6029: /* SN9C101 */ | ||
779 | sd->sensor = SENSOR_PAS106; | ||
780 | sif = 1; | ||
781 | break; | ||
782 | case 0x6011: /* SN9C101 - SN9C101G */ | ||
783 | sd->sensor = SENSOR_OV6650; | ||
784 | sd->sensor_has_gain = 1; | ||
785 | sd->sensor_addr = 0x60; | ||
786 | sd->sd_desc.nctrls = 5; | ||
787 | sd->sd_desc.dq_callback = do_autogain; | ||
788 | sif = 1; | ||
789 | break; | ||
790 | case 0x6019: /* SN9C101 */ | ||
791 | case 0x602c: /* SN9C102 */ | ||
792 | case 0x602e: /* SN9C102 */ | ||
793 | case 0x60b0: /* SN9C103 */ | ||
794 | sd->sensor = SENSOR_OV7630; | ||
795 | sd->sensor_addr = 0x21; | ||
796 | sd->sensor_has_gain = 1; | ||
797 | sd->sd_desc.nctrls = 5; | ||
798 | sd->sd_desc.dq_callback = do_autogain; | ||
799 | if (product == 0x60b0) | ||
800 | sd->fr_h_sz = 18; /* size of frame header */ | ||
801 | break; | ||
802 | case 0x6024: /* SN9C102 */ | ||
803 | case 0x6025: /* SN9C102 */ | ||
804 | sd->sensor = SENSOR_TAS5130CXX; | ||
805 | break; | ||
806 | case 0x6028: /* SN9C102 */ | ||
807 | sd->sensor = SENSOR_PAS202; | ||
808 | break; | ||
809 | case 0x602d: /* SN9C102 */ | ||
810 | sd->sensor = SENSOR_HV7131R; | ||
811 | break; | ||
812 | case 0x60af: /* SN9C103 */ | ||
813 | sd->sensor = SENSOR_PAS202; | ||
814 | sd->fr_h_sz = 18; /* size of frame header (?) */ | ||
815 | break; | ||
816 | } | ||
817 | /* break; */ | ||
818 | /* } */ | ||
819 | 780 | ||
820 | cam = &gspca_dev->cam; | 781 | cam = &gspca_dev->cam; |
821 | cam->dev_name = (char *) id->driver_info; | ||
822 | cam->epaddr = 0x01; | 782 | cam->epaddr = 0x01; |
823 | if (!sif) { | 783 | if (!sif) { |
824 | cam->cam_mode = vga_mode; | 784 | cam->cam_mode = vga_mode; |
@@ -1212,27 +1172,47 @@ static const struct sd_desc sd_desc = { | |||
1212 | }; | 1172 | }; |
1213 | 1173 | ||
1214 | /* -- module initialisation -- */ | 1174 | /* -- module initialisation -- */ |
1215 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 1175 | #define SFCI(sensor, flags, nctrls, i2c_addr) \ |
1176 | .driver_info = (SENSOR_ ## sensor << 24) \ | ||
1177 | | ((flags) << 16) \ | ||
1178 | | ((nctrls) << 8) \ | ||
1179 | | (i2c_addr) | ||
1216 | static __devinitdata struct usb_device_id device_table[] = { | 1180 | static __devinitdata struct usb_device_id device_table[] = { |
1217 | #ifndef CONFIG_USB_SN9C102 | 1181 | #ifndef CONFIG_USB_SN9C102 |
1218 | {USB_DEVICE(0x0c45, 0x6001), DVNM("Genius VideoCAM NB")}, | 1182 | {USB_DEVICE(0x0c45, 0x6001), /* SN9C102 */ |
1219 | {USB_DEVICE(0x0c45, 0x6005), DVNM("Sweex Tas5110")}, | 1183 | SFCI(TAS5110, F_GAIN|F_AUTO|F_SIF, 4, 0)}, |
1220 | {USB_DEVICE(0x0c45, 0x6007), DVNM("Sonix sn9c101 + Tas5110D")}, | 1184 | {USB_DEVICE(0x0c45, 0x6005), /* SN9C101 */ |
1221 | {USB_DEVICE(0x0c45, 0x6009), DVNM("spcaCam@120")}, | 1185 | SFCI(TAS5110, F_GAIN|F_AUTO|F_SIF, 4, 0)}, |
1222 | {USB_DEVICE(0x0c45, 0x600d), DVNM("spcaCam@120")}, | 1186 | {USB_DEVICE(0x0c45, 0x6007), /* SN9C101 */ |
1187 | SFCI(TAS5110, F_GAIN|F_AUTO|F_SIF, 4, 0)}, | ||
1188 | {USB_DEVICE(0x0c45, 0x6009), /* SN9C101 */ | ||
1189 | SFCI(PAS106, F_SIF, 2, 0)}, | ||
1190 | {USB_DEVICE(0x0c45, 0x600d), /* SN9C101 */ | ||
1191 | SFCI(PAS106, F_SIF, 2, 0)}, | ||
1223 | #endif | 1192 | #endif |
1224 | {USB_DEVICE(0x0c45, 0x6011), DVNM("MAX Webcam Microdia")}, | 1193 | {USB_DEVICE(0x0c45, 0x6011), /* SN9C101 - SN9C101G */ |
1194 | SFCI(OV6650, F_GAIN|F_AUTO|F_SIF, 5, 0x60)}, | ||
1225 | #ifndef CONFIG_USB_SN9C102 | 1195 | #ifndef CONFIG_USB_SN9C102 |
1226 | {USB_DEVICE(0x0c45, 0x6019), DVNM("Generic Sonix OV7630")}, | 1196 | {USB_DEVICE(0x0c45, 0x6019), /* SN9C101 */ |
1227 | {USB_DEVICE(0x0c45, 0x6024), DVNM("Generic Sonix Tas5130c")}, | 1197 | SFCI(OV7630, F_GAIN|F_AUTO|F_SIF, 5, 0x21)}, |
1228 | {USB_DEVICE(0x0c45, 0x6025), DVNM("Xcam Shanga")}, | 1198 | {USB_DEVICE(0x0c45, 0x6024), /* SN9C102 */ |
1229 | {USB_DEVICE(0x0c45, 0x6028), DVNM("Sonix Btc Pc380")}, | 1199 | SFCI(TAS5130CXX, 0, 2, 0)}, |
1230 | {USB_DEVICE(0x0c45, 0x6029), DVNM("spcaCam@150")}, | 1200 | {USB_DEVICE(0x0c45, 0x6025), /* SN9C102 */ |
1231 | {USB_DEVICE(0x0c45, 0x602c), DVNM("Generic Sonix OV7630")}, | 1201 | SFCI(TAS5130CXX, 0, 2, 0)}, |
1232 | {USB_DEVICE(0x0c45, 0x602d), DVNM("LIC-200 LG")}, | 1202 | {USB_DEVICE(0x0c45, 0x6028), /* SN9C102 */ |
1233 | {USB_DEVICE(0x0c45, 0x602e), DVNM("Genius VideoCam Messenger")}, | 1203 | SFCI(PAS202, 0, 2, 0)}, |
1234 | {USB_DEVICE(0x0c45, 0x60af), DVNM("Trust WB3100P")}, | 1204 | {USB_DEVICE(0x0c45, 0x6029), /* SN9C101 */ |
1235 | {USB_DEVICE(0x0c45, 0x60b0), DVNM("Genius VideoCam Look")}, | 1205 | SFCI(PAS106, F_SIF, 2, 0)}, |
1206 | {USB_DEVICE(0x0c45, 0x602c), /* SN9C102 */ | ||
1207 | SFCI(OV7630, F_GAIN|F_AUTO|F_SIF, 5, 0x21)}, | ||
1208 | {USB_DEVICE(0x0c45, 0x602d), /* SN9C102 */ | ||
1209 | SFCI(HV7131R, 0, 2, 0)}, | ||
1210 | {USB_DEVICE(0x0c45, 0x602e), /* SN9C102 */ | ||
1211 | SFCI(OV7630, F_GAIN|F_AUTO|F_SIF, 5, 0x21)}, | ||
1212 | {USB_DEVICE(0x0c45, 0x60af), /* SN9C103 */ | ||
1213 | SFCI(PAS202, F_H18, 2, 0)}, | ||
1214 | {USB_DEVICE(0x0c45, 0x60b0), /* SN9C103 */ | ||
1215 | SFCI(OV7630, F_GAIN|F_AUTO|F_SIF|F_H18, 5, 0x21)}, | ||
1236 | #endif | 1216 | #endif |
1237 | {} | 1217 | {} |
1238 | }; | 1218 | }; |