Commit 4840b788 authored by Jarod Wilson's avatar Jarod Wilson Committed by Mauro Carvalho Chehab

[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: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent fa334898
...@@ -436,6 +436,8 @@ struct mceusb_dev { ...@@ -436,6 +436,8 @@ struct mceusb_dev {
char name[128]; char name[128];
char phys[64]; char phys[64];
enum mceusb_model_type model; 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 */ /* 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,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) 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); mce_request_packet(ir, data, size, MCEUSB_TX);
msleep(10); msleep(10);
} }
...@@ -909,6 +919,9 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index) ...@@ -909,6 +919,9 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index)
case MCE_RSP_EQIRRXPORTEN: case MCE_RSP_EQIRRXPORTEN:
ir->learning_enabled = ((hi & 0x02) == 0x02); ir->learning_enabled = ((hi & 0x02) == 0x02);
break; break;
case MCE_RSP_CMD_ILLEGAL:
ir->need_reset = true;
break;
default: default:
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment