diff options
-rw-r--r-- | drivers/media/video/gspca/zc3xx.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index 0aa87d2958a0..e57f9dd68a48 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -6036,8 +6036,10 @@ static __u16 i2c_read(struct gspca_dev *gspca_dev, | |||
6036 | 6036 | ||
6037 | reg_w_i(gspca_dev->dev, reg, 0x0092); | 6037 | reg_w_i(gspca_dev->dev, reg, 0x0092); |
6038 | reg_w_i(gspca_dev->dev, 0x02, 0x0090); /* <- read command */ | 6038 | reg_w_i(gspca_dev->dev, 0x02, 0x0090); /* <- read command */ |
6039 | msleep(25); | 6039 | msleep(20); |
6040 | retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ | 6040 | retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ |
6041 | if (retbyte != 0x00) | ||
6042 | err("i2c_r status error %02x", retbyte); | ||
6041 | retval = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */ | 6043 | retval = reg_r_i(gspca_dev, 0x0095); /* read Lowbyte */ |
6042 | retval |= reg_r_i(gspca_dev, 0x0096) << 8; /* read Hightbyte */ | 6044 | retval |= reg_r_i(gspca_dev, 0x0096) << 8; /* read Hightbyte */ |
6043 | PDEBUG(D_USBI, "i2c r [%02x] -> %04x (%02x)", | 6045 | PDEBUG(D_USBI, "i2c r [%02x] -> %04x (%02x)", |
@@ -6056,8 +6058,10 @@ static __u8 i2c_write(struct gspca_dev *gspca_dev, | |||
6056 | reg_w_i(gspca_dev->dev, valL, 0x93); | 6058 | reg_w_i(gspca_dev->dev, valL, 0x93); |
6057 | reg_w_i(gspca_dev->dev, valH, 0x94); | 6059 | reg_w_i(gspca_dev->dev, valH, 0x94); |
6058 | reg_w_i(gspca_dev->dev, 0x01, 0x90); /* <- write command */ | 6060 | reg_w_i(gspca_dev->dev, 0x01, 0x90); /* <- write command */ |
6059 | msleep(15); | 6061 | msleep(1); |
6060 | retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ | 6062 | retbyte = reg_r_i(gspca_dev, 0x0091); /* read status */ |
6063 | if (retbyte != 0x00) | ||
6064 | err("i2c_w status error %02x", retbyte); | ||
6061 | PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)", | 6065 | PDEBUG(D_USBO, "i2c w [%02x] = %02x%02x (%02x)", |
6062 | reg, valH, valL, retbyte); | 6066 | reg, valH, valL, retbyte); |
6063 | return retbyte; | 6067 | return retbyte; |
@@ -6092,7 +6096,7 @@ static void usb_exchange(struct gspca_dev *gspca_dev, | |||
6092 | break; | 6096 | break; |
6093 | } | 6097 | } |
6094 | action++; | 6098 | action++; |
6095 | /* msleep(1); */ | 6099 | msleep(1); |
6096 | } | 6100 | } |
6097 | } | 6101 | } |
6098 | 6102 | ||
@@ -6555,7 +6559,7 @@ static int vga_2wr_probe(struct gspca_dev *gspca_dev) | |||
6555 | start_2wr_probe(dev, 0x0e); /* PAS202BCB */ | 6559 | start_2wr_probe(dev, 0x0e); /* PAS202BCB */ |
6556 | reg_w(dev, 0x08, 0x008d); | 6560 | reg_w(dev, 0x08, 0x008d); |
6557 | i2c_write(gspca_dev, 0x03, 0xaa, 0x00); | 6561 | i2c_write(gspca_dev, 0x03, 0xaa, 0x00); |
6558 | msleep(500); | 6562 | msleep(50); |
6559 | retword = i2c_read(gspca_dev, 0x03); | 6563 | retword = i2c_read(gspca_dev, 0x03); |
6560 | if (retword != 0) | 6564 | if (retword != 0) |
6561 | return 0x0e; /* PAS202BCB */ | 6565 | return 0x0e; /* PAS202BCB */ |
@@ -6699,7 +6703,6 @@ static int vga_3wr_probe(struct gspca_dev *gspca_dev) | |||
6699 | reg_w(dev, 0x01, 0x0001); | 6703 | reg_w(dev, 0x01, 0x0001); |
6700 | reg_w(dev, 0xee, 0x008b); | 6704 | reg_w(dev, 0xee, 0x008b); |
6701 | reg_w(dev, 0x03, 0x0012); | 6705 | reg_w(dev, 0x03, 0x0012); |
6702 | /* msleep(150); */ | ||
6703 | reg_w(dev, 0x01, 0x0012); | 6706 | reg_w(dev, 0x01, 0x0012); |
6704 | reg_w(dev, 0x05, 0x0012); | 6707 | reg_w(dev, 0x05, 0x0012); |
6705 | retword = i2c_read(gspca_dev, 0x00) << 8; /* ID 0 */ | 6708 | retword = i2c_read(gspca_dev, 0x00) << 8; /* ID 0 */ |
@@ -7100,7 +7103,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
7100 | setautogain(gspca_dev); | 7103 | setautogain(gspca_dev); |
7101 | switch (sd->sensor) { | 7104 | switch (sd->sensor) { |
7102 | case SENSOR_PO2030: | 7105 | case SENSOR_PO2030: |
7103 | msleep(500); | 7106 | msleep(50); |
7104 | reg_r(gspca_dev, 0x0008); | 7107 | reg_r(gspca_dev, 0x0008); |
7105 | reg_r(gspca_dev, 0x0007); | 7108 | reg_r(gspca_dev, 0x0007); |
7106 | /*fall thru*/ | 7109 | /*fall thru*/ |