*/
void em28xx_pre_card_setup(struct em28xx *dev)
{
+ int rc;
+
+ dev->wait_after_write = 5;
+ rc = em28xx_read_reg(dev, CHIPID_REG);
+ if (rc > 0) {
+ switch (rc) {
+ case 36:
+ em28xx_info("chip ID is em2882/em2883\n");
+ dev->wait_after_write = 0;
+ break;
+ default:
+ em28xx_info("em28xx chip ID = %d\n", rc);
+ }
+ }
em28xx_set_model(dev);
/* request some modules */
ret = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), req,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0x0000, reg, bufs, len, HZ);
+ if (dev->wait_after_write)
+ msleep(dev->wait_after_write);
+
kfree(bufs);
return ret;
}
dev->em28xx_read_reg_req = em28xx_read_reg_req;
dev->is_em2800 = em28xx_boards[dev->model].is_em2800;
- errCode = em28xx_read_reg(dev, CHIPID_REG);
- if (errCode >= 0)
- em28xx_info("em28xx chip ID = %d\n", errCode);
-
em28xx_pre_card_setup(dev);
errCode = em28xx_config(dev);
unsigned int max_range_640_480:1;
unsigned int has_dvb:1;
+ /* Some older em28xx chips needs a waiting time after writing */
+ unsigned int wait_after_write;
+
/* GPIO sequences for tuner callback */
struct em28xx_reg_seq *analog_gpio, *digital_gpio;