aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/sonixj.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-11-02 07:21:06 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:41:17 -0500
commita782636c26b7468345d2c3b67952bf695a39cdfa (patch)
treeba2d1bc9df5e48fa3a513370187eb99dea43d301 /drivers/media/video/gspca/sonixj.c
parent23a98274cc348880ecb6803307c254448084953a (diff)
V4L/DVB (13302): gspca - sonixj: Fix some bad values of sensor om6802.
- sensor address is 0x34 - sensor i2c is 100 kHz Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/sonixj.c')
-rw-r--r--drivers/media/video/gspca/sonixj.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index 63371bbe3da9..159f9f7be307 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -973,7 +973,14 @@ static void i2c_w1(struct gspca_dev *gspca_dev, u8 reg, u8 val)
973 struct sd *sd = (struct sd *) gspca_dev; 973 struct sd *sd = (struct sd *) gspca_dev;
974 974
975 PDEBUG(D_USBO, "i2c_w2 [%02x] = %02x", reg, val); 975 PDEBUG(D_USBO, "i2c_w2 [%02x] = %02x", reg, val);
976 gspca_dev->usb_buf[0] = 0x81 | (2 << 4); /* = a1 */ 976 switch (sd->sensor) {
977 case SENSOR_OM6802: /* i2c command = a0 (100 kHz) */
978 gspca_dev->usb_buf[0] = 0x80 | (2 << 4);
979 break;
980 default: /* i2c command = a1 (400 kHz) */
981 gspca_dev->usb_buf[0] = 0x81 | (2 << 4);
982 break;
983 }
977 gspca_dev->usb_buf[1] = sd->i2c_base; 984 gspca_dev->usb_buf[1] = sd->i2c_base;
978 gspca_dev->usb_buf[2] = reg; 985 gspca_dev->usb_buf[2] = reg;
979 gspca_dev->usb_buf[3] = val; 986 gspca_dev->usb_buf[3] = val;
@@ -1012,7 +1019,14 @@ static void i2c_r5(struct gspca_dev *gspca_dev, u8 reg)
1012 struct sd *sd = (struct sd *) gspca_dev; 1019 struct sd *sd = (struct sd *) gspca_dev;
1013 u8 mode[8]; 1020 u8 mode[8];
1014 1021
1015 mode[0] = 0x81 | 0x10; 1022 switch (sd->sensor) {
1023 case SENSOR_OM6802: /* i2c command = 90 (100 kHz) */
1024 mode[0] = 0x80 | 0x10;
1025 break;
1026 default: /* i2c command = 91 (400 kHz) */
1027 mode[0] = 0x81 | 0x10;
1028 break;
1029 }
1016 mode[1] = sd->i2c_base; 1030 mode[1] = sd->i2c_base;
1017 mode[2] = reg; 1031 mode[2] = reg;
1018 mode[3] = 0; 1032 mode[3] = 0;
@@ -1022,7 +1036,7 @@ static void i2c_r5(struct gspca_dev *gspca_dev, u8 reg)
1022 mode[7] = 0x10; 1036 mode[7] = 0x10;
1023 i2c_w8(gspca_dev, mode); 1037 i2c_w8(gspca_dev, mode);
1024 msleep(2); 1038 msleep(2);
1025 mode[0] = 0x81 | (5 << 4) | 0x02; 1039 mode[0] = (mode[0] & 0x81) | (5 << 4) | 0x02;
1026 mode[2] = 0; 1040 mode[2] = 0;
1027 i2c_w8(gspca_dev, mode); 1041 i2c_w8(gspca_dev, mode);
1028 msleep(2); 1042 msleep(2);
@@ -2216,7 +2230,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
2216/* {USB_DEVICE(0x0c45, 0x607e), BSI(SN9C102P, OV7630, 0x21)}, */ 2230/* {USB_DEVICE(0x0c45, 0x607e), BSI(SN9C102P, OV7630, 0x21)}, */
2217 {USB_DEVICE(0x0c45, 0x60c0), BSI(SN9C105, MI0360, 0x5d)}, 2231 {USB_DEVICE(0x0c45, 0x60c0), BSI(SN9C105, MI0360, 0x5d)},
2218/* {USB_DEVICE(0x0c45, 0x60c2), BSI(SN9C105, P1030xC, 0x??)}, */ 2232/* {USB_DEVICE(0x0c45, 0x60c2), BSI(SN9C105, P1030xC, 0x??)}, */
2219/* {USB_DEVICE(0x0c45, 0x60c8), BSI(SN9C105, OM6802, 0x21)}, */ 2233/* {USB_DEVICE(0x0c45, 0x60c8), BSI(SN9C105, OM6802, 0x34)}, */
2220/* {USB_DEVICE(0x0c45, 0x60cc), BSI(SN9C105, HV7131GP, 0x??)}, */ 2234/* {USB_DEVICE(0x0c45, 0x60cc), BSI(SN9C105, HV7131GP, 0x??)}, */
2221 {USB_DEVICE(0x0c45, 0x60ec), BSI(SN9C105, MO4000, 0x21)}, 2235 {USB_DEVICE(0x0c45, 0x60ec), BSI(SN9C105, MO4000, 0x21)},
2222/* {USB_DEVICE(0x0c45, 0x60ef), BSI(SN9C105, ICM105C, 0x??)}, */ 2236/* {USB_DEVICE(0x0c45, 0x60ef), BSI(SN9C105, ICM105C, 0x??)}, */
@@ -2228,7 +2242,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
2228#endif 2242#endif
2229 {USB_DEVICE(0x0c45, 0x6100), BSI(SN9C120, MI0360, 0x5d)}, /*sn9c128*/ 2243 {USB_DEVICE(0x0c45, 0x6100), BSI(SN9C120, MI0360, 0x5d)}, /*sn9c128*/
2230/* {USB_DEVICE(0x0c45, 0x6102), BSI(SN9C120, P1030xC, ??)}, */ 2244/* {USB_DEVICE(0x0c45, 0x6102), BSI(SN9C120, P1030xC, ??)}, */
2231/* {USB_DEVICE(0x0c45, 0x6108), BSI(SN9C120, OM6802, 0x21)}, */ 2245/* {USB_DEVICE(0x0c45, 0x6108), BSI(SN9C120, OM6802, 0x34)}, */
2232 {USB_DEVICE(0x0c45, 0x610a), BSI(SN9C120, OV7648, 0x21)}, /*sn9c128*/ 2246 {USB_DEVICE(0x0c45, 0x610a), BSI(SN9C120, OV7648, 0x21)}, /*sn9c128*/
2233 {USB_DEVICE(0x0c45, 0x610b), BSI(SN9C120, OV7660, 0x21)}, /*sn9c128*/ 2247 {USB_DEVICE(0x0c45, 0x610b), BSI(SN9C120, OV7660, 0x21)}, /*sn9c128*/
2234 {USB_DEVICE(0x0c45, 0x610c), BSI(SN9C120, HV7131R, 0x11)}, /*sn9c128*/ 2248 {USB_DEVICE(0x0c45, 0x610c), BSI(SN9C120, HV7131R, 0x11)}, /*sn9c128*/
@@ -2236,7 +2250,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
2236/* {USB_DEVICE(0x0c45, 0x610f), BSI(SN9C120, S5K53BEB, 0x??)}, */ 2250/* {USB_DEVICE(0x0c45, 0x610f), BSI(SN9C120, S5K53BEB, 0x??)}, */
2237/* {USB_DEVICE(0x0c45, 0x6122), BSI(SN9C110, ICM105C, 0x??)}, */ 2251/* {USB_DEVICE(0x0c45, 0x6122), BSI(SN9C110, ICM105C, 0x??)}, */
2238/* {USB_DEVICE(0x0c45, 0x6123), BSI(SN9C110, SanyoCCD, 0x??)}, */ 2252/* {USB_DEVICE(0x0c45, 0x6123), BSI(SN9C110, SanyoCCD, 0x??)}, */
2239 {USB_DEVICE(0x0c45, 0x6128), BSI(SN9C110, OM6802, 0x21)}, /*sn9c325?*/ 2253 {USB_DEVICE(0x0c45, 0x6128), BSI(SN9C120, OM6802, 0x34)}, /*sn9c325?*/
2240/*bw600.inf:*/ 2254/*bw600.inf:*/
2241 {USB_DEVICE(0x0c45, 0x612a), BSI(SN9C120, OV7648, 0x21)}, /*sn9c110?*/ 2255 {USB_DEVICE(0x0c45, 0x612a), BSI(SN9C120, OV7648, 0x21)}, /*sn9c110?*/
2242 {USB_DEVICE(0x0c45, 0x612c), BSI(SN9C110, MO4000, 0x21)}, 2256 {USB_DEVICE(0x0c45, 0x612c), BSI(SN9C110, MO4000, 0x21)},
@@ -2255,7 +2269,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
2255 {USB_DEVICE(0x0c45, 0x613e), BSI(SN9C120, OV7630, 0x21)}, 2269 {USB_DEVICE(0x0c45, 0x613e), BSI(SN9C120, OV7630, 0x21)},
2256/* {USB_DEVICE(0x0c45, 0x6142), BSI(SN9C120, PO2030N, ??)}, *sn9c120b*/ 2270/* {USB_DEVICE(0x0c45, 0x6142), BSI(SN9C120, PO2030N, ??)}, *sn9c120b*/
2257 {USB_DEVICE(0x0c45, 0x6143), BSI(SN9C120, SP80708, 0x18)}, /*sn9c120b*/ 2271 {USB_DEVICE(0x0c45, 0x6143), BSI(SN9C120, SP80708, 0x18)}, /*sn9c120b*/
2258 {USB_DEVICE(0x0c45, 0x6148), BSI(SN9C120, OM6802, 0x21)}, /*sn9c120b*/ 2272 {USB_DEVICE(0x0c45, 0x6148), BSI(SN9C120, OM6802, 0x34)}, /*sn9c120b*/
2259 {} 2273 {}
2260}; 2274};
2261MODULE_DEVICE_TABLE(usb, device_table); 2275MODULE_DEVICE_TABLE(usb, device_table);