här är patchen/patcherna. dom är för remoten och lcd'n
den här är till lirc
Kod: Markera allt
--- lirc.org/drivers/lirc_imon/lirc_imon.c 2008-02-25 04:48:41.883792756 -0500
+++ lirc/drivers/lirc_imon/lirc_imon.c 2008-02-25 04:48:23.074984848 -0500
@@ -87,6 +87,8 @@
#define BIT_DURATION 250 /* each bit received is 250us */
+#define IMON_LCD_NEXTGEN 0x0038 /* The 0x0038 device requires control urbs */
+
#define SUCCESS 0
#define TRUE 1
#define FALSE 0
@@ -162,6 +164,7 @@
struct usb_endpoint_descriptor *tx_endpoint;
struct urb *rx_urb;
struct urb *tx_urb;
+ int tx_control; /* if 1, will use a control msg urb */
unsigned char usb_rx_buf[8];
unsigned char usb_tx_buf[8];
@@ -196,6 +199,7 @@
{ USB_DEVICE(0x0aa8, 0x8001) }, /* IR only */
{ USB_DEVICE(0x15c2, 0xffda) }, /* IR & VFD */
{ USB_DEVICE(0x15c2, 0xffdc) }, /* IR & VFD */
+ { USB_DEVICE(0x15c2, 0x0038) }, /* IR & LCD */
{ USB_DEVICE(0x04e8, 0xff30) }, /* ext IR only */
{}
};
@@ -212,6 +216,7 @@
static unsigned short ir_onboard_decode_product_list[] = {
/* terminate this list with a 0 */
0xffdc,
+ 0x0038,
0 };
/* USB Device data */
@@ -431,17 +436,31 @@
int interval = 0;
int retval = SUCCESS;
- pipe = usb_sndintpipe(context->dev,
+ /* Check if we need to use control or interrupt urb */
+ if ( context->tx_control == 0 )
+ {
+ pipe = usb_sndintpipe(context->dev,
context->tx_endpoint->bEndpointAddress);
#ifdef KERNEL_2_5
- interval = context->tx_endpoint->bInterval;
+ interval = context->tx_endpoint->bInterval;
#endif /* Use 0 for 2.4 kernels */
- usb_fill_int_urb(context->tx_urb, context->dev, pipe,
- context->usb_tx_buf, sizeof(context->usb_tx_buf),
- usb_tx_callback, context, interval);
-
- context->tx_urb->actual_length = 0;
+ usb_fill_int_urb(context->tx_urb, context->dev, pipe,
+ context->usb_tx_buf, sizeof(context->usb_tx_buf),
+ usb_tx_callback, context, interval);
+
+ context->tx_urb->actual_length = 0;
+ } else {
+ /* setup packet is '21 09 0200 0001 0008' */
+ unsigned char setup_packet[8] = { 0x21, 0x09, 0x02, 0x00, 0x00, 0x01, 0x00, 0x08 };
+ /* control pipe is endpoint 0x00 */
+ pipe = usb_sndctrlpipe(context->dev, 0);
+ /* build the control urb */
+ usb_fill_control_urb(context->tx_urb, context->dev, pipe, setup_packet,
+ context->usb_tx_buf, sizeof(context->usb_tx_buf),
+ usb_tx_callback, context);
+ context->tx_urb->actual_length = 0;
+ }
init_completion(&context->tx.finished);
atomic_set(&(context->tx.busy), 1);
@@ -1036,6 +1055,7 @@
int alloc_status;
int vfd_proto_6p = FALSE;
int ir_onboard_decode = FALSE;
+ int tx_control = 0;
struct imon_context *context = NULL;
int i;
@@ -1110,6 +1130,17 @@
info("%s: found VFD endpoint", __FUNCTION__);
}
}
+
+ /* If we didn't find a vfd endpoint, and we have a next-gen LCD,
+ * use control urb instead of interrupt
+ */
+ if (! vfd_ep_found && cpu_to_le16(dev->descriptor.idProduct) == IMON_LCD_NEXTGEN )
+ {
+ tx_control = 1;
+ vfd_ep_found = TRUE;
+ if (debug)
+ info("%s: guessing that LCD (0x0038) device uses control endpoint, not interface OUT endpoint", __FUNCTION__);
+ }
/* Input endpoint is mandatory */
if (!ir_ep_found) {
@@ -1272,6 +1303,7 @@
context->vfd_supported = TRUE;
context->tx_endpoint = tx_endpoint;
context->tx_urb = tx_urb;
+ context->tx_control = tx_control;
}
context->plugin = plugin;
den här är till lcdproc
Kod: Markera allt
diff -ruN lcdproc-0.5.2-orig/server/drivers/Makefile lcdproc-0.5.2/server/drivers/Makefile
--- lcdproc-0.5.2-orig/server/drivers/Makefile 2008-02-25 06:25:37.448073128 -0500
+++ lcdproc-0.5.2/server/drivers/Makefile 2008-02-25 05:06:30.565910827 -0500
@@ -255,7 +255,7 @@
CYGPATH_W = echo
DARWIN_FALSE =
DARWIN_TRUE = #
-DEFS = -DHAVE_CONFIG_H
+DEFS = -DHAVE_CONFIG_H -DIS_LCD_0038
DEPDIR = .deps
DOT =
DOXYGEN =
diff -ruN lcdproc-0.5.2-orig/server/drivers/imonlcd.c lcdproc-0.5.2/server/drivers/imonlcd.c
--- lcdproc-0.5.2-orig/server/drivers/imonlcd.c 2008-02-25 06:24:16.603903431 -0500
+++ lcdproc-0.5.2/server/drivers/imonlcd.c 2008-02-25 05:20:15.907470511 -0500
@@ -87,12 +87,23 @@
/**
* Just for convenience and to have the commands at one place.
*/
+
#define COMMANDS_SET_ICONS (uint64_t) 0x0100000000000000
#define COMMANDS_SET_CONTRAST (uint64_t) 0x0300000000000000
-#define COMMANDS_DISPLAY (uint64_t) 0x5000000000000000
-#define COMMANDS_SHUTDOWN (uint64_t) 0x5000000000000008
-#define COMMANDS_DISPLAY_ON (uint64_t) 0x5000000000000040
-#define COMMANDS_CLEAR_ALARM (uint64_t) 0x5100000000000000
+
+#ifdef IS_LCD_0038
+#define COMMANDS_DISPLAY_BYTE (uint64_t) 0x8800000000000000
+#define COMMANDS_ALARM_BYTE (uint64_t) 0x8a00000000000000
+#else
+#define COMMANDS_DISPLAY_BYTE (uint64_t) 0x5000000000000000
+#define COMMANDS_ALARM_BYTE (uint64_t) 0x5100000000000000
+#endif
+
+#define COMMANDS_DISPLAY (uint64_t) (0x0000000000000000 | COMMANDS_DISPLAY_BYTE)
+#define COMMANDS_SHUTDOWN (uint64_t) (0x0000000000000008 | COMMANDS_DISPLAY_BYTE)
+#define COMMANDS_DISPLAY_ON (uint64_t) (0x0000000000000040 | COMMANDS_DISPLAY_BYTE)
+#define COMMANDS_CLEAR_ALARM (uint64_t) (0x0000000000000000 | COMMANDS_ALARM_BYTE)
+
#define COMMANDS_SET_LINES0 (uint64_t) 0x1000000000000000
#define COMMANDS_SET_LINES1 (uint64_t) 0x1100000000000000
#define COMMANDS_SET_LINES2 (uint64_t) 0x1200000000000000
@@ -1074,7 +1085,7 @@
*/
static void send_command_data( uint64_t commandData, int fd )
{
- if ((commandData & 0xFF00000000000000L) == 0x5000000000000000L) {
+ if ((commandData & 0xFF00000000000000L) == COMMANDS_DISPLAY_BYTE) {
printf("%s: sending command: %lX\n", "imonlcd", commandData);
}
//J