diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-11-02 07:54:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:41:17 -0500 |
commit | 3fccb774ef6e43c2d80d322a5b52564db3067ef8 (patch) | |
tree | aea4d486601c383e6be299c28ba599d8377ad840 /drivers | |
parent | a782636c26b7468345d2c3b67952bf695a39cdfa (diff) |
V4L/DVB (13303): gspca - sonixj: Change sensor and om6802 exchanges.
- the sensors are now initialized sooner
- om6802:
. set some parameters in factory mode
. lack of some parameters
. gpio adjustments
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 110 |
1 files changed, 90 insertions, 20 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 159f9f7be307..c1b6c9565584 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -574,7 +574,9 @@ static const u8 mt9v111_sensor_init[][8] = { | |||
574 | {0xb1, 0x5c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x10}, /* digital zoom */ | 574 | {0xb1, 0x5c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x10}, /* digital zoom */ |
575 | {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, /* read mode */ | 575 | {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, /* read mode */ |
576 | {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, | 576 | {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, |
577 | /*******/ | 577 | {} |
578 | }; | ||
579 | static const u8 mt9v111_sensor_param1[][8] = { | ||
578 | {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, | 580 | {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, |
579 | {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, | 581 | {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10}, |
580 | {0xb1, 0x5c, 0x09, 0x01, 0x2c, 0x00, 0x00, 0x10}, | 582 | {0xb1, 0x5c, 0x09, 0x01, 0x2c, 0x00, 0x00, 0x10}, |
@@ -587,11 +589,16 @@ static const u8 mt9v111_sensor_init[][8] = { | |||
587 | {0xb1, 0x5c, 0x35, 0x01, 0xc0, 0x00, 0x00, 0x10}, /* global gain */ | 589 | {0xb1, 0x5c, 0x35, 0x01, 0xc0, 0x00, 0x00, 0x10}, /* global gain */ |
588 | {} | 590 | {} |
589 | }; | 591 | }; |
592 | static const u8 om6802_init0[2][8] = { | ||
593 | /*fixme: variable*/ | ||
594 | {0xa0, 0x34, 0x29, 0x0e, 0x00, 0x00, 0x00, 0x10}, | ||
595 | {0xa0, 0x34, 0x23, 0xb0, 0x00, 0x00, 0x00, 0x10}, | ||
596 | }; | ||
590 | static const u8 om6802_sensor_init[][8] = { | 597 | static const u8 om6802_sensor_init[][8] = { |
591 | {0xa0, 0x34, 0x90, 0x05, 0x00, 0x00, 0x00, 0x10}, | 598 | {0xa0, 0x34, 0xdf, 0x6d, 0x00, 0x00, 0x00, 0x10}, |
592 | {0xa0, 0x34, 0x49, 0x85, 0x00, 0x00, 0x00, 0x10}, | 599 | /* factory mode */ |
593 | {0xa0, 0x34, 0x5a, 0xc0, 0x00, 0x00, 0x00, 0x10}, | ||
594 | {0xa0, 0x34, 0xdd, 0x18, 0x00, 0x00, 0x00, 0x10}, | 600 | {0xa0, 0x34, 0xdd, 0x18, 0x00, 0x00, 0x00, 0x10}, |
601 | {0xa0, 0x34, 0x5a, 0xc0, 0x00, 0x00, 0x00, 0x10}, | ||
595 | /* {0xa0, 0x34, 0xfb, 0x11, 0x00, 0x00, 0x00, 0x10}, */ | 602 | /* {0xa0, 0x34, 0xfb, 0x11, 0x00, 0x00, 0x00, 0x10}, */ |
596 | {0xa0, 0x34, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x10}, | 603 | {0xa0, 0x34, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x10}, |
597 | /* white balance & auto-exposure */ | 604 | /* white balance & auto-exposure */ |
@@ -614,11 +621,14 @@ static const u8 om6802_sensor_init[][8] = { | |||
614 | /* {0xa0, 0x34, 0xef, 0x00, 0x00, 0x00, 0x00, 0x10}, | 621 | /* {0xa0, 0x34, 0xef, 0x00, 0x00, 0x00, 0x00, 0x10}, |
615 | * auto frame rate */ | 622 | * auto frame rate */ |
616 | /* {0xa0, 0x34, 0xfb, 0xee, 0x00, 0x00, 0x00, 0x10}, */ | 623 | /* {0xa0, 0x34, 0xfb, 0xee, 0x00, 0x00, 0x00, 0x10}, */ |
617 | 624 | {0xa0, 0x34, 0x5d, 0x80, 0x00, 0x00, 0x00, 0x10}, | |
618 | /* {0xa0, 0x34, 0x71, 0x84, 0x00, 0x00, 0x00, 0x10}, */ | 625 | {} |
619 | /* {0xa0, 0x34, 0x72, 0x05, 0x00, 0x00, 0x00, 0x10}, */ | 626 | }; |
620 | /* {0xa0, 0x34, 0x68, 0x80, 0x00, 0x00, 0x00, 0x10}, */ | 627 | static const u8 om6802_sensor_param1[][8] = { |
621 | /* {0xa0, 0x34, 0x69, 0x01, 0x00, 0x00, 0x00, 0x10}, */ | 628 | {0xa0, 0x34, 0x71, 0x84, 0x00, 0x00, 0x00, 0x10}, |
629 | {0xa0, 0x34, 0x72, 0x05, 0x00, 0x00, 0x00, 0x10}, | ||
630 | {0xa0, 0x34, 0x68, 0x80, 0x00, 0x00, 0x00, 0x10}, | ||
631 | {0xa0, 0x34, 0x69, 0x01, 0x00, 0x00, 0x00, 0x10}, | ||
622 | {} | 632 | {} |
623 | }; | 633 | }; |
624 | static const u8 ov7630_sensor_init[][8] = { | 634 | static const u8 ov7630_sensor_init[][8] = { |
@@ -704,7 +714,9 @@ static const u8 ov7648_sensor_init[][8] = { | |||
704 | /* {0xd1, 0x21, 0x25, 0x80, 0x32, 0xfe, 0xa0, 0x10}, jfm done */ | 714 | /* {0xd1, 0x21, 0x25, 0x80, 0x32, 0xfe, 0xa0, 0x10}, jfm done */ |
705 | /* {0xd1, 0x21, 0x29, 0x00, 0x91, 0x00, 0x88, 0x10}, jfm done */ | 715 | /* {0xd1, 0x21, 0x29, 0x00, 0x91, 0x00, 0x88, 0x10}, jfm done */ |
706 | /* {0xb1, 0x21, 0x2d, 0x85, 0x00, 0x00, 0x00, 0x10}, set by setfreq */ | 716 | /* {0xb1, 0x21, 0x2d, 0x85, 0x00, 0x00, 0x00, 0x10}, set by setfreq */ |
707 | /*...*/ | 717 | {} |
718 | }; | ||
719 | static const u8 ov7648_sensor_param1[][8] = { | ||
708 | /* {0xa1, 0x21, 0x12, 0x08, 0x00, 0x00, 0x00, 0x10}, jfm done */ | 720 | /* {0xa1, 0x21, 0x12, 0x08, 0x00, 0x00, 0x00, 0x10}, jfm done */ |
709 | /* {0xa1, 0x21, 0x75, 0x06, 0x00, 0x00, 0x00, 0x10}, * COMN | 721 | /* {0xa1, 0x21, 0x75, 0x06, 0x00, 0x00, 0x00, 0x10}, * COMN |
710 | * set by setvflip */ | 722 | * set by setvflip */ |
@@ -786,8 +798,11 @@ static const u8 ov7660_sensor_init[][8] = { | |||
786 | {0xc1, 0x21, 0x88, 0xaf, 0xc7, 0xdf, 0x00, 0x10}, /* gamma curve */ | 798 | {0xc1, 0x21, 0x88, 0xaf, 0xc7, 0xdf, 0x00, 0x10}, /* gamma curve */ |
787 | {0xc1, 0x21, 0x8b, 0x99, 0x99, 0xcf, 0x00, 0x10}, /* reserved */ | 799 | {0xc1, 0x21, 0x8b, 0x99, 0x99, 0xcf, 0x00, 0x10}, /* reserved */ |
788 | {0xb1, 0x21, 0x92, 0x00, 0x00, 0x00, 0x00, 0x10}, /* DM_LNL/H */ | 800 | {0xb1, 0x21, 0x92, 0x00, 0x00, 0x00, 0x00, 0x10}, /* DM_LNL/H */ |
801 | /* not in all ms-win traces*/ | ||
789 | {0xa1, 0x21, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x10}, | 802 | {0xa1, 0x21, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x10}, |
790 | /****** (some exchanges in the win trace) ******/ | 803 | {} |
804 | }; | ||
805 | static const u8 ov7660_sensor_param1[][8] = { | ||
791 | {0xa1, 0x21, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x10}, /* MVFP */ | 806 | {0xa1, 0x21, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x10}, /* MVFP */ |
792 | /* bits[3..0]reserved */ | 807 | /* bits[3..0]reserved */ |
793 | {0xa1, 0x21, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x10}, | 808 | {0xa1, 0x21, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x10}, |
@@ -800,6 +815,7 @@ static const u8 ov7660_sensor_init[][8] = { | |||
800 | {0xa1, 0x21, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x10}, /* GAIN */ | 815 | {0xa1, 0x21, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x10}, /* GAIN */ |
801 | /* {0xb1, 0x21, 0x01, 0x78, 0x78, 0x00, 0x00, 0x10}, * BLUE */ | 816 | /* {0xb1, 0x21, 0x01, 0x78, 0x78, 0x00, 0x00, 0x10}, * BLUE */ |
802 | /****** (some exchanges in the win trace) ******/ | 817 | /****** (some exchanges in the win trace) ******/ |
818 | /*fixme:param2*/ | ||
803 | {0xa1, 0x21, 0x93, 0x00, 0x00, 0x00, 0x00, 0x10},/* dummy line hight */ | 819 | {0xa1, 0x21, 0x93, 0x00, 0x00, 0x00, 0x00, 0x10},/* dummy line hight */ |
804 | {0xa1, 0x21, 0x92, 0x25, 0x00, 0x00, 0x00, 0x10}, /* dummy line low */ | 820 | {0xa1, 0x21, 0x92, 0x25, 0x00, 0x00, 0x00, 0x10}, /* dummy line low */ |
805 | {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10}, /* EXHCH */ | 821 | {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10}, /* EXHCH */ |
@@ -807,6 +823,7 @@ static const u8 ov7660_sensor_init[][8] = { | |||
807 | /* {0xa1, 0x21, 0x02, 0x90, 0x00, 0x00, 0x00, 0x10}, * RED */ | 823 | /* {0xa1, 0x21, 0x02, 0x90, 0x00, 0x00, 0x00, 0x10}, * RED */ |
808 | /****** (some exchanges in the win trace) ******/ | 824 | /****** (some exchanges in the win trace) ******/ |
809 | /******!! startsensor KO if changed !!****/ | 825 | /******!! startsensor KO if changed !!****/ |
826 | /*fixme: param3*/ | ||
810 | {0xa1, 0x21, 0x93, 0x01, 0x00, 0x00, 0x00, 0x10}, | 827 | {0xa1, 0x21, 0x93, 0x01, 0x00, 0x00, 0x00, 0x10}, |
811 | {0xa1, 0x21, 0x92, 0xff, 0x00, 0x00, 0x00, 0x10}, | 828 | {0xa1, 0x21, 0x92, 0xff, 0x00, 0x00, 0x00, 0x10}, |
812 | {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10}, | 829 | {0xa1, 0x21, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x10}, |
@@ -886,7 +903,9 @@ static const u8 sp80708_sensor_init[][8] = { | |||
886 | {0xa1, 0x18, 0x67, 0x24, 0x00, 0x00, 0x00, 0x10}, | 903 | {0xa1, 0x18, 0x67, 0x24, 0x00, 0x00, 0x00, 0x10}, |
887 | {0xa1, 0x18, 0x68, 0x08, 0x00, 0x00, 0x00, 0x10}, | 904 | {0xa1, 0x18, 0x68, 0x08, 0x00, 0x00, 0x00, 0x10}, |
888 | {0xa1, 0x18, 0x2f, 0xc9, 0x00, 0x00, 0x00, 0x10}, | 905 | {0xa1, 0x18, 0x2f, 0xc9, 0x00, 0x00, 0x00, 0x10}, |
889 | /********/ | 906 | {} |
907 | }; | ||
908 | static const u8 sp80708_sensor_param1[][8] = { | ||
890 | {0xa1, 0x18, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x10}, | 909 | {0xa1, 0x18, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x10}, |
891 | {0xa1, 0x18, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x10}, | 910 | {0xa1, 0x18, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x10}, |
892 | {0xa1, 0x18, 0x03, 0x01, 0x00, 0x00, 0x00, 0x10}, | 911 | {0xa1, 0x18, 0x03, 0x01, 0x00, 0x00, 0x00, 0x10}, |
@@ -1125,7 +1144,7 @@ static void mi0360_probe(struct gspca_dev *gspca_dev) | |||
1125 | } | 1144 | } |
1126 | } | 1145 | } |
1127 | 1146 | ||
1128 | static void configure_gpio(struct gspca_dev *gspca_dev, | 1147 | static void bridge_init(struct gspca_dev *gspca_dev, |
1129 | const u8 *sn9c1xx) | 1148 | const u8 *sn9c1xx) |
1130 | { | 1149 | { |
1131 | struct sd *sd = (struct sd *) gspca_dev; | 1150 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -1166,10 +1185,22 @@ static void configure_gpio(struct gspca_dev *gspca_dev, | |||
1166 | reg_w1(gspca_dev, 0x01, 0x40); | 1185 | reg_w1(gspca_dev, 0x01, 0x40); |
1167 | break; | 1186 | break; |
1168 | case SENSOR_OM6802: | 1187 | case SENSOR_OM6802: |
1169 | reg_w1(gspca_dev, 0x02, 0x71); | 1188 | msleep(10); |
1170 | reg_w1(gspca_dev, 0x01, 0x42); | 1189 | reg_w1(gspca_dev, 0x02, 0x73); |
1190 | reg_w1(gspca_dev, 0x17, 0x60); | ||
1191 | reg_w1(gspca_dev, 0x01, 0x22); | ||
1192 | msleep(100); | ||
1193 | reg_w1(gspca_dev, 0x01, 0x62); | ||
1194 | reg_w1(gspca_dev, 0x17, 0x64); | ||
1171 | reg_w1(gspca_dev, 0x17, 0x64); | 1195 | reg_w1(gspca_dev, 0x17, 0x64); |
1172 | reg_w1(gspca_dev, 0x01, 0x42); | 1196 | reg_w1(gspca_dev, 0x01, 0x42); |
1197 | msleep(10); | ||
1198 | reg_w1(gspca_dev, 0x01, 0x42); | ||
1199 | i2c_w8(gspca_dev, om6802_init0[0]); | ||
1200 | i2c_w8(gspca_dev, om6802_init0[1]); | ||
1201 | msleep(15); | ||
1202 | reg_w1(gspca_dev, 0x02, 0x71); | ||
1203 | msleep(150); | ||
1173 | break; | 1204 | break; |
1174 | case SENSOR_OV7630: | 1205 | case SENSOR_OV7630: |
1175 | reg_w1(gspca_dev, 0x01, 0x61); | 1206 | reg_w1(gspca_dev, 0x01, 0x61); |
@@ -1639,8 +1670,9 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1639 | { | 1670 | { |
1640 | struct sd *sd = (struct sd *) gspca_dev; | 1671 | struct sd *sd = (struct sd *) gspca_dev; |
1641 | int i; | 1672 | int i; |
1642 | u8 reg1, reg17; | 1673 | u8 reg1, reg2, reg17; |
1643 | const u8 *sn9c1xx; | 1674 | const u8 *sn9c1xx; |
1675 | const u8 (*init)[8]; | ||
1644 | int mode; | 1676 | int mode; |
1645 | static const u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; | 1677 | static const u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; |
1646 | static const u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; | 1678 | static const u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; |
@@ -1656,8 +1688,25 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1656 | 0x21); /* JPEG 422 */ | 1688 | 0x21); /* JPEG 422 */ |
1657 | jpeg_set_qual(sd->jpeg_hdr, sd->quality); | 1689 | jpeg_set_qual(sd->jpeg_hdr, sd->quality); |
1658 | 1690 | ||
1659 | sn9c1xx = sn_tb[(int) sd->sensor]; | 1691 | /* initialize the bridge */ |
1660 | configure_gpio(gspca_dev, sn9c1xx); | 1692 | sn9c1xx = sn_tb[sd->sensor]; |
1693 | bridge_init(gspca_dev, sn9c1xx); | ||
1694 | /* initialize the sensor */ | ||
1695 | i2c_w_seq(gspca_dev, sensor_init[sd->sensor]); | ||
1696 | |||
1697 | switch (sd->sensor) { | ||
1698 | case SENSOR_OM6802: | ||
1699 | reg2 = 0x71; | ||
1700 | break; | ||
1701 | case SENSOR_SP80708: | ||
1702 | reg2 = 0x62; | ||
1703 | break; | ||
1704 | default: | ||
1705 | reg2 = 0x40; | ||
1706 | break; | ||
1707 | } | ||
1708 | reg_w1(gspca_dev, 0x02, reg2); | ||
1709 | reg_w1(gspca_dev, 0x02, reg2); | ||
1661 | 1710 | ||
1662 | reg_w1(gspca_dev, 0x15, sn9c1xx[0x15]); | 1711 | reg_w1(gspca_dev, 0x15, sn9c1xx[0x15]); |
1663 | reg_w1(gspca_dev, 0x16, sn9c1xx[0x16]); | 1712 | reg_w1(gspca_dev, 0x16, sn9c1xx[0x16]); |
@@ -1704,6 +1753,10 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1704 | reg_w1(gspca_dev, 0x9a, 0x07); | 1753 | reg_w1(gspca_dev, 0x9a, 0x07); |
1705 | reg_w1(gspca_dev, 0x99, 0x59); | 1754 | reg_w1(gspca_dev, 0x99, 0x59); |
1706 | break; | 1755 | break; |
1756 | case SENSOR_OM6802: | ||
1757 | reg_w1(gspca_dev, 0x9a, 0x08); | ||
1758 | reg_w1(gspca_dev, 0x99, 0x10); | ||
1759 | break; | ||
1707 | case SENSOR_OV7648: | 1760 | case SENSOR_OV7648: |
1708 | reg_w1(gspca_dev, 0x9a, 0x0a); | 1761 | reg_w1(gspca_dev, 0x9a, 0x0a); |
1709 | reg_w1(gspca_dev, 0x99, 0x60); | 1762 | reg_w1(gspca_dev, 0x99, 0x60); |
@@ -1719,9 +1772,12 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1719 | break; | 1772 | break; |
1720 | } | 1773 | } |
1721 | 1774 | ||
1722 | /* initialize the sensor */ | 1775 | reg_w(gspca_dev, 0x84, reg84, sizeof reg84); |
1723 | i2c_w_seq(gspca_dev, sensor_init[sd->sensor]); | 1776 | reg_w1(gspca_dev, 0x05, sn9c1xx[5]); /* red */ |
1777 | reg_w1(gspca_dev, 0x07, sn9c1xx[7]); /* green */ | ||
1778 | reg_w1(gspca_dev, 0x06, sn9c1xx[6]); /* blue */ | ||
1724 | 1779 | ||
1780 | init = NULL; | ||
1725 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; | 1781 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; |
1726 | if (mode) | 1782 | if (mode) |
1727 | reg1 = 0x46; /* 320x240: clk 48Mhz, video trf enable */ | 1783 | reg1 = 0x46; /* 320x240: clk 48Mhz, video trf enable */ |
@@ -1739,6 +1795,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1739 | } | 1795 | } |
1740 | break; | 1796 | break; |
1741 | case SENSOR_MT9V111: | 1797 | case SENSOR_MT9V111: |
1798 | init = mt9v111_sensor_param1; | ||
1742 | if (mode) { | 1799 | if (mode) { |
1743 | reg1 = 0x04; /* 320 clk 48Mhz */ | 1800 | reg1 = 0x04; /* 320 clk 48Mhz */ |
1744 | } else { | 1801 | } else { |
@@ -1747,6 +1804,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1747 | } | 1804 | } |
1748 | break; | 1805 | break; |
1749 | case SENSOR_OM6802: | 1806 | case SENSOR_OM6802: |
1807 | init = om6802_sensor_param1; | ||
1750 | reg17 = 0x64; /* 640 MCKSIZE */ | 1808 | reg17 = 0x64; /* 640 MCKSIZE */ |
1751 | break; | 1809 | break; |
1752 | case SENSOR_OV7630: | 1810 | case SENSOR_OV7630: |
@@ -1755,10 +1813,12 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1755 | reg1 = 0x44; | 1813 | reg1 = 0x44; |
1756 | break; | 1814 | break; |
1757 | case SENSOR_OV7648: | 1815 | case SENSOR_OV7648: |
1816 | init = ov7648_sensor_param1; | ||
1758 | reg17 = 0x21; | 1817 | reg17 = 0x21; |
1759 | /* reg1 = 0x42; * 42 - 46? */ | 1818 | /* reg1 = 0x42; * 42 - 46? */ |
1760 | break; | 1819 | break; |
1761 | case SENSOR_OV7660: | 1820 | case SENSOR_OV7660: |
1821 | init = ov7660_sensor_param1; | ||
1762 | if (sd->bridge == BRIDGE_SN9C120) { | 1822 | if (sd->bridge == BRIDGE_SN9C120) { |
1763 | if (mode) { /* 320x240 - 160x120 */ | 1823 | if (mode) { /* 320x240 - 160x120 */ |
1764 | reg17 = 0xa2; | 1824 | reg17 = 0xa2; |
@@ -1772,6 +1832,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1772 | break; | 1832 | break; |
1773 | default: | 1833 | default: |
1774 | /* case SENSOR_SP80708: */ | 1834 | /* case SENSOR_SP80708: */ |
1835 | init = sp80708_sensor_param1; | ||
1775 | if (mode) { | 1836 | if (mode) { |
1776 | /*?? reg1 = 0x04; * 320 clk 48Mhz */ | 1837 | /*?? reg1 = 0x04; * 320 clk 48Mhz */ |
1777 | } else { | 1838 | } else { |
@@ -1780,6 +1841,13 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1780 | } | 1841 | } |
1781 | break; | 1842 | break; |
1782 | } | 1843 | } |
1844 | |||
1845 | /* more sensor initialization - param1 */ | ||
1846 | if (init != NULL) { | ||
1847 | i2c_w_seq(gspca_dev, init); | ||
1848 | /* init = NULL; */ | ||
1849 | } | ||
1850 | |||
1783 | reg_w(gspca_dev, 0xc0, C0, 6); | 1851 | reg_w(gspca_dev, 0xc0, C0, 6); |
1784 | reg_w(gspca_dev, 0xca, CA, 4); | 1852 | reg_w(gspca_dev, 0xca, CA, 4); |
1785 | switch (sd->sensor) { | 1853 | switch (sd->sensor) { |
@@ -1794,6 +1862,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1794 | break; | 1862 | break; |
1795 | } | 1863 | } |
1796 | 1864 | ||
1865 | |||
1797 | /* here change size mode 0 -> VGA; 1 -> CIF */ | 1866 | /* here change size mode 0 -> VGA; 1 -> CIF */ |
1798 | sd->reg18 = sn9c1xx[0x18] | (mode << 4) | 0x40; | 1867 | sd->reg18 = sn9c1xx[0x18] | (mode << 4) | 0x40; |
1799 | reg_w1(gspca_dev, 0x18, sd->reg18); | 1868 | reg_w1(gspca_dev, 0x18, sd->reg18); |
@@ -1801,6 +1870,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1801 | 1870 | ||
1802 | reg_w1(gspca_dev, 0x17, reg17); | 1871 | reg_w1(gspca_dev, 0x17, reg17); |
1803 | reg_w1(gspca_dev, 0x01, reg1); | 1872 | reg_w1(gspca_dev, 0x01, reg1); |
1873 | |||
1804 | switch (sd->sensor) { | 1874 | switch (sd->sensor) { |
1805 | case SENSOR_OV7630: | 1875 | case SENSOR_OV7630: |
1806 | setvflip(sd); | 1876 | setvflip(sd); |