diff options
-rw-r--r-- | drivers/media/rc/mceusb.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 181a9b61de0e..4c5909f06ac2 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c | |||
@@ -438,12 +438,14 @@ struct mceusb_dev { | |||
438 | enum mceusb_model_type model; | 438 | enum mceusb_model_type model; |
439 | 439 | ||
440 | bool need_reset; /* flag to issue a device resume cmd */ | 440 | bool need_reset; /* flag to issue a device resume cmd */ |
441 | u8 emver; /* emulator interface version */ | ||
441 | }; | 442 | }; |
442 | 443 | ||
443 | /* MCE Device Command Strings, generally a port and command pair */ | 444 | /* MCE Device Command Strings, generally a port and command pair */ |
444 | static char DEVICE_RESUME[] = {MCE_CMD_NULL, MCE_CMD_PORT_SYS, | 445 | static char DEVICE_RESUME[] = {MCE_CMD_NULL, MCE_CMD_PORT_SYS, |
445 | MCE_CMD_RESUME}; | 446 | MCE_CMD_RESUME}; |
446 | static char GET_REVISION[] = {MCE_CMD_PORT_SYS, MCE_CMD_G_REVISION}; | 447 | static char GET_REVISION[] = {MCE_CMD_PORT_SYS, MCE_CMD_G_REVISION}; |
448 | static char GET_EMVER[] = {MCE_CMD_PORT_SYS, MCE_CMD_GETEMVER}; | ||
447 | static char GET_WAKEVERSION[] = {MCE_CMD_PORT_SYS, MCE_CMD_GETWAKEVERSION}; | 449 | static char GET_WAKEVERSION[] = {MCE_CMD_PORT_SYS, MCE_CMD_GETWAKEVERSION}; |
448 | static char GET_UNKNOWN2[] = {MCE_CMD_PORT_IR, MCE_CMD_UNKNOWN2}; | 450 | static char GET_UNKNOWN2[] = {MCE_CMD_PORT_IR, MCE_CMD_UNKNOWN2}; |
449 | static char GET_CARRIER_FREQ[] = {MCE_CMD_PORT_IR, MCE_CMD_GETIRCFS}; | 451 | static char GET_CARRIER_FREQ[] = {MCE_CMD_PORT_IR, MCE_CMD_GETIRCFS}; |
@@ -913,6 +915,9 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index) | |||
913 | break; | 915 | break; |
914 | 916 | ||
915 | /* 1-byte return value commands */ | 917 | /* 1-byte return value commands */ |
918 | case MCE_RSP_EQEMVER: | ||
919 | ir->emver = hi; | ||
920 | break; | ||
916 | case MCE_RSP_EQIRTXPORTS: | 921 | case MCE_RSP_EQIRTXPORTS: |
917 | ir->tx_mask = hi; | 922 | ir->tx_mask = hi; |
918 | break; | 923 | break; |
@@ -1035,6 +1040,13 @@ static void mceusb_dev_recv(struct urb *urb, struct pt_regs *regs) | |||
1035 | usb_submit_urb(urb, GFP_ATOMIC); | 1040 | usb_submit_urb(urb, GFP_ATOMIC); |
1036 | } | 1041 | } |
1037 | 1042 | ||
1043 | static void mceusb_get_emulator_version(struct mceusb_dev *ir) | ||
1044 | { | ||
1045 | /* If we get no reply or an illegal command reply, its ver 1, says MS */ | ||
1046 | ir->emver = 1; | ||
1047 | mce_async_out(ir, GET_EMVER, sizeof(GET_EMVER)); | ||
1048 | } | ||
1049 | |||
1038 | static void mceusb_gen1_init(struct mceusb_dev *ir) | 1050 | static void mceusb_gen1_init(struct mceusb_dev *ir) |
1039 | { | 1051 | { |
1040 | int ret; | 1052 | int ret; |
@@ -1288,6 +1300,9 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf, | |||
1288 | mce_dbg(&intf->dev, "Flushing receive buffers\n"); | 1300 | mce_dbg(&intf->dev, "Flushing receive buffers\n"); |
1289 | mce_flush_rx_buffer(ir, maxp); | 1301 | mce_flush_rx_buffer(ir, maxp); |
1290 | 1302 | ||
1303 | /* figure out which firmware/emulator version this hardware has */ | ||
1304 | mceusb_get_emulator_version(ir); | ||
1305 | |||
1291 | /* initialize device */ | 1306 | /* initialize device */ |
1292 | if (ir->flags.microsoft_gen1) | 1307 | if (ir->flags.microsoft_gen1) |
1293 | mceusb_gen1_init(ir); | 1308 | mceusb_gen1_init(ir); |
@@ -1305,8 +1320,8 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf, | |||
1305 | device_set_wakeup_capable(ir->dev, true); | 1320 | device_set_wakeup_capable(ir->dev, true); |
1306 | device_set_wakeup_enable(ir->dev, true); | 1321 | device_set_wakeup_enable(ir->dev, true); |
1307 | 1322 | ||
1308 | dev_info(&intf->dev, "Registered %s on usb%d:%d\n", name, | 1323 | dev_info(&intf->dev, "Registered %s with mce emulator interface " |
1309 | dev->bus->busnum, dev->devnum); | 1324 | "version %x\n", name, ir->emver); |
1310 | 1325 | ||
1311 | return 0; | 1326 | return 0; |
1312 | 1327 | ||