diff options
Diffstat (limited to 'drivers/media/video/gspca/sonixj.c')
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 492 |
1 files changed, 163 insertions, 329 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 3e68b9926956..33a3df1f6915 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -24,9 +24,6 @@ | |||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | #include "jpeg.h" | 25 | #include "jpeg.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) | ||
28 | static const char version[] = "2.1.7"; | ||
29 | |||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 27 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
31 | MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver"); | 28 | MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver"); |
32 | MODULE_LICENSE("GPL"); | 29 | MODULE_LICENSE("GPL"); |
@@ -361,6 +358,7 @@ static const __u8 mo4000_sensor_init[][8] = { | |||
361 | }; | 358 | }; |
362 | static const __u8 ov7660_sensor_init[][8] = { | 359 | static const __u8 ov7660_sensor_init[][8] = { |
363 | {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset SCCB */ | 360 | {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset SCCB */ |
361 | /* (delay 20ms) */ | ||
364 | {0xa1, 0x21, 0x12, 0x05, 0x00, 0x00, 0x00, 0x10}, | 362 | {0xa1, 0x21, 0x12, 0x05, 0x00, 0x00, 0x00, 0x10}, |
365 | /* Outformat ?? rawRGB */ | 363 | /* Outformat ?? rawRGB */ |
366 | {0xa1, 0x21, 0x13, 0xb8, 0x00, 0x00, 0x00, 0x10}, /* init COM8 */ | 364 | {0xa1, 0x21, 0x13, 0xb8, 0x00, 0x00, 0x00, 0x10}, /* init COM8 */ |
@@ -539,13 +537,31 @@ static void reg_r(struct gspca_dev *gspca_dev, | |||
539 | value, 0, | 537 | value, 0, |
540 | gspca_dev->usb_buf, len, | 538 | gspca_dev->usb_buf, len, |
541 | 500); | 539 | 500); |
540 | PDEBUG(D_USBI, "reg_r [%02x] -> %02x", value, gspca_dev->usb_buf[0]); | ||
542 | } | 541 | } |
543 | 542 | ||
543 | static void reg_w1(struct gspca_dev *gspca_dev, | ||
544 | __u16 value, | ||
545 | __u8 data) | ||
546 | { | ||
547 | PDEBUG(D_USBO, "reg_w1 [%02x] = %02x", value, data); | ||
548 | gspca_dev->usb_buf[0] = data; | ||
549 | usb_control_msg(gspca_dev->dev, | ||
550 | usb_sndctrlpipe(gspca_dev->dev, 0), | ||
551 | 0x08, | ||
552 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
553 | value, | ||
554 | 0, | ||
555 | gspca_dev->usb_buf, 1, | ||
556 | 500); | ||
557 | } | ||
544 | static void reg_w(struct gspca_dev *gspca_dev, | 558 | static void reg_w(struct gspca_dev *gspca_dev, |
545 | __u16 value, | 559 | __u16 value, |
546 | const __u8 *buffer, | 560 | const __u8 *buffer, |
547 | int len) | 561 | int len) |
548 | { | 562 | { |
563 | PDEBUG(D_USBO, "reg_w [%02x] = %02x %02x ..", | ||
564 | value, buffer[0], buffer[1]); | ||
549 | if (len <= sizeof gspca_dev->usb_buf) { | 565 | if (len <= sizeof gspca_dev->usb_buf) { |
550 | memcpy(gspca_dev->usb_buf, buffer, len); | 566 | memcpy(gspca_dev->usb_buf, buffer, len); |
551 | usb_control_msg(gspca_dev->dev, | 567 | usb_control_msg(gspca_dev->dev, |
@@ -571,31 +587,42 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
571 | } | 587 | } |
572 | } | 588 | } |
573 | 589 | ||
574 | /* I2C write 2 bytes */ | 590 | /* I2C write 1 byte */ |
575 | static void i2c_w2(struct gspca_dev *gspca_dev, | 591 | static void i2c_w1(struct gspca_dev *gspca_dev, __u8 reg, __u8 val) |
576 | const __u8 *buffer) | ||
577 | { | 592 | { |
578 | struct sd *sd = (struct sd *) gspca_dev; | 593 | struct sd *sd = (struct sd *) gspca_dev; |
579 | __u8 mode[8]; | ||
580 | 594 | ||
581 | /* is i2c ready */ | 595 | PDEBUG(D_USBO, "i2c_w2 [%02x] = %02x", reg, val); |
582 | mode[0] = 0x81 | (2 << 4); | 596 | gspca_dev->usb_buf[0] = 0x81 | (2 << 4); /* = a1 */ |
583 | mode[1] = sd->i2c_base; | 597 | gspca_dev->usb_buf[1] = sd->i2c_base; |
584 | mode[2] = buffer[0]; | 598 | gspca_dev->usb_buf[2] = reg; |
585 | mode[3] = buffer[1]; | 599 | gspca_dev->usb_buf[3] = val; |
586 | mode[4] = 0; | 600 | gspca_dev->usb_buf[4] = 0; |
587 | mode[5] = 0; | 601 | gspca_dev->usb_buf[5] = 0; |
588 | mode[6] = 0; | 602 | gspca_dev->usb_buf[6] = 0; |
589 | mode[7] = 0x10; | 603 | gspca_dev->usb_buf[7] = 0x10; |
590 | reg_w(gspca_dev, 0x08, mode, 8); | 604 | usb_control_msg(gspca_dev->dev, |
605 | usb_sndctrlpipe(gspca_dev->dev, 0), | ||
606 | 0x08, | ||
607 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
608 | 0x08, /* value = i2c */ | ||
609 | 0, | ||
610 | gspca_dev->usb_buf, 8, | ||
611 | 500); | ||
591 | } | 612 | } |
592 | 613 | ||
593 | /* I2C write 8 bytes */ | 614 | /* I2C write 8 bytes */ |
594 | static void i2c_w8(struct gspca_dev *gspca_dev, | 615 | static void i2c_w8(struct gspca_dev *gspca_dev, |
595 | const __u8 *buffer) | 616 | const __u8 *buffer) |
596 | { | 617 | { |
597 | reg_w(gspca_dev, 0x08, buffer, 8); | 618 | memcpy(gspca_dev->usb_buf, buffer, 8); |
598 | msleep(1); | 619 | usb_control_msg(gspca_dev->dev, |
620 | usb_sndctrlpipe(gspca_dev->dev, 0), | ||
621 | 0x08, | ||
622 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
623 | 0x08, 0, /* value, index */ | ||
624 | gspca_dev->usb_buf, 8, | ||
625 | 500); | ||
599 | } | 626 | } |
600 | 627 | ||
601 | /* read 5 bytes in gspca_dev->usb_buf */ | 628 | /* read 5 bytes in gspca_dev->usb_buf */ |
@@ -613,24 +640,21 @@ static void i2c_r5(struct gspca_dev *gspca_dev, __u8 reg) | |||
613 | mode[6] = 0; | 640 | mode[6] = 0; |
614 | mode[7] = 0x10; | 641 | mode[7] = 0x10; |
615 | i2c_w8(gspca_dev, mode); | 642 | i2c_w8(gspca_dev, mode); |
643 | msleep(2); | ||
616 | mode[0] = 0x81 | (5 << 4) | 0x02; | 644 | mode[0] = 0x81 | (5 << 4) | 0x02; |
617 | mode[2] = 0; | 645 | mode[2] = 0; |
618 | i2c_w8(gspca_dev, mode); | 646 | i2c_w8(gspca_dev, mode); |
647 | msleep(2); | ||
619 | reg_r(gspca_dev, 0x0a, 5); | 648 | reg_r(gspca_dev, 0x0a, 5); |
620 | } | 649 | } |
621 | 650 | ||
622 | static int probesensor(struct gspca_dev *gspca_dev) | 651 | static int probesensor(struct gspca_dev *gspca_dev) |
623 | { | 652 | { |
624 | struct sd *sd = (struct sd *) gspca_dev; | 653 | struct sd *sd = (struct sd *) gspca_dev; |
625 | __u8 reg02; | ||
626 | static const __u8 datasend[] = { 2, 0 }; | ||
627 | /* reg val1 val2 val3 val4 */ | ||
628 | 654 | ||
629 | i2c_w2(gspca_dev, datasend); | 655 | i2c_w1(gspca_dev, 0x02, 0); /* sensor wakeup */ |
630 | /* should write 0xa1 0x11 0x02 0x00 0x00 0x00 0x00 the 0x10 is add by i2cw */ | ||
631 | msleep(10); | 656 | msleep(10); |
632 | reg02 = 0x66; | 657 | reg_w1(gspca_dev, 0x02, 0x66); /* Gpio on */ |
633 | reg_w(gspca_dev, 0x02, ®02, 1); /* Gpio on */ | ||
634 | msleep(10); | 658 | msleep(10); |
635 | i2c_r5(gspca_dev, 0); /* read sensor id */ | 659 | i2c_r5(gspca_dev, 0); /* read sensor id */ |
636 | if (gspca_dev->usb_buf[0] == 0x02 | 660 | if (gspca_dev->usb_buf[0] == 0x02 |
@@ -642,7 +666,7 @@ static int probesensor(struct gspca_dev *gspca_dev) | |||
642 | sd->sensor = SENSOR_HV7131R; | 666 | sd->sensor = SENSOR_HV7131R; |
643 | return SENSOR_HV7131R; | 667 | return SENSOR_HV7131R; |
644 | } | 668 | } |
645 | PDEBUG(D_PROBE, "Find Sensor %d %d %d", | 669 | PDEBUG(D_PROBE, "Find Sensor 0x%02x 0x%02x 0x%02x", |
646 | gspca_dev->usb_buf[0], gspca_dev->usb_buf[1], | 670 | gspca_dev->usb_buf[0], gspca_dev->usb_buf[1], |
647 | gspca_dev->usb_buf[2]); | 671 | gspca_dev->usb_buf[2]); |
648 | PDEBUG(D_PROBE, "Sensor sn9c102P Not found"); | 672 | PDEBUG(D_PROBE, "Sensor sn9c102P Not found"); |
@@ -653,8 +677,6 @@ static int configure_gpio(struct gspca_dev *gspca_dev, | |||
653 | const __u8 *sn9c1xx) | 677 | const __u8 *sn9c1xx) |
654 | { | 678 | { |
655 | struct sd *sd = (struct sd *) gspca_dev; | 679 | struct sd *sd = (struct sd *) gspca_dev; |
656 | __u8 data; | ||
657 | __u8 regF1; | ||
658 | const __u8 *reg9a; | 680 | const __u8 *reg9a; |
659 | static const __u8 reg9a_def[] = | 681 | static const __u8 reg9a_def[] = |
660 | {0x08, 0x40, 0x20, 0x10, 0x00, 0x04}; | 682 | {0x08, 0x40, 0x20, 0x10, 0x00, 0x04}; |
@@ -663,15 +685,13 @@ static int configure_gpio(struct gspca_dev *gspca_dev, | |||
663 | static const __u8 reg9a_sn9c325[] = | 685 | static const __u8 reg9a_sn9c325[] = |
664 | {0x0a, 0x40, 0x38, 0x30, 0x00, 0x20}; | 686 | {0x0a, 0x40, 0x38, 0x30, 0x00, 0x20}; |
665 | 687 | ||
666 | 688 | reg_w1(gspca_dev, 0xf1, 0x00); | |
667 | regF1 = 0x00; | 689 | reg_w1(gspca_dev, 0x01, sn9c1xx[0]); /*fixme:jfm was [1] en v1*/ |
668 | reg_w(gspca_dev, 0xf1, ®F1, 1); | ||
669 | reg_w(gspca_dev, 0x01, &sn9c1xx[0], 1); /*fixme:jfm was [1] en v1*/ | ||
670 | 690 | ||
671 | /* configure gpio */ | 691 | /* configure gpio */ |
672 | reg_w(gspca_dev, 0x01, &sn9c1xx[1], 2); | 692 | reg_w(gspca_dev, 0x01, &sn9c1xx[1], 2); |
673 | reg_w(gspca_dev, 0x08, &sn9c1xx[8], 2); | 693 | reg_w(gspca_dev, 0x08, &sn9c1xx[8], 2); |
674 | reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 5); /* jfm was 3 */ | 694 | reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 5); /* jfm len was 3 */ |
675 | switch (sd->bridge) { | 695 | switch (sd->bridge) { |
676 | case BRIDGE_SN9C325: | 696 | case BRIDGE_SN9C325: |
677 | reg9a = reg9a_sn9c325; | 697 | reg9a = reg9a_sn9c325; |
@@ -685,35 +705,25 @@ static int configure_gpio(struct gspca_dev *gspca_dev, | |||
685 | } | 705 | } |
686 | reg_w(gspca_dev, 0x9a, reg9a, 6); | 706 | reg_w(gspca_dev, 0x9a, reg9a, 6); |
687 | 707 | ||
688 | data = 0x60; /*fixme:jfm 60 00 00 (3) */ | 708 | reg_w1(gspca_dev, 0xd4, 0x60); /*fixme:jfm 60 00 00 (3) ? */ |
689 | reg_w(gspca_dev, 0xd4, &data, 1); | ||
690 | 709 | ||
691 | reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f); | 710 | reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f); |
692 | 711 | ||
693 | switch (sd->bridge) { | 712 | switch (sd->bridge) { |
694 | case BRIDGE_SN9C120: /* from win trace */ | 713 | case BRIDGE_SN9C120: /* from win trace */ |
695 | data = 0x61; | 714 | reg_w1(gspca_dev, 0x01, 0x61); |
696 | reg_w(gspca_dev, 0x01, &data, 1); | 715 | reg_w1(gspca_dev, 0x17, 0x20); |
697 | data = 0x20; | 716 | reg_w1(gspca_dev, 0x01, 0x60); |
698 | reg_w(gspca_dev, 0x17, &data, 1); | ||
699 | data = 0x60; | ||
700 | reg_w(gspca_dev, 0x01, &data, 1); | ||
701 | break; | 717 | break; |
702 | case BRIDGE_SN9C325: | 718 | case BRIDGE_SN9C325: |
703 | data = 0x43; | 719 | reg_w1(gspca_dev, 0x01, 0x43); |
704 | reg_w(gspca_dev, 0x01, &data, 1); | 720 | reg_w1(gspca_dev, 0x17, 0xae); |
705 | data = 0xae; | 721 | reg_w1(gspca_dev, 0x01, 0x42); |
706 | reg_w(gspca_dev, 0x17, &data, 1); | ||
707 | data = 0x42; | ||
708 | reg_w(gspca_dev, 0x01, &data, 1); | ||
709 | break; | 722 | break; |
710 | default: | 723 | default: |
711 | data = 0x43; | 724 | reg_w1(gspca_dev, 0x01, 0x43); |
712 | reg_w(gspca_dev, 0x01, &data, 1); | 725 | reg_w1(gspca_dev, 0x17, 0x61); |
713 | data = 0x61; | 726 | reg_w1(gspca_dev, 0x01, 0x42); |
714 | reg_w(gspca_dev, 0x17, &data, 1); | ||
715 | data = 0x42; | ||
716 | reg_w(gspca_dev, 0x01, &data, 1); | ||
717 | } | 727 | } |
718 | 728 | ||
719 | if (sd->sensor == SENSOR_HV7131R) { | 729 | if (sd->sensor == SENSOR_HV7131R) { |
@@ -770,6 +780,9 @@ static void ov7660_InitSensor(struct gspca_dev *gspca_dev) | |||
770 | { | 780 | { |
771 | int i = 0; | 781 | int i = 0; |
772 | 782 | ||
783 | i2c_w8(gspca_dev, ov7660_sensor_init[i]); /* reset SCCB */ | ||
784 | i++; | ||
785 | msleep(20); | ||
773 | while (ov7660_sensor_init[i][0]) { | 786 | while (ov7660_sensor_init[i][0]) { |
774 | i2c_w8(gspca_dev, ov7660_sensor_init[i]); | 787 | i2c_w8(gspca_dev, ov7660_sensor_init[i]); |
775 | i++; | 788 | i++; |
@@ -782,194 +795,16 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
782 | { | 795 | { |
783 | struct sd *sd = (struct sd *) gspca_dev; | 796 | struct sd *sd = (struct sd *) gspca_dev; |
784 | struct cam *cam; | 797 | struct cam *cam; |
785 | __u16 vendor; | ||
786 | __u16 product; | ||
787 | |||
788 | vendor = id->idVendor; | ||
789 | product = id->idProduct; | ||
790 | sd->sensor = -1; | ||
791 | switch (vendor) { | ||
792 | case 0x0458: /* Genius */ | ||
793 | /* switch (product) { | ||
794 | case 0x7025: */ | ||
795 | sd->bridge = BRIDGE_SN9C120; | ||
796 | sd->sensor = SENSOR_MI0360; | ||
797 | sd->i2c_base = 0x5d; | ||
798 | /* break; | ||
799 | } */ | ||
800 | break; | ||
801 | case 0x045e: | ||
802 | /* switch (product) { | ||
803 | case 0x00f5: | ||
804 | case 0x00f7: */ | ||
805 | sd->bridge = BRIDGE_SN9C105; | ||
806 | sd->sensor = SENSOR_OV7660; | ||
807 | sd->i2c_base = 0x21; | ||
808 | /* break; | ||
809 | } */ | ||
810 | break; | ||
811 | case 0x0471: /* Philips */ | ||
812 | /* switch (product) { | ||
813 | case 0x0327: | ||
814 | case 0x0328: | ||
815 | case 0x0330: */ | ||
816 | sd->bridge = BRIDGE_SN9C105; | ||
817 | sd->sensor = SENSOR_MI0360; | ||
818 | sd->i2c_base = 0x5d; | ||
819 | /* break; | ||
820 | } */ | ||
821 | break; | ||
822 | case 0x0c45: /* Sonix */ | ||
823 | switch (product) { | ||
824 | case 0x6040: | ||
825 | sd->bridge = BRIDGE_SN9C102P; | ||
826 | /* sd->sensor = SENSOR_MI0360; * from BW600.inf */ | ||
827 | /*fixme: MI0360 base=5d ? */ | ||
828 | sd->sensor = SENSOR_HV7131R; /* gspcav1 value */ | ||
829 | sd->i2c_base = 0x11; | ||
830 | break; | ||
831 | /* case 0x607a: * from BW600.inf | ||
832 | sd->bridge = BRIDGE_SN9C102P; | ||
833 | sd->sensor = SENSOR_OV7648; | ||
834 | sd->i2c_base = 0x??; | ||
835 | break; */ | ||
836 | case 0x607c: | ||
837 | sd->bridge = BRIDGE_SN9C102P; | ||
838 | sd->sensor = SENSOR_HV7131R; | ||
839 | sd->i2c_base = 0x11; | ||
840 | break; | ||
841 | /* case 0x607e: * from BW600.inf | ||
842 | sd->bridge = BRIDGE_SN9C102P; | ||
843 | sd->sensor = SENSOR_OV7630; | ||
844 | sd->i2c_base = 0x??; | ||
845 | break; */ | ||
846 | case 0x60c0: | ||
847 | sd->bridge = BRIDGE_SN9C105; | ||
848 | sd->sensor = SENSOR_MI0360; | ||
849 | sd->i2c_base = 0x5d; | ||
850 | break; | ||
851 | /* case 0x60c8: * from BW600.inf | ||
852 | sd->bridge = BRIDGE_SN9C105; | ||
853 | sd->sensor = SENSOR_OM6801; | ||
854 | sd->i2c_base = 0x??; | ||
855 | break; */ | ||
856 | /* case 0x60cc: * from BW600.inf | ||
857 | sd->bridge = BRIDGE_SN9C105; | ||
858 | sd->sensor = SENSOR_HV7131GP; | ||
859 | sd->i2c_base = 0x??; | ||
860 | break; */ | ||
861 | case 0x60ec: | ||
862 | sd->bridge = BRIDGE_SN9C105; | ||
863 | sd->sensor = SENSOR_MO4000; | ||
864 | sd->i2c_base = 0x21; | ||
865 | break; | ||
866 | /* case 0x60ef: * from BW600.inf | ||
867 | sd->bridge = BRIDGE_SN9C105; | ||
868 | sd->sensor = SENSOR_ICM105C; | ||
869 | sd->i2c_base = 0x??; | ||
870 | break; */ | ||
871 | /* case 0x60fa: * from BW600.inf | ||
872 | sd->bridge = BRIDGE_SN9C105; | ||
873 | sd->sensor = SENSOR_OV7648; | ||
874 | sd->i2c_base = 0x??; | ||
875 | break; */ | ||
876 | case 0x60fb: | ||
877 | sd->bridge = BRIDGE_SN9C105; | ||
878 | sd->sensor = SENSOR_OV7660; | ||
879 | sd->i2c_base = 0x21; | ||
880 | break; | ||
881 | case 0x60fc: | ||
882 | sd->bridge = BRIDGE_SN9C105; | ||
883 | sd->sensor = SENSOR_HV7131R; | ||
884 | sd->i2c_base = 0x11; | ||
885 | break; | ||
886 | /* case 0x60fe: * from BW600.inf | ||
887 | sd->bridge = BRIDGE_SN9C105; | ||
888 | sd->sensor = SENSOR_OV7630; | ||
889 | sd->i2c_base = 0x??; | ||
890 | break; */ | ||
891 | /* case 0x6108: * from BW600.inf | ||
892 | sd->bridge = BRIDGE_SN9C120; | ||
893 | sd->sensor = SENSOR_OM6801; | ||
894 | sd->i2c_base = 0x??; | ||
895 | break; */ | ||
896 | /* case 0x6122: * from BW600.inf | ||
897 | sd->bridge = BRIDGE_SN9C110; | ||
898 | sd->sensor = SENSOR_ICM105C; | ||
899 | sd->i2c_base = 0x??; | ||
900 | break; */ | ||
901 | case 0x612a: | ||
902 | /* sd->bridge = BRIDGE_SN9C110; * in BW600.inf */ | ||
903 | sd->bridge = BRIDGE_SN9C325; | ||
904 | sd->sensor = SENSOR_OV7648; | ||
905 | sd->i2c_base = 0x21; | ||
906 | /*fixme: sensor_init has base = 00 et 6e!*/ | ||
907 | break; | ||
908 | /* case 0x6123: * from BW600.inf | ||
909 | sd->bridge = BRIDGE_SN9C110; | ||
910 | sd->sensor = SENSOR_SanyoCCD; | ||
911 | sd->i2c_base = 0x??; | ||
912 | break; */ | ||
913 | case 0x612c: | ||
914 | sd->bridge = BRIDGE_SN9C110; | ||
915 | sd->sensor = SENSOR_MO4000; | ||
916 | sd->i2c_base = 0x21; | ||
917 | break; | ||
918 | /* case 0x612e: * from BW600.inf | ||
919 | sd->bridge = BRIDGE_SN9C110; | ||
920 | sd->sensor = SENSOR_OV7630; | ||
921 | sd->i2c_base = 0x??; | ||
922 | break; */ | ||
923 | /* case 0x612f: * from BW600.inf | ||
924 | sd->bridge = BRIDGE_SN9C110; | ||
925 | sd->sensor = SENSOR_ICM105C; | ||
926 | sd->i2c_base = 0x??; | ||
927 | break; */ | ||
928 | case 0x6130: | ||
929 | sd->bridge = BRIDGE_SN9C120; | ||
930 | sd->sensor = SENSOR_MI0360; | ||
931 | sd->i2c_base = 0x5d; | ||
932 | break; | ||
933 | case 0x6138: | ||
934 | sd->bridge = BRIDGE_SN9C120; | ||
935 | sd->sensor = SENSOR_MO4000; | ||
936 | sd->i2c_base = 0x21; | ||
937 | break; | ||
938 | /* case 0x613a: * from BW600.inf | ||
939 | sd->bridge = BRIDGE_SN9C120; | ||
940 | sd->sensor = SENSOR_OV7648; | ||
941 | sd->i2c_base = 0x??; | ||
942 | break; */ | ||
943 | case 0x613b: | ||
944 | sd->bridge = BRIDGE_SN9C120; | ||
945 | sd->sensor = SENSOR_OV7660; | ||
946 | sd->i2c_base = 0x21; | ||
947 | break; | ||
948 | case 0x613c: | ||
949 | sd->bridge = BRIDGE_SN9C120; | ||
950 | sd->sensor = SENSOR_HV7131R; | ||
951 | sd->i2c_base = 0x11; | ||
952 | break; | ||
953 | /* case 0x613e: * from BW600.inf | ||
954 | sd->bridge = BRIDGE_SN9C120; | ||
955 | sd->sensor = SENSOR_OV7630; | ||
956 | sd->i2c_base = 0x??; | ||
957 | break; */ | ||
958 | } | ||
959 | break; | ||
960 | } | ||
961 | if (sd->sensor < 0) { | ||
962 | PDEBUG(D_ERR, "Invalid vendor/product %04x:%04x", | ||
963 | vendor, product); | ||
964 | return -EINVAL; | ||
965 | } | ||
966 | 798 | ||
967 | cam = &gspca_dev->cam; | 799 | cam = &gspca_dev->cam; |
968 | cam->dev_name = (char *) id->driver_info; | ||
969 | cam->epaddr = 0x01; | 800 | cam->epaddr = 0x01; |
970 | cam->cam_mode = vga_mode; | 801 | cam->cam_mode = vga_mode; |
971 | cam->nmodes = ARRAY_SIZE(vga_mode); | 802 | cam->nmodes = ARRAY_SIZE(vga_mode); |
972 | 803 | ||
804 | sd->bridge = id->driver_info >> 16; | ||
805 | sd->sensor = id->driver_info >> 8; | ||
806 | sd->i2c_base = id->driver_info; | ||
807 | |||
973 | sd->qindex = 4; /* set the quantization table */ | 808 | sd->qindex = 4; /* set the quantization table */ |
974 | sd->brightness = BRIGHTNESS_DEF; | 809 | sd->brightness = BRIGHTNESS_DEF; |
975 | sd->contrast = CONTRAST_DEF; | 810 | sd->contrast = CONTRAST_DEF; |
@@ -983,34 +818,26 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
983 | { | 818 | { |
984 | struct sd *sd = (struct sd *) gspca_dev; | 819 | struct sd *sd = (struct sd *) gspca_dev; |
985 | /* const __u8 *sn9c1xx; */ | 820 | /* const __u8 *sn9c1xx; */ |
986 | __u8 regF1; | ||
987 | __u8 regGpio[] = { 0x29, 0x74 }; | 821 | __u8 regGpio[] = { 0x29, 0x74 }; |
822 | __u8 regF1; | ||
988 | 823 | ||
989 | /* setup a selector by bridge */ | 824 | /* setup a selector by bridge */ |
990 | regF1 = 0x01; | 825 | reg_w1(gspca_dev, 0xf1, 0x01); |
991 | reg_w(gspca_dev, 0xf1, ®F1, 1); | ||
992 | reg_r(gspca_dev, 0x00, 1); /* -> regF1 = 0x00 */ | 826 | reg_r(gspca_dev, 0x00, 1); /* -> regF1 = 0x00 */ |
993 | regF1 = gspca_dev->usb_buf[0]; | 827 | reg_w1(gspca_dev, 0xf1, gspca_dev->usb_buf[0]); |
994 | reg_w(gspca_dev, 0xf1, ®F1, 1); | ||
995 | reg_r(gspca_dev, 0x00, 1); | 828 | reg_r(gspca_dev, 0x00, 1); |
996 | regF1 = gspca_dev->usb_buf[0]; | 829 | regF1 = gspca_dev->usb_buf[0]; |
997 | switch (sd->bridge) { | 830 | switch (sd->bridge) { |
998 | case BRIDGE_SN9C102P: | 831 | case BRIDGE_SN9C102P: |
999 | if (regF1 != 0x11) | 832 | if (regF1 != 0x11) |
1000 | return -ENODEV; | 833 | return -ENODEV; |
1001 | reg_w(gspca_dev, 0x02, ®Gpio[1], 1); | 834 | reg_w1(gspca_dev, 0x02, regGpio[1]); |
1002 | break; | 835 | break; |
1003 | case BRIDGE_SN9C105: | 836 | case BRIDGE_SN9C105: |
1004 | if (regF1 != 0x11) | 837 | if (regF1 != 0x11) |
1005 | return -ENODEV; | 838 | return -ENODEV; |
1006 | reg_w(gspca_dev, 0x02, regGpio, 2); | 839 | reg_w(gspca_dev, 0x02, regGpio, 2); |
1007 | break; | 840 | break; |
1008 | case BRIDGE_SN9C110: | ||
1009 | if (regF1 != 0x12) | ||
1010 | return -ENODEV; | ||
1011 | regGpio[1] = 0x62; | ||
1012 | reg_w(gspca_dev, 0x02, ®Gpio[1], 1); | ||
1013 | break; | ||
1014 | case BRIDGE_SN9C120: | 841 | case BRIDGE_SN9C120: |
1015 | if (regF1 != 0x12) | 842 | if (regF1 != 0x12) |
1016 | return -ENODEV; | 843 | return -ENODEV; |
@@ -1018,16 +845,15 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
1018 | reg_w(gspca_dev, 0x02, regGpio, 2); | 845 | reg_w(gspca_dev, 0x02, regGpio, 2); |
1019 | break; | 846 | break; |
1020 | default: | 847 | default: |
848 | /* case BRIDGE_SN9C110: */ | ||
1021 | /* case BRIDGE_SN9C325: */ | 849 | /* case BRIDGE_SN9C325: */ |
1022 | if (regF1 != 0x12) | 850 | if (regF1 != 0x12) |
1023 | return -ENODEV; | 851 | return -ENODEV; |
1024 | regGpio[1] = 0x62; | 852 | reg_w1(gspca_dev, 0x02, 0x62); |
1025 | reg_w(gspca_dev, 0x02, ®Gpio[1], 1); | ||
1026 | break; | 853 | break; |
1027 | } | 854 | } |
1028 | 855 | ||
1029 | regF1 = 0x01; | 856 | reg_w1(gspca_dev, 0xf1, 0x01); |
1030 | reg_w(gspca_dev, 0xf1, ®F1, 1); | ||
1031 | 857 | ||
1032 | return 0; | 858 | return 0; |
1033 | } | 859 | } |
@@ -1123,7 +949,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
1123 | } | 949 | } |
1124 | 950 | ||
1125 | k2 = sd->brightness >> 10; | 951 | k2 = sd->brightness >> 10; |
1126 | reg_w(gspca_dev, 0x96, &k2, 1); | 952 | reg_w1(gspca_dev, 0x96, k2); |
1127 | } | 953 | } |
1128 | 954 | ||
1129 | static void setcontrast(struct gspca_dev *gspca_dev) | 955 | static void setcontrast(struct gspca_dev *gspca_dev) |
@@ -1152,7 +978,7 @@ static void setcolors(struct gspca_dev *gspca_dev) | |||
1152 | data = (colour + 32) & 0x7f; /* blue */ | 978 | data = (colour + 32) & 0x7f; /* blue */ |
1153 | else | 979 | else |
1154 | data = (-colour + 32) & 0x7f; /* red */ | 980 | data = (-colour + 32) & 0x7f; /* red */ |
1155 | reg_w(gspca_dev, 0x05, &data, 1); | 981 | reg_w1(gspca_dev, 0x05, data); |
1156 | } | 982 | } |
1157 | 983 | ||
1158 | /* -- start the camera -- */ | 984 | /* -- start the camera -- */ |
@@ -1165,7 +991,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1165 | __u8 reg17; | 991 | __u8 reg17; |
1166 | const __u8 *sn9c1xx; | 992 | const __u8 *sn9c1xx; |
1167 | int mode; | 993 | int mode; |
1168 | static const __u8 DC29[] = { 0x6a, 0x50, 0x00, 0x00, 0x50, 0x3c }; | ||
1169 | static const __u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; | 994 | static const __u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; |
1170 | static const __u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; | 995 | static const __u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; |
1171 | static const __u8 CA_sn9c120[] = | 996 | static const __u8 CA_sn9c120[] = |
@@ -1179,21 +1004,20 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1179 | 1004 | ||
1180 | /*fixme:jfm this sequence should appear at end of sd_start */ | 1005 | /*fixme:jfm this sequence should appear at end of sd_start */ |
1181 | /* with | 1006 | /* with |
1182 | data = 0x44; | 1007 | reg_w1(gspca_dev, 0x01, 0x44); */ |
1183 | reg_w(gspca_dev, 0x01, &data, 1); */ | 1008 | reg_w1(gspca_dev, 0x15, sn9c1xx[0x15]); |
1184 | reg_w(gspca_dev, 0x15, &sn9c1xx[0x15], 1); | 1009 | reg_w1(gspca_dev, 0x16, sn9c1xx[0x16]); |
1185 | reg_w(gspca_dev, 0x16, &sn9c1xx[0x16], 1); | 1010 | reg_w1(gspca_dev, 0x12, sn9c1xx[0x12]); |
1186 | reg_w(gspca_dev, 0x12, &sn9c1xx[0x12], 1); | 1011 | reg_w1(gspca_dev, 0x13, sn9c1xx[0x13]); |
1187 | reg_w(gspca_dev, 0x13, &sn9c1xx[0x13], 1); | 1012 | reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); |
1188 | reg_w(gspca_dev, 0x18, &sn9c1xx[0x18], 1); | 1013 | reg_w1(gspca_dev, 0xd2, 0x6a); /* DC29 */ |
1189 | reg_w(gspca_dev, 0xd2, &DC29[0], 1); | 1014 | reg_w1(gspca_dev, 0xd3, 0x50); |
1190 | reg_w(gspca_dev, 0xd3, &DC29[1], 1); | 1015 | reg_w1(gspca_dev, 0xc6, 0x00); |
1191 | reg_w(gspca_dev, 0xc6, &DC29[2], 1); | 1016 | reg_w1(gspca_dev, 0xc7, 0x00); |
1192 | reg_w(gspca_dev, 0xc7, &DC29[3], 1); | 1017 | reg_w1(gspca_dev, 0xc8, 0x50); |
1193 | reg_w(gspca_dev, 0xc8, &DC29[4], 1); | 1018 | reg_w1(gspca_dev, 0xc9, 0x3c); |
1194 | reg_w(gspca_dev, 0xc9, &DC29[5], 1); | ||
1195 | /*fixme:jfm end of ending sequence */ | 1019 | /*fixme:jfm end of ending sequence */ |
1196 | reg_w(gspca_dev, 0x18, &sn9c1xx[0x18], 1); | 1020 | reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); |
1197 | switch (sd->bridge) { | 1021 | switch (sd->bridge) { |
1198 | case BRIDGE_SN9C325: | 1022 | case BRIDGE_SN9C325: |
1199 | data = 0xae; | 1023 | data = 0xae; |
@@ -1205,11 +1029,11 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1205 | data = 0x60; | 1029 | data = 0x60; |
1206 | break; | 1030 | break; |
1207 | } | 1031 | } |
1208 | reg_w(gspca_dev, 0x17, &data, 1); | 1032 | reg_w1(gspca_dev, 0x17, data); |
1209 | reg_w(gspca_dev, 0x05, &sn9c1xx[5], 1); | 1033 | reg_w1(gspca_dev, 0x05, sn9c1xx[5]); |
1210 | reg_w(gspca_dev, 0x07, &sn9c1xx[7], 1); | 1034 | reg_w1(gspca_dev, 0x07, sn9c1xx[7]); |
1211 | reg_w(gspca_dev, 0x06, &sn9c1xx[6], 1); | 1035 | reg_w1(gspca_dev, 0x06, sn9c1xx[6]); |
1212 | reg_w(gspca_dev, 0x14, &sn9c1xx[0x14], 1); | 1036 | reg_w1(gspca_dev, 0x14, sn9c1xx[0x14]); |
1213 | switch (sd->bridge) { | 1037 | switch (sd->bridge) { |
1214 | case BRIDGE_SN9C325: | 1038 | case BRIDGE_SN9C325: |
1215 | reg_w(gspca_dev, 0x20, regsn20_sn9c325, | 1039 | reg_w(gspca_dev, 0x20, regsn20_sn9c325, |
@@ -1217,10 +1041,8 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1217 | for (i = 0; i < 8; i++) | 1041 | for (i = 0; i < 8; i++) |
1218 | reg_w(gspca_dev, 0x84, reg84_sn9c325, | 1042 | reg_w(gspca_dev, 0x84, reg84_sn9c325, |
1219 | sizeof reg84_sn9c325); | 1043 | sizeof reg84_sn9c325); |
1220 | data = 0x0a; | 1044 | reg_w1(gspca_dev, 0x9a, 0x0a); |
1221 | reg_w(gspca_dev, 0x9a, &data, 1); | 1045 | reg_w1(gspca_dev, 0x99, 0x60); |
1222 | data = 0x60; | ||
1223 | reg_w(gspca_dev, 0x99, &data, 1); | ||
1224 | break; | 1046 | break; |
1225 | case BRIDGE_SN9C120: | 1047 | case BRIDGE_SN9C120: |
1226 | reg_w(gspca_dev, 0x20, regsn20_sn9c120, | 1048 | reg_w(gspca_dev, 0x20, regsn20_sn9c120, |
@@ -1233,39 +1055,30 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1233 | sizeof reg84_sn9c120_2); | 1055 | sizeof reg84_sn9c120_2); |
1234 | reg_w(gspca_dev, 0x84, reg84_sn9c120_3, | 1056 | reg_w(gspca_dev, 0x84, reg84_sn9c120_3, |
1235 | sizeof reg84_sn9c120_3); | 1057 | sizeof reg84_sn9c120_3); |
1236 | data = 0x05; | 1058 | reg_w1(gspca_dev, 0x9a, 0x05); |
1237 | reg_w(gspca_dev, 0x9a, &data, 1); | 1059 | reg_w1(gspca_dev, 0x99, 0x5b); |
1238 | data = 0x5b; | ||
1239 | reg_w(gspca_dev, 0x99, &data, 1); | ||
1240 | break; | 1060 | break; |
1241 | default: | 1061 | default: |
1242 | reg_w(gspca_dev, 0x20, regsn20, sizeof regsn20); | 1062 | reg_w(gspca_dev, 0x20, regsn20, sizeof regsn20); |
1243 | for (i = 0; i < 8; i++) | 1063 | for (i = 0; i < 8; i++) |
1244 | reg_w(gspca_dev, 0x84, reg84, sizeof reg84); | 1064 | reg_w(gspca_dev, 0x84, reg84, sizeof reg84); |
1245 | data = 0x08; | 1065 | reg_w1(gspca_dev, 0x9a, 0x08); |
1246 | reg_w(gspca_dev, 0x9a, &data, 1); | 1066 | reg_w1(gspca_dev, 0x99, 0x59); |
1247 | data = 0x59; | ||
1248 | reg_w(gspca_dev, 0x99, &data, 1); | ||
1249 | break; | 1067 | break; |
1250 | } | 1068 | } |
1251 | 1069 | ||
1252 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; | 1070 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; |
1253 | reg1 = 0x02; | 1071 | if (mode) |
1072 | reg1 = 0x46; /* 320 clk 48Mhz */ | ||
1073 | else | ||
1074 | reg1 = 0x06; /* 640 clk 24Mz */ | ||
1254 | reg17 = 0x61; | 1075 | reg17 = 0x61; |
1255 | switch (sd->sensor) { | 1076 | switch (sd->sensor) { |
1256 | case SENSOR_HV7131R: | 1077 | case SENSOR_HV7131R: |
1257 | hv7131R_InitSensor(gspca_dev); | 1078 | hv7131R_InitSensor(gspca_dev); |
1258 | if (mode) | ||
1259 | reg1 = 0x46; /* 320 clk 48Mhz */ | ||
1260 | else | ||
1261 | reg1 = 0x06; /* 640 clk 24Mz */ | ||
1262 | break; | 1079 | break; |
1263 | case SENSOR_MI0360: | 1080 | case SENSOR_MI0360: |
1264 | mi0360_InitSensor(gspca_dev); | 1081 | mi0360_InitSensor(gspca_dev); |
1265 | if (mode) | ||
1266 | reg1 = 0x46; /* 320 clk 48Mhz */ | ||
1267 | else | ||
1268 | reg1 = 0x06; /* 640 clk 24Mz */ | ||
1269 | break; | 1082 | break; |
1270 | case SENSOR_MO4000: | 1083 | case SENSOR_MO4000: |
1271 | mo4000_InitSensor(gspca_dev); | 1084 | mo4000_InitSensor(gspca_dev); |
@@ -1274,13 +1087,13 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1274 | reg1 = 0x06; /* clk 24Mz */ | 1087 | reg1 = 0x06; /* clk 24Mz */ |
1275 | } else { | 1088 | } else { |
1276 | reg17 = 0x22; /* 640 MCKSIZE */ | 1089 | reg17 = 0x22; /* 640 MCKSIZE */ |
1277 | reg1 = 0x06; /* 640 clk 24Mz */ | 1090 | /* reg1 = 0x06; * 640 clk 24Mz (done) */ |
1278 | } | 1091 | } |
1279 | break; | 1092 | break; |
1280 | case SENSOR_OV7648: | 1093 | case SENSOR_OV7648: |
1094 | ov7648_InitSensor(gspca_dev); | ||
1281 | reg17 = 0xa2; | 1095 | reg17 = 0xa2; |
1282 | reg1 = 0x44; | 1096 | reg1 = 0x44; |
1283 | ov7648_InitSensor(gspca_dev); | ||
1284 | /* if (mode) | 1097 | /* if (mode) |
1285 | ; * 320x2... | 1098 | ; * 320x2... |
1286 | else | 1099 | else |
@@ -1292,7 +1105,7 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1292 | if (mode) { | 1105 | if (mode) { |
1293 | /* reg17 = 0x21; * 320 */ | 1106 | /* reg17 = 0x21; * 320 */ |
1294 | /* reg1 = 0x44; */ | 1107 | /* reg1 = 0x44; */ |
1295 | reg1 = 0x46; | 1108 | /* reg1 = 0x46; (done) */ |
1296 | } else { | 1109 | } else { |
1297 | reg17 = 0xa2; /* 640 */ | 1110 | reg17 = 0xa2; /* 640 */ |
1298 | reg1 = 0x40; | 1111 | reg1 = 0x40; |
@@ -1321,16 +1134,16 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1321 | 1134 | ||
1322 | /* here change size mode 0 -> VGA; 1 -> CIF */ | 1135 | /* here change size mode 0 -> VGA; 1 -> CIF */ |
1323 | data = 0x40 | sn9c1xx[0x18] | (mode << 4); | 1136 | data = 0x40 | sn9c1xx[0x18] | (mode << 4); |
1324 | reg_w(gspca_dev, 0x18, &data, 1); | 1137 | reg_w1(gspca_dev, 0x18, data); |
1325 | 1138 | ||
1326 | reg_w(gspca_dev, 0x100, qtable4, 0x40); | 1139 | reg_w(gspca_dev, 0x100, qtable4, 0x40); |
1327 | reg_w(gspca_dev, 0x140, qtable4 + 0x40, 0x40); | 1140 | reg_w(gspca_dev, 0x140, qtable4 + 0x40, 0x40); |
1328 | 1141 | ||
1329 | data = sn9c1xx[0x18] | (mode << 4); | 1142 | data = sn9c1xx[0x18] | (mode << 4); |
1330 | reg_w(gspca_dev, 0x18, &data, 1); | 1143 | reg_w1(gspca_dev, 0x18, data); |
1331 | 1144 | ||
1332 | reg_w(gspca_dev, 0x17, ®17, 1); | 1145 | reg_w1(gspca_dev, 0x17, reg17); |
1333 | reg_w(gspca_dev, 0x01, ®1, 1); | 1146 | reg_w1(gspca_dev, 0x01, reg1); |
1334 | setbrightness(gspca_dev); | 1147 | setbrightness(gspca_dev); |
1335 | setcontrast(gspca_dev); | 1148 | setcontrast(gspca_dev); |
1336 | } | 1149 | } |
@@ -1342,7 +1155,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1342 | { 0xa1, 0x11, 0x02, 0x09, 0x00, 0x00, 0x00, 0x10 }; | 1155 | { 0xa1, 0x11, 0x02, 0x09, 0x00, 0x00, 0x00, 0x10 }; |
1343 | static const __u8 stopmi0360[] = | 1156 | static const __u8 stopmi0360[] = |
1344 | { 0xb1, 0x5d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10 }; | 1157 | { 0xb1, 0x5d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10 }; |
1345 | __u8 regF1; | ||
1346 | __u8 data; | 1158 | __u8 data; |
1347 | const __u8 *sn9c1xx; | 1159 | const __u8 *sn9c1xx; |
1348 | 1160 | ||
@@ -1366,12 +1178,11 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1366 | break; | 1178 | break; |
1367 | } | 1179 | } |
1368 | sn9c1xx = sn_tb[(int) sd->sensor]; | 1180 | sn9c1xx = sn_tb[(int) sd->sensor]; |
1369 | reg_w(gspca_dev, 0x01, &sn9c1xx[1], 1); | 1181 | reg_w1(gspca_dev, 0x01, sn9c1xx[1]); |
1370 | reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 1); | 1182 | reg_w1(gspca_dev, 0x17, sn9c1xx[0x17]); |
1371 | reg_w(gspca_dev, 0x01, &sn9c1xx[1], 1); | 1183 | reg_w1(gspca_dev, 0x01, sn9c1xx[1]); |
1372 | reg_w(gspca_dev, 0x01, &data, 1); | 1184 | reg_w1(gspca_dev, 0x01, data); |
1373 | regF1 = 0x01; | 1185 | reg_w1(gspca_dev, 0xf1, 0x01); |
1374 | reg_w(gspca_dev, 0xf1, ®F1, 1); | ||
1375 | } | 1186 | } |
1376 | 1187 | ||
1377 | static void sd_stop0(struct gspca_dev *gspca_dev) | 1188 | static void sd_stop0(struct gspca_dev *gspca_dev) |
@@ -1610,30 +1421,53 @@ static const struct sd_desc sd_desc = { | |||
1610 | }; | 1421 | }; |
1611 | 1422 | ||
1612 | /* -- module initialisation -- */ | 1423 | /* -- module initialisation -- */ |
1613 | #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) | ||
1614 | static const __devinitdata struct usb_device_id device_table[] = { | 1428 | static const __devinitdata struct usb_device_id device_table[] = { |
1615 | #ifndef CONFIG_USB_SN9C102 | 1429 | #ifndef CONFIG_USB_SN9C102 |
1616 | {USB_DEVICE(0x0458, 0x7025), DVNM("Genius Eye 311Q")}, | 1430 | {USB_DEVICE(0x0458, 0x7025), BSI(SN9C120, MI0360, 0x5d)}, |
1617 | {USB_DEVICE(0x045e, 0x00f5), DVNM("MicroSoft VX3000")}, | 1431 | {USB_DEVICE(0x045e, 0x00f5), BSI(SN9C105, OV7660, 0x21)}, |
1618 | {USB_DEVICE(0x045e, 0x00f7), DVNM("MicroSoft VX1000")}, | 1432 | {USB_DEVICE(0x045e, 0x00f7), BSI(SN9C105, OV7660, 0x21)}, |
1619 | {USB_DEVICE(0x0471, 0x0327), DVNM("Philips SPC 600 NC")}, | 1433 | {USB_DEVICE(0x0471, 0x0327), BSI(SN9C105, MI0360, 0x5d)}, |
1620 | {USB_DEVICE(0x0471, 0x0328), DVNM("Philips SPC 700 NC")}, | 1434 | {USB_DEVICE(0x0471, 0x0328), BSI(SN9C105, MI0360, 0x5d)}, |
1621 | #endif | 1435 | #endif |
1622 | {USB_DEVICE(0x0471, 0x0330), DVNM("Philips SPC 710NC")}, | 1436 | {USB_DEVICE(0x0471, 0x0330), BSI(SN9C105, MI0360, 0x5d)}, |
1623 | {USB_DEVICE(0x0c45, 0x6040), DVNM("Speed NVC 350K")}, | 1437 | {USB_DEVICE(0x0c45, 0x6040), BSI(SN9C102P, HV7131R, 0x11)}, |
1624 | {USB_DEVICE(0x0c45, 0x607c), DVNM("Sonix sn9c102p Hv7131R")}, | 1438 | /* bw600.inf: |
1625 | {USB_DEVICE(0x0c45, 0x60c0), DVNM("Sangha Sn535")}, | 1439 | {USB_DEVICE(0x0c45, 0x6040), BSI(SN9C102P, MI0360, 0x5d)}, */ |
1626 | {USB_DEVICE(0x0c45, 0x60ec), DVNM("SN9C105+MO4000")}, | 1440 | /* {USB_DEVICE(0x0c45, 0x603a), BSI(SN9C102P, OV7648, 0x??)}, */ |
1627 | {USB_DEVICE(0x0c45, 0x60fb), DVNM("Surfer NoName")}, | 1441 | /* {USB_DEVICE(0x0c45, 0x607a), BSI(SN9C102P, OV7648, 0x??)}, */ |
1628 | {USB_DEVICE(0x0c45, 0x60fc), DVNM("LG-LIC300")}, | 1442 | {USB_DEVICE(0x0c45, 0x607c), BSI(SN9C102P, HV7131R, 0x11)}, |
1629 | {USB_DEVICE(0x0c45, 0x612a), DVNM("Avant Camera")}, | 1443 | /* {USB_DEVICE(0x0c45, 0x607e), BSI(SN9C102P, OV7630, 0x??)}, */ |
1630 | {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??)}, */ | ||
1631 | #ifndef CONFIG_USB_SN9C102 | 1462 | #ifndef CONFIG_USB_SN9C102 |
1632 | {USB_DEVICE(0x0c45, 0x6130), DVNM("Sonix Pccam")}, | 1463 | {USB_DEVICE(0x0c45, 0x6130), BSI(SN9C120, MI0360, 0x5d)}, |
1633 | {USB_DEVICE(0x0c45, 0x6138), DVNM("Sn9c120 Mo4000")}, | 1464 | {USB_DEVICE(0x0c45, 0x6138), BSI(SN9C120, MO4000, 0x21)}, |
1634 | {USB_DEVICE(0x0c45, 0x613b), DVNM("Surfer SN-206")}, | 1465 | /* {USB_DEVICE(0x0c45, 0x613a), BSI(SN9C120, OV7648, 0x??)}, */ |
1635 | {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??)}, */ | ||
1636 | #endif | 1469 | #endif |
1470 | {USB_DEVICE(0x0c45, 0x6143), BSI(SN9C120, MI0360, 0x5d)}, | ||
1637 | {} | 1471 | {} |
1638 | }; | 1472 | }; |
1639 | MODULE_DEVICE_TABLE(usb, device_table); | 1473 | MODULE_DEVICE_TABLE(usb, device_table); |
@@ -1658,7 +1492,7 @@ static int __init sd_mod_init(void) | |||
1658 | { | 1492 | { |
1659 | if (usb_register(&sd_driver) < 0) | 1493 | if (usb_register(&sd_driver) < 0) |
1660 | return -1; | 1494 | return -1; |
1661 | info("v%s registered", version); | 1495 | info("registered"); |
1662 | return 0; | 1496 | return 0; |
1663 | } | 1497 | } |
1664 | static void __exit sd_mod_exit(void) | 1498 | static void __exit sd_mod_exit(void) |