diff --git a/drivers/input/lirc/lirc_imon.c b/drivers/input/lirc/lirc_imon.c index 5741caf..8ad5534 100644 --- a/drivers/input/lirc/lirc_imon.c +++ b/drivers/input/lirc/lirc_imon.c @@ -159,6 +159,12 @@ enum { IMON_DISPLAY_TYPE_NONE = 4, }; +enum { + IMON_REMOTE_TYPE_PAD = 0, + IMON_REMOTE_TYPE_MINI = 1, + IMON_REMOTE_TYPE_MCE = 2, + IMON_REMOTE_TYPE_MISC = 3, +}; /* * USB Device ID for iMON USB Control Boards * @@ -370,9 +376,12 @@ static DEFINE_MUTEX(driver_lock); static int debug; -/* lcd, vfd or none? should be auto-detected, but can be overridden... */ +/* lcd, vfd, vga or none? should be auto-detected, but can be overridden... */ static int display_type; +/* remote type: iMON PAD, iMON MINI, Windows MCE or Other */ +static int remote_type; + /*** M O D U L E C O D E ***/ @@ -386,6 +395,10 @@ MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)"); module_param(display_type, int, S_IRUGO); MODULE_PARM_DESC(display_type, "Type of attached display. 0=autodetect, " "1=vfd, 2=lcd, 3=vga, 4=none (default: autodetect)"); +module_param(remote_type, int, S_IRUGO); +MODULE_PARM_DESC(remote_type, "Type of remote in use. 0=iMON PAD (RM-200), " + "1=iMON MINI (RM-100), 2=Windows Media Center Ed., 3=Other " + "(default: iMON PAD)"); static void free_imon_context(struct imon_context *context) { @@ -1478,6 +1485,8 @@ static int imon_probe(struct usb_interface *interface, u16 vendor, product; const unsigned char fp_packet[] = { 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88 }; + static unsigned char remote_setup_packet[] = + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; /* * If it's the LCD, as opposed to the VFD, we just need to replace @@ -1827,6 +1836,25 @@ static int imon_probe(struct usb_interface *interface, "buttons and/or knobs\n", __func__); } + /* set remote type */ + switch (remote_type) { + case IMON_REMOTE_TYPE_MISC: + printk("universal remote?...\n"); + break; + case IMON_REMOTE_TYPE_MCE: + remote_setup_packet[0] = 0x01; + break; + case IMON_REMOTE_TYPE_PAD: + case IMON_REMOTE_TYPE_MINI: + default: + //remote_setup_packet[0] = 0x00; + break; + } + memcpy(context->usb_tx_buf, &remote_type, sizeof(remote_type)); + retval = send_packet(context); + if (retval) + printk(KERN_INFO "%s: failed to set remote type\n", __func__); + printk(KERN_INFO MOD_NAME ": iMON device (%04x:%04x, intf%d) on " "usb<%d:%d> initialized\n", vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum);