diff options
Diffstat (limited to 'drivers/media/video/gspca/sonixj.c')
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 243 |
1 files changed, 45 insertions, 198 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 3f8418c7e5f..46f2cf66d48 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -795,191 +795,16 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
795 | { | 795 | { |
796 | struct sd *sd = (struct sd *) gspca_dev; | 796 | struct sd *sd = (struct sd *) gspca_dev; |
797 | struct cam *cam; | 797 | struct cam *cam; |
798 | __u16 product; | ||
799 | |||
800 | product = id->idProduct; | ||
801 | sd->sensor = -1; | ||
802 | switch (id->idVendor) { | ||
803 | case 0x0458: /* Genius */ | ||
804 | /* switch (product) { | ||
805 | case 0x7025: */ | ||
806 | sd->bridge = BRIDGE_SN9C120; | ||
807 | sd->sensor = SENSOR_MI0360; | ||
808 | sd->i2c_base = 0x5d; | ||
809 | /* break; | ||
810 | } */ | ||
811 | break; | ||
812 | case 0x045e: | ||
813 | /* switch (product) { | ||
814 | case 0x00f5: | ||
815 | case 0x00f7: */ | ||
816 | sd->bridge = BRIDGE_SN9C105; | ||
817 | sd->sensor = SENSOR_OV7660; | ||
818 | sd->i2c_base = 0x21; | ||
819 | /* break; | ||
820 | } */ | ||
821 | break; | ||
822 | case 0x0471: /* Philips */ | ||
823 | /* switch (product) { | ||
824 | case 0x0327: | ||
825 | case 0x0328: | ||
826 | case 0x0330: */ | ||
827 | sd->bridge = BRIDGE_SN9C105; | ||
828 | sd->sensor = SENSOR_MI0360; | ||
829 | sd->i2c_base = 0x5d; | ||
830 | /* break; | ||
831 | } */ | ||
832 | break; | ||
833 | case 0x0c45: /* Sonix */ | ||
834 | switch (product) { | ||
835 | case 0x6040: | ||
836 | sd->bridge = BRIDGE_SN9C102P; | ||
837 | /* sd->sensor = SENSOR_MI0360; * from BW600.inf */ | ||
838 | /*fixme: MI0360 base=5d ? */ | ||
839 | sd->sensor = SENSOR_HV7131R; /* gspcav1 value */ | ||
840 | sd->i2c_base = 0x11; | ||
841 | break; | ||
842 | /* case 0x607a: * from BW600.inf | ||
843 | sd->bridge = BRIDGE_SN9C102P; | ||
844 | sd->sensor = SENSOR_OV7648; | ||
845 | sd->i2c_base = 0x??; | ||
846 | break; */ | ||
847 | case 0x607c: | ||
848 | sd->bridge = BRIDGE_SN9C102P; | ||
849 | sd->sensor = SENSOR_HV7131R; | ||
850 | sd->i2c_base = 0x11; | ||
851 | break; | ||
852 | /* case 0x607e: * from BW600.inf | ||
853 | sd->bridge = BRIDGE_SN9C102P; | ||
854 | sd->sensor = SENSOR_OV7630; | ||
855 | sd->i2c_base = 0x??; | ||
856 | break; */ | ||
857 | case 0x60c0: | ||
858 | sd->bridge = BRIDGE_SN9C105; | ||
859 | sd->sensor = SENSOR_MI0360; | ||
860 | sd->i2c_base = 0x5d; | ||
861 | break; | ||
862 | /* case 0x60c8: * from BW600.inf | ||
863 | sd->bridge = BRIDGE_SN9C105; | ||
864 | sd->sensor = SENSOR_OM6801; | ||
865 | sd->i2c_base = 0x??; | ||
866 | break; */ | ||
867 | /* case 0x60cc: * from BW600.inf | ||
868 | sd->bridge = BRIDGE_SN9C105; | ||
869 | sd->sensor = SENSOR_HV7131GP; | ||
870 | sd->i2c_base = 0x??; | ||
871 | break; */ | ||
872 | case 0x60ec: | ||
873 | sd->bridge = BRIDGE_SN9C105; | ||
874 | sd->sensor = SENSOR_MO4000; | ||
875 | sd->i2c_base = 0x21; | ||
876 | break; | ||
877 | /* case 0x60ef: * from BW600.inf | ||
878 | sd->bridge = BRIDGE_SN9C105; | ||
879 | sd->sensor = SENSOR_ICM105C; | ||
880 | sd->i2c_base = 0x??; | ||
881 | break; */ | ||
882 | /* case 0x60fa: * from BW600.inf | ||
883 | sd->bridge = BRIDGE_SN9C105; | ||
884 | sd->sensor = SENSOR_OV7648; | ||
885 | sd->i2c_base = 0x??; | ||
886 | break; */ | ||
887 | case 0x60fb: | ||
888 | sd->bridge = BRIDGE_SN9C105; | ||
889 | sd->sensor = SENSOR_OV7660; | ||
890 | sd->i2c_base = 0x21; | ||
891 | break; | ||
892 | case 0x60fc: | ||
893 | sd->bridge = BRIDGE_SN9C105; | ||
894 | sd->sensor = SENSOR_HV7131R; | ||
895 | sd->i2c_base = 0x11; | ||
896 | break; | ||
897 | /* case 0x60fe: * from BW600.inf | ||
898 | sd->bridge = BRIDGE_SN9C105; | ||
899 | sd->sensor = SENSOR_OV7630; | ||
900 | sd->i2c_base = 0x??; | ||
901 | break; */ | ||
902 | /* case 0x6108: * from BW600.inf | ||
903 | sd->bridge = BRIDGE_SN9C120; | ||
904 | sd->sensor = SENSOR_OM6801; | ||
905 | sd->i2c_base = 0x??; | ||
906 | break; */ | ||
907 | /* case 0x6122: * from BW600.inf | ||
908 | sd->bridge = BRIDGE_SN9C110; | ||
909 | sd->sensor = SENSOR_ICM105C; | ||
910 | sd->i2c_base = 0x??; | ||
911 | break; */ | ||
912 | case 0x612a: | ||
913 | /* sd->bridge = BRIDGE_SN9C110; * in BW600.inf */ | ||
914 | sd->bridge = BRIDGE_SN9C325; | ||
915 | sd->sensor = SENSOR_OV7648; | ||
916 | sd->i2c_base = 0x21; | ||
917 | /*fixme: sensor_init has base = 00 et 6e!*/ | ||
918 | break; | ||
919 | /* case 0x6123: * from BW600.inf | ||
920 | sd->bridge = BRIDGE_SN9C110; | ||
921 | sd->sensor = SENSOR_SanyoCCD; | ||
922 | sd->i2c_base = 0x??; | ||
923 | break; */ | ||
924 | case 0x612c: | ||
925 | sd->bridge = BRIDGE_SN9C110; | ||
926 | sd->sensor = SENSOR_MO4000; | ||
927 | sd->i2c_base = 0x21; | ||
928 | break; | ||
929 | /* case 0x612e: * from BW600.inf | ||
930 | sd->bridge = BRIDGE_SN9C110; | ||
931 | sd->sensor = SENSOR_OV7630; | ||
932 | sd->i2c_base = 0x??; | ||
933 | break; */ | ||
934 | /* case 0x612f: * from BW600.inf | ||
935 | sd->bridge = BRIDGE_SN9C110; | ||
936 | sd->sensor = SENSOR_ICM105C; | ||
937 | sd->i2c_base = 0x??; | ||
938 | break; */ | ||
939 | case 0x6130: | ||
940 | sd->bridge = BRIDGE_SN9C120; | ||
941 | sd->sensor = SENSOR_MI0360; | ||
942 | sd->i2c_base = 0x5d; | ||
943 | break; | ||
944 | case 0x6138: | ||
945 | sd->bridge = BRIDGE_SN9C120; | ||
946 | sd->sensor = SENSOR_MO4000; | ||
947 | sd->i2c_base = 0x21; | ||
948 | break; | ||
949 | /* case 0x613a: * from BW600.inf | ||
950 | sd->bridge = BRIDGE_SN9C120; | ||
951 | sd->sensor = SENSOR_OV7648; | ||
952 | sd->i2c_base = 0x??; | ||
953 | break; */ | ||
954 | case 0x613b: | ||
955 | sd->bridge = BRIDGE_SN9C120; | ||
956 | sd->sensor = SENSOR_OV7660; | ||
957 | sd->i2c_base = 0x21; | ||
958 | break; | ||
959 | case 0x613c: | ||
960 | sd->bridge = BRIDGE_SN9C120; | ||
961 | sd->sensor = SENSOR_HV7131R; | ||
962 | sd->i2c_base = 0x11; | ||
963 | break; | ||
964 | /* case 0x613e: * from BW600.inf | ||
965 | sd->bridge = BRIDGE_SN9C120; | ||
966 | sd->sensor = SENSOR_OV7630; | ||
967 | sd->i2c_base = 0x??; | ||
968 | break; */ | ||
969 | } | ||
970 | break; | ||
971 | } | ||
972 | if (sd->sensor < 0) { | ||
973 | PDEBUG(D_ERR, "Invalid vendor/product %04x:%04x", | ||
974 | id->idVendor, product); | ||
975 | return -EINVAL; | ||
976 | } | ||
977 | 798 | ||
978 | cam = &gspca_dev->cam; | 799 | cam = &gspca_dev->cam; |
979 | cam->epaddr = 0x01; | 800 | cam->epaddr = 0x01; |
980 | cam->cam_mode = vga_mode; | 801 | cam->cam_mode = vga_mode; |
981 | cam->nmodes = ARRAY_SIZE(vga_mode); | 802 | cam->nmodes = ARRAY_SIZE(vga_mode); |
982 | 803 | ||
804 | sd->bridge = id->driver_info >> 16; | ||
805 | sd->sensor = id->driver_info >> 8; | ||
806 | sd->i2c_base = id->driver_info; | ||
807 | |||
983 | sd->qindex = 4; /* set the quantization table */ | 808 | sd->qindex = 4; /* set the quantization table */ |
984 | sd->brightness = BRIGHTNESS_DEF; | 809 | sd->brightness = BRIGHTNESS_DEF; |
985 | sd->contrast = CONTRAST_DEF; | 810 | sd->contrast = CONTRAST_DEF; |
@@ -1596,29 +1421,51 @@ static const struct sd_desc sd_desc = { | |||
1596 | }; | 1421 | }; |
1597 | 1422 | ||
1598 | /* -- module initialisation -- */ | 1423 | /* -- module initialisation -- */ |
1599 | #define DVNM(name) .driver_info = (kernel_ulong_t) name | 1424 | #define BSI(bridge, sensor, i2c_addr) \ |
1425 | .driver_info = (BRIDGE_ ## bridge << 16) \ | ||
1426 | | (SENSOR_ ## sensor << 8) \ | ||
1427 | | (i2c_addr) | ||
1600 | static const __devinitdata struct usb_device_id device_table[] = { | 1428 | static const __devinitdata struct usb_device_id device_table[] = { |
1601 | #ifndef CONFIG_USB_SN9C102 | 1429 | #ifndef CONFIG_USB_SN9C102 |
1602 | {USB_DEVICE(0x0458, 0x7025), DVNM("Genius Eye 311Q")}, | 1430 | {USB_DEVICE(0x0458, 0x7025), BSI(SN9C120, MI0360, 0x5d)}, |
1603 | {USB_DEVICE(0x045e, 0x00f5), DVNM("MicroSoft VX3000")}, | 1431 | {USB_DEVICE(0x045e, 0x00f5), BSI(SN9C105, OV7660, 0x21)}, |
1604 | {USB_DEVICE(0x045e, 0x00f7), DVNM("MicroSoft VX1000")}, | 1432 | {USB_DEVICE(0x045e, 0x00f7), BSI(SN9C105, OV7660, 0x21)}, |
1605 | {USB_DEVICE(0x0471, 0x0327), DVNM("Philips SPC 600 NC")}, | 1433 | {USB_DEVICE(0x0471, 0x0327), BSI(SN9C105, MI0360, 0x5d)}, |
1606 | {USB_DEVICE(0x0471, 0x0328), DVNM("Philips SPC 700 NC")}, | 1434 | {USB_DEVICE(0x0471, 0x0328), BSI(SN9C105, MI0360, 0x5d)}, |
1607 | #endif | 1435 | #endif |
1608 | {USB_DEVICE(0x0471, 0x0330), DVNM("Philips SPC 710NC")}, | 1436 | {USB_DEVICE(0x0471, 0x0330), BSI(SN9C105, MI0360, 0x5d)}, |
1609 | {USB_DEVICE(0x0c45, 0x6040), DVNM("Speed NVC 350K")}, | 1437 | {USB_DEVICE(0x0c45, 0x6040), BSI(SN9C102P, HV7131R, 0x11)}, |
1610 | {USB_DEVICE(0x0c45, 0x607c), DVNM("Sonix sn9c102p Hv7131R")}, | 1438 | /* bw600.inf: |
1611 | {USB_DEVICE(0x0c45, 0x60c0), DVNM("Sangha Sn535")}, | 1439 | {USB_DEVICE(0x0c45, 0x6040), BSI(SN9C102P, MI0360, 0x5d)}, */ |
1612 | {USB_DEVICE(0x0c45, 0x60ec), DVNM("SN9C105+MO4000")}, | 1440 | /* {USB_DEVICE(0x0c45, 0x603a), BSI(SN9C102P, OV7648, 0x??)}, */ |
1613 | {USB_DEVICE(0x0c45, 0x60fb), DVNM("Surfer NoName")}, | 1441 | /* {USB_DEVICE(0x0c45, 0x607a), BSI(SN9C102P, OV7648, 0x??)}, */ |
1614 | {USB_DEVICE(0x0c45, 0x60fc), DVNM("LG-LIC300")}, | 1442 | {USB_DEVICE(0x0c45, 0x607c), BSI(SN9C102P, HV7131R, 0x11)}, |
1615 | {USB_DEVICE(0x0c45, 0x612a), DVNM("Avant Camera")}, | 1443 | /* {USB_DEVICE(0x0c45, 0x607e), BSI(SN9C102P, OV7630, 0x??)}, */ |
1616 | {USB_DEVICE(0x0c45, 0x612c), DVNM("Typhoon Rasy Cam 1.3MPix")}, | 1444 | {USB_DEVICE(0x0c45, 0x60c0), BSI(SN9C105, MI0360, 0x5d)}, |
1445 | /* {USB_DEVICE(0x0c45, 0x60c8), BSI(SN9C105, OM6801, 0x??)}, */ | ||
1446 | /* {USB_DEVICE(0x0c45, 0x60cc), BSI(SN9C105, HV7131GP, 0x??)}, */ | ||
1447 | {USB_DEVICE(0x0c45, 0x60ec), BSI(SN9C105, MO4000, 0x21)}, | ||
1448 | /* {USB_DEVICE(0x0c45, 0x60ef), BSI(SN9C105, ICM105C, 0x??)}, */ | ||
1449 | /* {USB_DEVICE(0x0c45, 0x60fa), BSI(SN9C105, OV7648, 0x??)}, */ | ||
1450 | {USB_DEVICE(0x0c45, 0x60fb), BSI(SN9C105, OV7660, 0x21)}, | ||
1451 | {USB_DEVICE(0x0c45, 0x60fc), BSI(SN9C105, HV7131R, 0x11)}, | ||
1452 | /* {USB_DEVICE(0x0c45, 0x60fe), BSI(SN9C105, OV7630, 0x??)}, */ | ||
1453 | /* {USB_DEVICE(0x0c45, 0x6108), BSI(SN9C120, OM6801, 0x??)}, */ | ||
1454 | /* {USB_DEVICE(0x0c45, 0x6122), BSI(SN9C110, ICM105C, 0x??)}, */ | ||
1455 | /* {USB_DEVICE(0x0c45, 0x6123), BSI(SN9C110, SanyoCCD, 0x??)}, */ | ||
1456 | {USB_DEVICE(0x0c45, 0x612a), BSI(SN9C325, OV7648, 0x21)}, | ||
1457 | /* bw600.inf: | ||
1458 | {USB_DEVICE(0x0c45, 0x612a), BSI(SN9C110, OV7648, 0x21)}, */ | ||
1459 | {USB_DEVICE(0x0c45, 0x612c), BSI(SN9C110, MO4000, 0x21)}, | ||
1460 | /* {USB_DEVICE(0x0c45, 0x612e), BSI(SN9C110, OV7630, 0x??)}, */ | ||
1461 | /* {USB_DEVICE(0x0c45, 0x612f), BSI(SN9C110, ICM105C, 0x??)}, */ | ||
1617 | #ifndef CONFIG_USB_SN9C102 | 1462 | #ifndef CONFIG_USB_SN9C102 |
1618 | {USB_DEVICE(0x0c45, 0x6130), DVNM("Sonix Pccam")}, | 1463 | {USB_DEVICE(0x0c45, 0x6130), BSI(SN9C120, MI0360, 0x5d)}, |
1619 | {USB_DEVICE(0x0c45, 0x6138), DVNM("Sn9c120 Mo4000")}, | 1464 | {USB_DEVICE(0x0c45, 0x6138), BSI(SN9C120, MO4000, 0x21)}, |
1620 | {USB_DEVICE(0x0c45, 0x613b), DVNM("Surfer SN-206")}, | 1465 | /* {USB_DEVICE(0x0c45, 0x613a), BSI(SN9C120, OV7648, 0x??)}, */ |
1621 | {USB_DEVICE(0x0c45, 0x613c), DVNM("Sonix Pccam168")}, | 1466 | {USB_DEVICE(0x0c45, 0x613b), BSI(SN9C120, OV7660, 0x21)}, |
1467 | {USB_DEVICE(0x0c45, 0x613c), BSI(SN9C120, HV7131R, 0x11)}, | ||
1468 | /* {USB_DEVICE(0x0c45, 0x613e), BSI(SN9C120, OV7630, 0x??)}, */ | ||
1622 | #endif | 1469 | #endif |
1623 | {} | 1470 | {} |
1624 | }; | 1471 | }; |