aboutsummaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorJarod Wilson2011-07-18 16:54:24 -0300
committerMauro Carvalho Chehab2011-08-27 08:51:27 -0300
commit4840b788ad608977d47964d39ee53a55bec41702 (patch)
tree527c9c3dc12d83aea2e6e66297ee44bfc4f2c4e9 /drivers/media
parentfa3348980a504c01e300823ab743cb2d874327fa (diff)
[media] mceusb: issue device resume cmd when needed
According to MS docs, the device firmware may halt after receiving an unknown instruction, but that it should be possible to tell the firmware to continue running by simply sending a device resume command. So lets do that. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/rc/mceusb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index d095b4d13d79..181a9b61de0e 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -436,6 +436,8 @@ struct mceusb_dev {
char name[128];
char phys[64];
enum mceusb_model_type model;
+
+ bool need_reset; /* flag to issue a device resume cmd */
};
/* MCE Device Command Strings, generally a port and command pair */
@@ -735,6 +737,14 @@ static void mce_request_packet(struct mceusb_dev *ir, unsigned char *data,
static void mce_async_out(struct mceusb_dev *ir, unsigned char *data, int size)
{
+ int rsize = sizeof(DEVICE_RESUME);
+
+ if (ir->need_reset) {
+ ir->need_reset = false;
+ mce_request_packet(ir, DEVICE_RESUME, rsize, MCEUSB_TX);
+ msleep(10);
+ }
+
mce_request_packet(ir, data, size, MCEUSB_TX);
msleep(10);
}
@@ -909,6 +919,9 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index)
case MCE_RSP_EQIRRXPORTEN:
ir->learning_enabled = ((hi & 0x02) == 0x02);
break;
+ case MCE_RSP_CMD_ILLEGAL:
+ ir->need_reset = true;
+ break;
default:
break;
}