aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-07-18 15:54:24 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-08-27 07:51:27 -0400
commit4840b788ad608977d47964d39ee53a55bec41702 (patch)
tree527c9c3dc12d83aea2e6e66297ee44bfc4f2c4e9
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>
-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 {
436 char name[128]; 436 char name[128];
437 char phys[64]; 437 char phys[64];
438 enum mceusb_model_type model; 438 enum mceusb_model_type model;
439
440 bool need_reset; /* flag to issue a device resume cmd */
439}; 441};
440 442
441/* MCE Device Command Strings, generally a port and command pair */ 443/* 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,
735 737
736static void mce_async_out(struct mceusb_dev *ir, unsigned char *data, int size) 738static void mce_async_out(struct mceusb_dev *ir, unsigned char *data, int size)
737{ 739{
740 int rsize = sizeof(DEVICE_RESUME);
741
742 if (ir->need_reset) {
743 ir->need_reset = false;
744 mce_request_packet(ir, DEVICE_RESUME, rsize, MCEUSB_TX);
745 msleep(10);
746 }
747
738 mce_request_packet(ir, data, size, MCEUSB_TX); 748 mce_request_packet(ir, data, size, MCEUSB_TX);
739 msleep(10); 749 msleep(10);
740} 750}
@@ -909,6 +919,9 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index)
909 case MCE_RSP_EQIRRXPORTEN: 919 case MCE_RSP_EQIRRXPORTEN:
910 ir->learning_enabled = ((hi & 0x02) == 0x02); 920 ir->learning_enabled = ((hi & 0x02) == 0x02);
911 break; 921 break;
922 case MCE_RSP_CMD_ILLEGAL:
923 ir->need_reset = true;
924 break;
912 default: 925 default:
913 break; 926 break;
914 } 927 }