Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366664
b: refs/heads/master
c: 26ccbec
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Baradon authored and Mauro Carvalho Chehab committed Mar 21, 2013
1 parent f427186 commit d62d4ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 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: 15170025ee26946dc61f3c21e54652c6db4a0326
refs/heads/master: 26ccbec44a7c62de4fef4f33bb858963e501921d
17 changes: 13 additions & 4 deletions trunk/drivers/media/rc/imon.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ struct imon_context {
bool tx_control;
unsigned char usb_rx_buf[8];
unsigned char usb_tx_buf[8];
unsigned int send_packet_delay;

struct tx_t {
unsigned char data_buf[35]; /* user data buffer */
Expand Down Expand Up @@ -185,6 +186,10 @@ enum {
IMON_KEY_PANEL = 2,
};

enum {
IMON_NEED_20MS_PKT_DELAY = 1
};

/*
* USB Device ID for iMON USB Control Boards
*
Expand Down Expand Up @@ -215,7 +220,7 @@ static struct usb_device_id imon_usb_id_table[] = {
/* SoundGraph iMON OEM Touch LCD (IR & 4.3" VGA LCD) */
{ USB_DEVICE(0x15c2, 0x0035) },
/* SoundGraph iMON OEM VFD (IR & VFD) */
{ USB_DEVICE(0x15c2, 0x0036) },
{ USB_DEVICE(0x15c2, 0x0036), .driver_info = IMON_NEED_20MS_PKT_DELAY },
/* device specifics unknown */
{ USB_DEVICE(0x15c2, 0x0037) },
/* SoundGraph iMON OEM LCD (IR & LCD) */
Expand Down Expand Up @@ -535,12 +540,12 @@ static int send_packet(struct imon_context *ictx)
kfree(control_req);

/*
* Induce a mandatory 5ms delay before returning, as otherwise,
* Induce a mandatory delay before returning, as otherwise,
* send_packet can get called so rapidly as to overwhelm the device,
* particularly on faster systems and/or those with quirky usb.
*/
timeout = msecs_to_jiffies(5);
set_current_state(TASK_UNINTERRUPTIBLE);
timeout = msecs_to_jiffies(ictx->send_packet_delay);
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(timeout);

return retval;
Expand Down Expand Up @@ -2335,6 +2340,10 @@ static int imon_probe(struct usb_interface *interface,

}

/* default send_packet delay is 5ms but some devices need more */
ictx->send_packet_delay = id->driver_info & IMON_NEED_20MS_PKT_DELAY ?
20 : 5;

usb_set_intfdata(interface, ictx);

if (ifnum == 0) {
Expand Down

0 comments on commit d62d4ba

Please sign in to comment.