Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285607
b: refs/heads/master
c: 3874cd7
h: refs/heads/master
i:
  285605: 61e0de5
  285603: 7992cda
  285599: 41f7b5e
v: v3
  • Loading branch information
matthieu castet authored and Mauro Carvalho Chehab committed Jan 4, 2012
1 parent 14f5965 commit b4c7597
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7581e61d8d7a3ed89a3fdac2235231cd36548f78
refs/heads/master: 3874cd7796ef1a03cd6d2a2d886e3ac4c35af09c
2 changes: 2 additions & 0 deletions trunk/drivers/media/video/tm6000/tm6000-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
case TM6010_BOARD_HAUPPAUGE_900H:
case TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE:
case TM6010_BOARD_TWINHAN_TU501:
ctl.max_len = 80;
ctl.fname = "xc3028L-v36.fw";
break;
default:
Expand Down Expand Up @@ -1004,6 +1005,7 @@ static int fill_board_specific_data(struct tm6000_core *dev)
/* setup per-model quirks */
switch (dev->model) {
case TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE:
case TM6010_BOARD_HAUPPAUGE_900H:
dev->quirks |= TM6000_QUIRK_NO_USB_DELAY;
break;

Expand Down
16 changes: 14 additions & 2 deletions trunk/drivers/media/video/tm6000/tm6000-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req,
int ret, i;
unsigned int pipe;
u8 *data = NULL;
int delay = 5000;

mutex_lock(&dev->usb_lock);

Expand Down Expand Up @@ -89,8 +90,19 @@ int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req,

kfree(data);

if ((dev->quirks & TM6000_QUIRK_NO_USB_DELAY) == 0)
msleep(5);
if (dev->quirks & TM6000_QUIRK_NO_USB_DELAY)
delay = 0;

if (req == REQ_16_SET_GET_I2C_WR1_RDN && !(req_type & USB_DIR_IN)) {
unsigned int tsleep;
/* Calculate delay time, 14000us for 64 bytes */
tsleep = (len * 200) + 200;
if (tsleep < delay)
tsleep = delay;
usleep_range(tsleep, tsleep + 1000);
}
else if (delay)
usleep_range(delay, delay + 1000);

mutex_unlock(&dev->usb_lock);
return ret;
Expand Down
8 changes: 1 addition & 7 deletions trunk/drivers/media/video/tm6000/tm6000-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ static int tm6000_i2c_send_regs(struct tm6000_core *dev, unsigned char addr,
__u8 reg, char *buf, int len)
{
int rc;
unsigned int tsleep;
unsigned int i2c_packet_limit = 16;

if (dev->dev_type == TM6010)
i2c_packet_limit = 64;
i2c_packet_limit = 80;

if (!buf)
return -1;
Expand All @@ -71,10 +70,6 @@ static int tm6000_i2c_send_regs(struct tm6000_core *dev, unsigned char addr,
return rc;
}

/* Calculate delay time, 14000us for 64 bytes */
tsleep = ((len * 200) + 200 + 1000) / 1000;
msleep(tsleep);

/* release mutex */
return rc;
}
Expand Down Expand Up @@ -145,7 +140,6 @@ static int tm6000_i2c_recv_regs16(struct tm6000_core *dev, unsigned char addr,
return rc;
}

msleep(1400 / 1000);
rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR |
USB_RECIP_DEVICE, REQ_35_AFTEK_TUNER_READ,
reg, 0, buf, len);
Expand Down

0 comments on commit b4c7597

Please sign in to comment.