aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorHans de Goede <j.w.r.degoede@hhs.nl>2008-07-15 04:36:30 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:26:33 -0400
commit3647fea840c94c04f35215cb75b48613c0af310e (patch)
tree3ecb7a769b9258b6521b5c7582db81e6fb2af848 /drivers/media/video/gspca
parentad5ef80dd79851ea683e2d30ca4ebdc0c043a675 (diff)
V4L/DVB (8356): gspca: 352x288 mode fix and source clean-up for Sonix bridges.
sonixb: Bad initialization of sensor for 352x288 mode. (from Hans de Goede) sonixj: Clean-up source. Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r--drivers/media/video/gspca/gspca.c2
-rw-r--r--drivers/media/video/gspca/sonixb.c7
-rw-r--r--drivers/media/video/gspca/sonixj.c148
3 files changed, 63 insertions, 94 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 242f0fb68d6e..16e367cec760 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -168,7 +168,7 @@ static void isoc_irq(struct urb *urb
168{ 168{
169 struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context; 169 struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context;
170 170
171 PDEBUG(D_PACK, "isoc irq mmap"); 171 PDEBUG(D_PACK, "isoc irq");
172 if (!gspca_dev->streaming) 172 if (!gspca_dev->streaming)
173 return; 173 return;
174 fill_frame(gspca_dev, urb); 174 fill_frame(gspca_dev, urb);
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c
index 6c97c8356d7f..c0ce21fe85f7 100644
--- a/drivers/media/video/gspca/sonixb.c
+++ b/drivers/media/video/gspca/sonixb.c
@@ -244,7 +244,7 @@ static const __u8 initOv7630_3[] = {
244 0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */ 244 0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */
245 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* r09 .. r10 */ 245 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* r09 .. r10 */
246 0x00, 0x01, 0x01, 0x0a, /* r11 .. r14 */ 246 0x00, 0x01, 0x01, 0x0a, /* r11 .. r14 */
247 0x16, 0x12, /* H & V sizes r15 .. r16 */ 247 0x28, 0x1e, /* H & V sizes r15 .. r16 */
248 0x68, 0x8f, MCK_INIT1, /* r17 .. r19 */ 248 0x68, 0x8f, MCK_INIT1, /* r17 .. r19 */
249 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c, 0x00, /* r1a .. r20 */ 249 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c, 0x00, /* r1a .. r20 */
250 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, /* r21 .. r28 */ 250 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, /* r21 .. r28 */
@@ -785,7 +785,6 @@ static void sd_start(struct gspca_dev *gspca_dev)
785 const __u8 *sn9c10x; 785 const __u8 *sn9c10x;
786 __u8 reg01, reg17; 786 __u8 reg01, reg17;
787 __u8 reg17_19[3]; 787 __u8 reg17_19[3];
788 static const __u8 reg15[2] = { 0x28, 0x1e };
789 788
790 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; 789 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
791 switch (sd->sensor) { 790 switch (sd->sensor) {
@@ -905,8 +904,8 @@ static void sd_start(struct gspca_dev *gspca_dev)
905 sizeof tas5130_sensor_init); 904 sizeof tas5130_sensor_init);
906 break; 905 break;
907 } 906 }
908 /* H_size V_size 0x28, 0x1e maybe 640x480 */ 907 /* H_size V_size 0x28, 0x1e -> 640x480. 0x16, 0x12 -> 352x288 */
909 reg_w(gspca_dev, 0x15, reg15, 2); 908 reg_w(gspca_dev, 0x15, &sn9c10x[0x15 - 1], 2);
910 /* compression register */ 909 /* compression register */
911 reg_w(gspca_dev, 0x18, &reg17_19[1], 1); 910 reg_w(gspca_dev, 0x18, &reg17_19[1], 1);
912 if (sd->sensor != SENSOR_OV7630_3) { 911 if (sd->sensor != SENSOR_OV7630_3) {
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index 30e840dca481..93d4746ff95a 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -47,20 +47,19 @@ struct sd {
47#define AG_CNT_START 13 47#define AG_CNT_START 13
48 48
49 char qindex; 49 char qindex;
50 unsigned char bridge;
51#define BRIDGE_SN9C102P 0
52#define BRIDGE_SN9C105 1
53#define BRIDGE_SN9C110 2
54#define BRIDGE_SN9C120 3
55#define BRIDGE_SN9C325 4
50 char sensor; /* Type of image sensor chip */ 56 char sensor; /* Type of image sensor chip */
51#define SENSOR_HV7131R 0 57#define SENSOR_HV7131R 0
52#define SENSOR_MI0360 1 58#define SENSOR_MI0360 1
53#define SENSOR_MO4000 2 59#define SENSOR_MO4000 2
54#define SENSOR_OV7648 3 60#define SENSOR_OV7648 3
55#define SENSOR_OV7660 4 61#define SENSOR_OV7660 4
56 unsigned char customid;
57#define SN9C102P 0
58#define SN9C105 1
59#define SN9C110 2
60#define SN9C120 3
61#define SN9C325 4
62 unsigned char i2c_base; 62 unsigned char i2c_base;
63 unsigned char i2c_ctrl_reg;
64}; 63};
65 64
66/* V4L2 controls supported by the driver */ 65/* V4L2 controls supported by the driver */
@@ -563,7 +562,7 @@ static void i2c_w2(struct gspca_dev *gspca_dev,
563 __u8 mode[8]; 562 __u8 mode[8];
564 563
565 /* is i2c ready */ 564 /* is i2c ready */
566 mode[0] = sd->i2c_ctrl_reg | (2 << 4); 565 mode[0] = 0x81 | (2 << 4);
567 mode[1] = sd->i2c_base; 566 mode[1] = sd->i2c_base;
568 mode[2] = buffer[0]; 567 mode[2] = buffer[0];
569 mode[3] = buffer[1]; 568 mode[3] = buffer[1];
@@ -588,7 +587,7 @@ static void i2c_r5(struct gspca_dev *gspca_dev, __u8 reg)
588 struct sd *sd = (struct sd *) gspca_dev; 587 struct sd *sd = (struct sd *) gspca_dev;
589 __u8 mode[8]; 588 __u8 mode[8];
590 589
591 mode[0] = sd->i2c_ctrl_reg | 0x10; 590 mode[0] = 0x81 | 0x10;
592 mode[1] = sd->i2c_base; 591 mode[1] = sd->i2c_base;
593 mode[2] = reg; 592 mode[2] = reg;
594 mode[3] = 0; 593 mode[3] = 0;
@@ -597,7 +596,7 @@ static void i2c_r5(struct gspca_dev *gspca_dev, __u8 reg)
597 mode[6] = 0; 596 mode[6] = 0;
598 mode[7] = 0x10; 597 mode[7] = 0x10;
599 i2c_w8(gspca_dev, mode); 598 i2c_w8(gspca_dev, mode);
600 mode[0] = sd->i2c_ctrl_reg | (5 << 4) | 0x02; 599 mode[0] = 0x81 | (5 << 4) | 0x02;
601 mode[2] = 0; 600 mode[2] = 0;
602 i2c_w8(gspca_dev, mode); 601 i2c_w8(gspca_dev, mode);
603 reg_r(gspca_dev, 0x0a, 5); 602 reg_r(gspca_dev, 0x0a, 5);
@@ -658,11 +657,11 @@ static int configure_gpio(struct gspca_dev *gspca_dev,
658 reg_w(gspca_dev, 0x01, &sn9c1xx[1], 2); 657 reg_w(gspca_dev, 0x01, &sn9c1xx[1], 2);
659 reg_w(gspca_dev, 0x08, &sn9c1xx[8], 2); 658 reg_w(gspca_dev, 0x08, &sn9c1xx[8], 2);
660 reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 3); 659 reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 3);
661 switch (sd->customid) { 660 switch (sd->bridge) {
662 case SN9C325: 661 case BRIDGE_SN9C325:
663 reg9a = reg9a_sn9c325; 662 reg9a = reg9a_sn9c325;
664 break; 663 break;
665 case SN9C120: 664 case BRIDGE_SN9C120:
666 reg9a = reg9a_sn9c120; 665 reg9a = reg9a_sn9c120;
667 break; 666 break;
668 default: 667 default:
@@ -676,8 +675,8 @@ static int configure_gpio(struct gspca_dev *gspca_dev,
676 675
677 reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f); 676 reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f);
678 677
679 switch (sd->customid) { 678 switch (sd->bridge) {
680 case SN9C120: /* from win trace */ 679 case BRIDGE_SN9C120: /* from win trace */
681 data = 0x61; 680 data = 0x61;
682 reg_w(gspca_dev, 0x01, &data, 1); 681 reg_w(gspca_dev, 0x01, &data, 1);
683 data = 0x20; 682 data = 0x20;
@@ -685,7 +684,7 @@ static int configure_gpio(struct gspca_dev *gspca_dev,
685 data = 0x60; 684 data = 0x60;
686 reg_w(gspca_dev, 0x01, &data, 1); 685 reg_w(gspca_dev, 0x01, &data, 1);
687 break; 686 break;
688 case SN9C325: 687 case BRIDGE_SN9C325:
689 data = 0x43; 688 data = 0x43;
690 reg_w(gspca_dev, 0x01, &data, 1); 689 reg_w(gspca_dev, 0x01, &data, 1);
691 data = 0xae; 690 data = 0xae;
@@ -778,9 +777,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
778 case 0x0458: /* Genius */ 777 case 0x0458: /* Genius */
779/* switch (product) { 778/* switch (product) {
780 case 0x7025: */ 779 case 0x7025: */
781 sd->customid = SN9C120; 780 sd->bridge = BRIDGE_SN9C120;
782 sd->sensor = SENSOR_MI0360; 781 sd->sensor = SENSOR_MI0360;
783 sd->i2c_ctrl_reg = 0x81;
784 sd->i2c_base = 0x5d; 782 sd->i2c_base = 0x5d;
785/* break; 783/* break;
786 } */ 784 } */
@@ -789,9 +787,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
789/* switch (product) { 787/* switch (product) {
790 case 0x00f5: 788 case 0x00f5:
791 case 0x00f7: */ 789 case 0x00f7: */
792 sd->customid = SN9C105; 790 sd->bridge = BRIDGE_SN9C105;
793 sd->sensor = SENSOR_OV7660; 791 sd->sensor = SENSOR_OV7660;
794 sd->i2c_ctrl_reg = 0x81;
795 sd->i2c_base = 0x21; 792 sd->i2c_base = 0x21;
796/* break; 793/* break;
797 } */ 794 } */
@@ -801,9 +798,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
801 case 0x0327: 798 case 0x0327:
802 case 0x0328: 799 case 0x0328:
803 case 0x0330: */ 800 case 0x0330: */
804 sd->customid = SN9C105; 801 sd->bridge = BRIDGE_SN9C105;
805 sd->sensor = SENSOR_MI0360; 802 sd->sensor = SENSOR_MI0360;
806 sd->i2c_ctrl_reg = 0x81;
807 sd->i2c_base = 0x5d; 803 sd->i2c_base = 0x5d;
808/* break; 804/* break;
809 } */ 805 } */
@@ -811,161 +807,135 @@ static int sd_config(struct gspca_dev *gspca_dev,
811 case 0x0c45: /* Sonix */ 807 case 0x0c45: /* Sonix */
812 switch (product) { 808 switch (product) {
813 case 0x6040: 809 case 0x6040:
814 sd->customid = SN9C102P; 810 sd->bridge = BRIDGE_SN9C102P;
815 sd->sensor = SENSOR_MI0360; /* from BW600.inf */ 811 sd->sensor = SENSOR_MI0360; /* from BW600.inf */
816/* sd->sensor = SENSOR_HV7131R; * gspcav1 value */ 812/* sd->sensor = SENSOR_HV7131R; * gspcav1 value */
817 sd->i2c_ctrl_reg = 0x81;
818 sd->i2c_base = 0x11; 813 sd->i2c_base = 0x11;
819 break; 814 break;
820/* case 0x607a: * from BW600.inf 815/* case 0x607a: * from BW600.inf
821 sd->customid = SN9C102P; 816 sd->bridge = BRIDGE_SN9C102P;
822 sd->sensor = SENSOR_OV7648; 817 sd->sensor = SENSOR_OV7648;
823 sd->i2c_ctrl_reg = 0x??;
824 sd->i2c_base = 0x??; 818 sd->i2c_base = 0x??;
825 break; */ 819 break; */
826 case 0x607c: 820 case 0x607c:
827 sd->customid = SN9C102P; 821 sd->bridge = BRIDGE_SN9C102P;
828 sd->sensor = SENSOR_HV7131R; 822 sd->sensor = SENSOR_HV7131R;
829 sd->i2c_ctrl_reg = 0x81;
830 sd->i2c_base = 0x11; 823 sd->i2c_base = 0x11;
831 break; 824 break;
832/* case 0x607e: * from BW600.inf 825/* case 0x607e: * from BW600.inf
833 sd->customid = SN9C102P; 826 sd->bridge = BRIDGE_SN9C102P;
834 sd->sensor = SENSOR_OV7630; 827 sd->sensor = SENSOR_OV7630;
835 sd->i2c_ctrl_reg = 0x??;
836 sd->i2c_base = 0x??; 828 sd->i2c_base = 0x??;
837 break; */ 829 break; */
838 case 0x60c0: 830 case 0x60c0:
839 sd->customid = SN9C105; 831 sd->bridge = BRIDGE_SN9C105;
840 sd->sensor = SENSOR_MI0360; 832 sd->sensor = SENSOR_MI0360;
841 sd->i2c_ctrl_reg = 0x81;
842 sd->i2c_base = 0x5d; 833 sd->i2c_base = 0x5d;
843 break; 834 break;
844/* case 0x60c8: * from BW600.inf 835/* case 0x60c8: * from BW600.inf
845 sd->customid = SN9C105; 836 sd->bridge = BRIDGE_SN9C105;
846 sd->sensor = SENSOR_OM6801; 837 sd->sensor = SENSOR_OM6801;
847 sd->i2c_ctrl_reg = 0x??;
848 sd->i2c_base = 0x??; 838 sd->i2c_base = 0x??;
849 break; */ 839 break; */
850/* case 0x60cc: * from BW600.inf 840/* case 0x60cc: * from BW600.inf
851 sd->customid = SN9C105; 841 sd->bridge = BRIDGE_SN9C105;
852 sd->sensor = SENSOR_HV7131GP; 842 sd->sensor = SENSOR_HV7131GP;
853 sd->i2c_ctrl_reg = 0x??;
854 sd->i2c_base = 0x??; 843 sd->i2c_base = 0x??;
855 break; */ 844 break; */
856 case 0x60ec: 845 case 0x60ec:
857 sd->customid = SN9C105; 846 sd->bridge = BRIDGE_SN9C105;
858 sd->sensor = SENSOR_MO4000; 847 sd->sensor = SENSOR_MO4000;
859 sd->i2c_ctrl_reg = 0x81;
860 sd->i2c_base = 0x21; 848 sd->i2c_base = 0x21;
861 break; 849 break;
862/* case 0x60ef: * from BW600.inf 850/* case 0x60ef: * from BW600.inf
863 sd->customid = SN9C105; 851 sd->bridge = BRIDGE_SN9C105;
864 sd->sensor = SENSOR_ICM105C; 852 sd->sensor = SENSOR_ICM105C;
865 sd->i2c_ctrl_reg = 0x??;
866 sd->i2c_base = 0x??; 853 sd->i2c_base = 0x??;
867 break; */ 854 break; */
868/* case 0x60fa: * from BW600.inf 855/* case 0x60fa: * from BW600.inf
869 sd->customid = SN9C105; 856 sd->bridge = BRIDGE_SN9C105;
870 sd->sensor = SENSOR_OV7648; 857 sd->sensor = SENSOR_OV7648;
871 sd->i2c_ctrl_reg = 0x??;
872 sd->i2c_base = 0x??; 858 sd->i2c_base = 0x??;
873 break; */ 859 break; */
874 case 0x60fb: 860 case 0x60fb:
875 sd->customid = SN9C105; 861 sd->bridge = BRIDGE_SN9C105;
876 sd->sensor = SENSOR_OV7660; 862 sd->sensor = SENSOR_OV7660;
877 sd->i2c_ctrl_reg = 0x81;
878 sd->i2c_base = 0x21; 863 sd->i2c_base = 0x21;
879 break; 864 break;
880 case 0x60fc: 865 case 0x60fc:
881 sd->customid = SN9C105; 866 sd->bridge = BRIDGE_SN9C105;
882 sd->sensor = SENSOR_HV7131R; 867 sd->sensor = SENSOR_HV7131R;
883 sd->i2c_ctrl_reg = 0x81;
884 sd->i2c_base = 0x11; 868 sd->i2c_base = 0x11;
885 break; 869 break;
886/* case 0x60fe: * from BW600.inf 870/* case 0x60fe: * from BW600.inf
887 sd->customid = SN9C105; 871 sd->bridge = BRIDGE_SN9C105;
888 sd->sensor = SENSOR_OV7630; 872 sd->sensor = SENSOR_OV7630;
889 sd->i2c_ctrl_reg = 0x??;
890 sd->i2c_base = 0x??; 873 sd->i2c_base = 0x??;
891 break; */ 874 break; */
892/* case 0x6108: * from BW600.inf 875/* case 0x6108: * from BW600.inf
893 sd->customid = SN9C120; 876 sd->bridge = BRIDGE_SN9C120;
894 sd->sensor = SENSOR_OM6801; 877 sd->sensor = SENSOR_OM6801;
895 sd->i2c_ctrl_reg = 0x??;
896 sd->i2c_base = 0x??; 878 sd->i2c_base = 0x??;
897 break; */ 879 break; */
898/* case 0x6122: * from BW600.inf 880/* case 0x6122: * from BW600.inf
899 sd->customid = SN9C110; 881 sd->bridge = BRIDGE_SN9C110;
900 sd->sensor = SENSOR_ICM105C; 882 sd->sensor = SENSOR_ICM105C;
901 sd->i2c_ctrl_reg = 0x??;
902 sd->i2c_base = 0x??; 883 sd->i2c_base = 0x??;
903 break; */ 884 break; */
904 case 0x612a: 885 case 0x612a:
905/* sd->customid = SN9C110; * in BW600.inf */ 886/* sd->bridge = BRIDGE_SN9C110; * in BW600.inf */
906 sd->customid = SN9C325; 887 sd->bridge = BRIDGE_SN9C325;
907 sd->sensor = SENSOR_OV7648; 888 sd->sensor = SENSOR_OV7648;
908 sd->i2c_ctrl_reg = 0x81;
909 sd->i2c_base = 0x21; 889 sd->i2c_base = 0x21;
910 break; 890 break;
911/* case 0x6123: * from BW600.inf 891/* case 0x6123: * from BW600.inf
912 sd->customid = SN9C110; 892 sd->bridge = BRIDGE_SN9C110;
913 sd->sensor = SENSOR_SanyoCCD; 893 sd->sensor = SENSOR_SanyoCCD;
914 sd->i2c_ctrl_reg = 0x??;
915 sd->i2c_base = 0x??; 894 sd->i2c_base = 0x??;
916 break; */ 895 break; */
917 case 0x612c: 896 case 0x612c:
918 sd->customid = SN9C110; 897 sd->bridge = BRIDGE_SN9C110;
919 sd->sensor = SENSOR_MO4000; 898 sd->sensor = SENSOR_MO4000;
920 sd->i2c_ctrl_reg = 0x81;
921 sd->i2c_base = 0x21; 899 sd->i2c_base = 0x21;
922 break; 900 break;
923/* case 0x612e: * from BW600.inf 901/* case 0x612e: * from BW600.inf
924 sd->customid = SN9C110; 902 sd->bridge = BRIDGE_SN9C110;
925 sd->sensor = SENSOR_OV7630; 903 sd->sensor = SENSOR_OV7630;
926 sd->i2c_ctrl_reg = 0x??;
927 sd->i2c_base = 0x??; 904 sd->i2c_base = 0x??;
928 break; */ 905 break; */
929/* case 0x612f: * from BW600.inf 906/* case 0x612f: * from BW600.inf
930 sd->customid = SN9C110; 907 sd->bridge = BRIDGE_SN9C110;
931 sd->sensor = SENSOR_ICM105C; 908 sd->sensor = SENSOR_ICM105C;
932 sd->i2c_ctrl_reg = 0x??;
933 sd->i2c_base = 0x??; 909 sd->i2c_base = 0x??;
934 break; */ 910 break; */
935 case 0x6130: 911 case 0x6130:
936 sd->customid = SN9C120; 912 sd->bridge = BRIDGE_SN9C120;
937 sd->sensor = SENSOR_MI0360; 913 sd->sensor = SENSOR_MI0360;
938 sd->i2c_ctrl_reg = 0x81;
939 sd->i2c_base = 0x5d; 914 sd->i2c_base = 0x5d;
940 break; 915 break;
941 case 0x6138: 916 case 0x6138:
942 sd->customid = SN9C120; 917 sd->bridge = BRIDGE_SN9C120;
943 sd->sensor = SENSOR_MO4000; 918 sd->sensor = SENSOR_MO4000;
944 sd->i2c_ctrl_reg = 0x81;
945 sd->i2c_base = 0x21; 919 sd->i2c_base = 0x21;
946 break; 920 break;
947/* case 0x613a: * from BW600.inf 921/* case 0x613a: * from BW600.inf
948 sd->customid = SN9C120; 922 sd->bridge = BRIDGE_SN9C120;
949 sd->sensor = SENSOR_OV7648; 923 sd->sensor = SENSOR_OV7648;
950 sd->i2c_ctrl_reg = 0x??;
951 sd->i2c_base = 0x??; 924 sd->i2c_base = 0x??;
952 break; */ 925 break; */
953 case 0x613b: 926 case 0x613b:
954 sd->customid = SN9C120; 927 sd->bridge = BRIDGE_SN9C120;
955 sd->sensor = SENSOR_OV7660; 928 sd->sensor = SENSOR_OV7660;
956 sd->i2c_ctrl_reg = 0x81;
957 sd->i2c_base = 0x21; 929 sd->i2c_base = 0x21;
958 break; 930 break;
959 case 0x613c: 931 case 0x613c:
960 sd->customid = SN9C120; 932 sd->bridge = BRIDGE_SN9C120;
961 sd->sensor = SENSOR_HV7131R; 933 sd->sensor = SENSOR_HV7131R;
962 sd->i2c_ctrl_reg = 0x81;
963 sd->i2c_base = 0x11; 934 sd->i2c_base = 0x11;
964 break; 935 break;
965/* case 0x613e: * from BW600.inf 936/* case 0x613e: * from BW600.inf
966 sd->customid = SN9C120; 937 sd->bridge = BRIDGE_SN9C120;
967 sd->sensor = SENSOR_OV7630; 938 sd->sensor = SENSOR_OV7630;
968 sd->i2c_ctrl_reg = 0x??;
969 sd->i2c_base = 0x??; 939 sd->i2c_base = 0x??;
970 break; */ 940 break; */
971 } 941 }
@@ -999,7 +969,7 @@ static int sd_open(struct gspca_dev *gspca_dev)
999 __u8 regF1; 969 __u8 regF1;
1000 __u8 regGpio[] = { 0x29, 0x74 }; 970 __u8 regGpio[] = { 0x29, 0x74 };
1001 971
1002 /* setup a selector by customid */ 972 /* setup a selector by bridge */
1003 regF1 = 0x01; 973 regF1 = 0x01;
1004 reg_w(gspca_dev, 0xf1, &regF1, 1); 974 reg_w(gspca_dev, 0xf1, &regF1, 1);
1005 reg_r(gspca_dev, 0x00, 1); /* -> regF1 = 0x00 */ 975 reg_r(gspca_dev, 0x00, 1); /* -> regF1 = 0x00 */
@@ -1007,31 +977,31 @@ static int sd_open(struct gspca_dev *gspca_dev)
1007 reg_w(gspca_dev, 0xf1, &regF1, 1); 977 reg_w(gspca_dev, 0xf1, &regF1, 1);
1008 reg_r(gspca_dev, 0x00, 1); 978 reg_r(gspca_dev, 0x00, 1);
1009 regF1 = gspca_dev->usb_buf[0]; 979 regF1 = gspca_dev->usb_buf[0];
1010 switch (sd->customid) { 980 switch (sd->bridge) {
1011 case SN9C102P: 981 case BRIDGE_SN9C102P:
1012 if (regF1 != 0x11) 982 if (regF1 != 0x11)
1013 return -ENODEV; 983 return -ENODEV;
1014 reg_w(gspca_dev, 0x02, &regGpio[1], 1); 984 reg_w(gspca_dev, 0x02, &regGpio[1], 1);
1015 break; 985 break;
1016 case SN9C105: 986 case BRIDGE_SN9C105:
1017 if (regF1 != 0x11) 987 if (regF1 != 0x11)
1018 return -ENODEV; 988 return -ENODEV;
1019 reg_w(gspca_dev, 0x02, regGpio, 2); 989 reg_w(gspca_dev, 0x02, regGpio, 2);
1020 break; 990 break;
1021 case SN9C110: 991 case BRIDGE_SN9C110:
1022 if (regF1 != 0x12) 992 if (regF1 != 0x12)
1023 return -ENODEV; 993 return -ENODEV;
1024 regGpio[1] = 0x62; 994 regGpio[1] = 0x62;
1025 reg_w(gspca_dev, 0x02, &regGpio[1], 1); 995 reg_w(gspca_dev, 0x02, &regGpio[1], 1);
1026 break; 996 break;
1027 case SN9C120: 997 case BRIDGE_SN9C120:
1028 if (regF1 != 0x12) 998 if (regF1 != 0x12)
1029 return -ENODEV; 999 return -ENODEV;
1030 regGpio[1] = 0x70; 1000 regGpio[1] = 0x70;
1031 reg_w(gspca_dev, 0x02, regGpio, 2); 1001 reg_w(gspca_dev, 0x02, regGpio, 2);
1032 break; 1002 break;
1033 default: 1003 default:
1034/* case SN9C325: */ 1004/* case BRIDGE_SN9C325: */
1035 if (regF1 != 0x12) 1005 if (regF1 != 0x12)
1036 return -ENODEV; 1006 return -ENODEV;
1037 regGpio[1] = 0x62; 1007 regGpio[1] = 0x62;
@@ -1207,7 +1177,7 @@ static void sd_start(struct gspca_dev *gspca_dev)
1207 reg_w(gspca_dev, 0xc9, &DC29[5], 1); 1177 reg_w(gspca_dev, 0xc9, &DC29[5], 1);
1208/*fixme:jfm end of ending sequence */ 1178/*fixme:jfm end of ending sequence */
1209 reg_w(gspca_dev, 0x18, &sn9c1xx[0x18], 1); 1179 reg_w(gspca_dev, 0x18, &sn9c1xx[0x18], 1);
1210 if (sd->customid == SN9C325) 1180 if (sd->bridge == BRIDGE_SN9C325)
1211 data = 0xae; 1181 data = 0xae;
1212 else 1182 else
1213 data = 0x60; 1183 data = 0x60;
@@ -1216,7 +1186,7 @@ static void sd_start(struct gspca_dev *gspca_dev)
1216 reg_w(gspca_dev, 0x07, &sn9c1xx[7], 1); 1186 reg_w(gspca_dev, 0x07, &sn9c1xx[7], 1);
1217 reg_w(gspca_dev, 0x06, &sn9c1xx[6], 1); 1187 reg_w(gspca_dev, 0x06, &sn9c1xx[6], 1);
1218 reg_w(gspca_dev, 0x14, &sn9c1xx[0x14], 1); 1188 reg_w(gspca_dev, 0x14, &sn9c1xx[0x14], 1);
1219 if (sd->customid == SN9C325) { 1189 if (sd->bridge == BRIDGE_SN9C325) {
1220 reg_w(gspca_dev, 0x20, regsn20_sn9c325, 0x11); 1190 reg_w(gspca_dev, 0x20, regsn20_sn9c325, 0x11);
1221 for (i = 0; i < 8; i++) 1191 for (i = 0; i < 8; i++)
1222 reg_w(gspca_dev, 0x84, reg84_sn9c325, 0x15); 1192 reg_w(gspca_dev, 0x84, reg84_sn9c325, 0x15);
@@ -1285,17 +1255,17 @@ static void sd_start(struct gspca_dev *gspca_dev)
1285 break; 1255 break;
1286 } 1256 }
1287 reg_w(gspca_dev, 0xc0, C0, 6); 1257 reg_w(gspca_dev, 0xc0, C0, 6);
1288 switch (sd->customid) { 1258 switch (sd->bridge) {
1289 case SN9C120: /*jfm ?? */ 1259 case BRIDGE_SN9C120: /*jfm ?? */
1290 reg_w(gspca_dev, 0xca, CA_sn9c120, 4); 1260 reg_w(gspca_dev, 0xca, CA_sn9c120, 4);
1291 break; 1261 break;
1292 default: 1262 default:
1293 reg_w(gspca_dev, 0xca, CA, 4); 1263 reg_w(gspca_dev, 0xca, CA, 4);
1294 break; 1264 break;
1295 } 1265 }
1296 switch (sd->customid) { 1266 switch (sd->bridge) {
1297 case SN9C120: /*jfm ?? */ 1267 case BRIDGE_SN9C120: /*jfm ?? */
1298 case SN9C325: 1268 case BRIDGE_SN9C325:
1299 reg_w(gspca_dev, 0xce, CE_sn9c325, 4); 1269 reg_w(gspca_dev, 0xce, CE_sn9c325, 4);
1300 break; 1270 break;
1301 default: 1271 default: