From patchwork Tue Dec 8 01:08:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Iyer X-Patchwork-Id: 40550 X-Patchwork-Delegate: apw@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 78DEAB6F07 for ; Tue, 8 Dec 2009 12:08:59 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.60) (envelope-from ) id 1NHoZL-0004rR-TV; Tue, 08 Dec 2009 01:08:48 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.60) (envelope-from ) id 1NHoZG-0004qJ-OL for kernel-team@lists.ubuntu.com; Tue, 08 Dec 2009 01:08:42 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1NHoZG-0004Vw-M2 for ; Tue, 08 Dec 2009 01:08:42 +0000 Received: from [70.114.236.114] (helo=hungry.local) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NHoZG-0007Mb-85 for kernel-team@lists.ubuntu.com; Tue, 08 Dec 2009 01:08:42 +0000 Date: Mon, 7 Dec 2009 19:08:33 -0600 (CST) From: Manoj Iyer To: Ubuntu Kernel Team Subject: [Lucid] UBUNTU: Update lirc drivers to cvs version 2009.12.07 Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.8 Precedence: list Reply-To: Manoj Iyer List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Updated the lirc driver version to the latest cvs. I had to change the makefiles and modify the source to point to the correct header files. The source is set up to build under the lirc main tree, so had to modify few things to make it to build under ubuntu/ There was no BOM file for this driver so added a new one. Test kernel is avaiable for latest lucid kernel under: http://people.canonical.com/~manjo/lucid/lirc/ Git commits can be pulled from: The following changes since commit 802ec95236d5f995e04a16a7caa7f18e8360158d: Manoj Iyer (1): UBUNTU: Update lirc drivers to cvs version 2009.12.07 are available in the git repository at: ssh://zinc.canonical.com/srv/kernel.ubuntu.com/git/manjo/ubuntu-lucid.git lirc Changes from old version to 2009.12.07 cvs version are as follows: From 802ec95236d5f995e04a16a7caa7f18e8360158d Mon Sep 17 00:00:00 2001 From: Manoj Iyer Date: Mon, 7 Dec 2009 18:54:32 -0600 Subject: [PATCH] UBUNTU: Update lirc drivers to cvs version 2009.12.07 ExternalDriver: lirc Description: drivers to decode and send infra-red signals of many (but not all) commonly used remote controls. Url: http://www.lirc.org/cvs.html Mask: Version: cvs version 2009.12.07 Signed-off-by: Manoj Iyer --- debian.master/changelog | 2 +- ubuntu/lirc/BOM | 3 ++ ubuntu/lirc/kcompat.h | 8 +++++- ubuntu/lirc/lirc_bt829/lirc_bt829.c | 4 +- ubuntu/lirc/lirc_dev/lirc_dev.c | 4 +- ubuntu/lirc/lirc_ene0100/lirc_ene0100.c | 5 ++- ubuntu/lirc/lirc_i2c/lirc_i2c.c | 1 + ubuntu/lirc/lirc_igorplugusb/lirc_igorplugusb.c | 5 +--- ubuntu/lirc/lirc_imon/lirc_imon.c | 34 ++++++++++++----------- ubuntu/lirc/lirc_ite8709/lirc_ite8709.c | 3 ++ ubuntu/lirc/lirc_mceusb/lirc_mceusb.c | 20 ++++++------- ubuntu/lirc/lirc_serial/lirc_serial.c | 9 ++++++ ubuntu/lirc/lirc_sir/lirc_sir.c | 12 +++++++- 13 files changed, 70 insertions(+), 40 deletions(-) create mode 100644 ubuntu/lirc/BOM diff --git a/debian.master/changelog b/debian.master/changelog index f8d90c2..a43058d 100644 --- a/debian.master/changelog +++ b/debian.master/changelog @@ -1,4 +1,4 @@ -linux (2.6.32-7.10) lucid; urgency=low +linux (2.6.32-7.10~lirc1manjo1) lucid; urgency=low [ Andy Whitcroft ] diff --git a/ubuntu/lirc/BOM b/ubuntu/lirc/BOM new file mode 100644 index 0000000..49158e5 --- /dev/null +++ b/ubuntu/lirc/BOM @@ -0,0 +1,3 @@ +Downloaded from: cvs -z8 -d:pserver:anonymous@lirc.cvs.sourceforge.net:/cvsroot/lirc co lirc +Current Version: 2009.12.07 +Comments: Fix up makefiles. Fix source code to point to hearder. diff --git a/ubuntu/lirc/kcompat.h b/ubuntu/lirc/kcompat.h index 1ede942..88f3f95 100644 --- a/ubuntu/lirc/kcompat.h +++ b/ubuntu/lirc/kcompat.h @@ -1,4 +1,4 @@ -/* $Id: kcompat.h,v 5.44 2009/03/22 08:45:47 lirc Exp $ */ +/* $Id: kcompat.h,v 5.45 2009/08/02 11:15:28 lirc Exp $ */ #ifndef _KCOMPAT_H #define _KCOMPAT_H @@ -399,4 +399,10 @@ static inline unsigned iminor(struct inode *inode) } #endif +/****************************** bitops.h **********************************/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) +#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) +#endif + #endif /* _KCOMPAT_H */ diff --git a/ubuntu/lirc/lirc_bt829/lirc_bt829.c b/ubuntu/lirc/lirc_bt829/lirc_bt829.c index d16e24c..c1d8630 100644 --- a/ubuntu/lirc/lirc_bt829/lirc_bt829.c +++ b/ubuntu/lirc/lirc_bt829/lirc_bt829.c @@ -31,8 +31,8 @@ #include #include -#include "../kcompat.h" -#include "../lirc_dev/lirc_dev.h" +#include "kcompat.h" +#include "lirc_dev/lirc_dev.h" static int poll_main(void); static int atir_init_start(void); diff --git a/ubuntu/lirc/lirc_dev/lirc_dev.c b/ubuntu/lirc/lirc_dev/lirc_dev.c index 7618c0a..e01cbed 100644 --- a/ubuntu/lirc/lirc_dev/lirc_dev.c +++ b/ubuntu/lirc/lirc_dev/lirc_dev.c @@ -61,7 +61,7 @@ #include #endif -#include "../kcompat.h" +#include "kcompat.h" /* SysFS header */ #if defined(LIRC_HAVE_SYSFS) @@ -69,7 +69,7 @@ #endif #include "../lirc.h" -#include "lirc_dev.h" +#include "../lirc_dev/lirc_dev.h" static int debug; #define dprintk(fmt, args...) \ diff --git a/ubuntu/lirc/lirc_ene0100/lirc_ene0100.c b/ubuntu/lirc/lirc_ene0100/lirc_ene0100.c index da9519f..719e925 100644 --- a/ubuntu/lirc/lirc_ene0100/lirc_ene0100.c +++ b/ubuntu/lirc/lirc_ene0100/lirc_ene0100.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "lirc_ene0100.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) @@ -81,7 +82,7 @@ static int ene_hw_irq_status(struct ene_device *dev, int *buffer_pointer) if (dev->hw_revision < ENE_HW_C) { irq_status = ene_hw_read_reg(dev, ENEB_IRQ_STATUS); - if (!irq_status & ENEB_IRQ_STATUS_IR) + if (!(irq_status & ENEB_IRQ_STATUS_IR)) return 0; ene_hw_write_reg(dev, ENEB_IRQ_STATUS, irq_status & ~ENEB_IRQ_STATUS_IR); @@ -92,7 +93,7 @@ static int ene_hw_irq_status(struct ene_device *dev, int *buffer_pointer) irq_status = ene_hw_read_reg(dev, ENEC_IRQ); - if (!irq_status && ENEC_IRQ_STATUS) + if (!(irq_status & ENEC_IRQ_STATUS)) return 0; /* original driver does that twice - a workaround ? */ diff --git a/ubuntu/lirc/lirc_i2c/lirc_i2c.c b/ubuntu/lirc/lirc_i2c/lirc_i2c.c index dca6b51..247c9c6 100644 --- a/ubuntu/lirc/lirc_i2c/lirc_i2c.c +++ b/ubuntu/lirc/lirc_i2c/lirc_i2c.c @@ -399,6 +399,7 @@ static struct i2c_driver driver = { .name = "i2c ir driver", }, #endif + // .id = I2C_DRIVERID_EXP3, /* FIXME */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) .attach_adapter = ir_probe, .detach_client = ir_remove, diff --git a/ubuntu/lirc/lirc_igorplugusb/lirc_igorplugusb.c b/ubuntu/lirc/lirc_igorplugusb/lirc_igorplugusb.c index 6705570..80e9506 100644 --- a/ubuntu/lirc/lirc_igorplugusb/lirc_igorplugusb.c +++ b/ubuntu/lirc/lirc_igorplugusb/lirc_igorplugusb.c @@ -363,7 +363,7 @@ static int usb_remote_poll(void *data, struct lirc_buffer *buf) "[%d]: SET_INFRABUFFER_EMPTY: error %d\n", ir->devnum, ret); return 0; - } else + } else if (ret < 0) printk(KERN_WARNING DRIVER_NAME "[%d]: GET_INFRACODE: error %d\n", ir->devnum, ret); @@ -562,9 +562,6 @@ static void usb_remote_disconnect(struct usb_device *dev, void *ptr) "[%d]: usb remote disconnected\n", ir->devnum); lirc_unregister_driver(ir->d->minor); - - lirc_buffer_free(ir->d->rbuf); - kfree(ir->d->rbuf); kfree(ir->d); diff --git a/ubuntu/lirc/lirc_imon/lirc_imon.c b/ubuntu/lirc/lirc_imon/lirc_imon.c index fcaa45f..0f45bd7 100644 --- a/ubuntu/lirc/lirc_imon/lirc_imon.c +++ b/ubuntu/lirc/lirc_imon/lirc_imon.c @@ -2,7 +2,7 @@ * lirc_imon.c: LIRC/VFD/LCD driver for SoundGraph iMON IR/VFD/LCD * including the iMON PAD model * - * $Id: lirc_imon.c,v 1.111 2009/09/11 04:56:18 jarodwilson Exp $ + * $Id: lirc_imon.c,v 1.113 2009/10/30 04:00:30 jarodwilson Exp $ * * Copyright(C) 2004 Venky Raju(dev@venky.ws) * @@ -565,7 +565,8 @@ static int display_close(struct inode *inode, struct file *file) } /** - * Sends a packet to the device + * Sends a packet to the device -- this function must be called + * with context->lock held. */ static int send_packet(struct imon_context *context) { @@ -743,7 +744,6 @@ static int send_set_imon_clock(struct imon_context *context, return -ENODEV; } - for (i = 0; i < IMON_CLOCK_ENABLE_PACKETS; i++) { memcpy(context->usb_tx_buf, clock_enable_pkt[i], 8); retval = send_packet(context); @@ -755,7 +755,6 @@ static int send_set_imon_clock(struct imon_context *context, } return retval; - } /** @@ -1097,13 +1096,6 @@ static void imon_set_ir_protocol(struct imon_context *context) switch (ir_protocol) { case IMON_IR_PROTOCOL_MCE: - /* MCE proto not supported on devices without tx control */ - if (!context->tx_control) { - printk(KERN_INFO "%s: MCE IR protocol not supported on " - "this device, using iMON protocol\n", __func__); - context->ir_protocol = IMON_IR_PROTOCOL_IMON; - return; - } dprintk("Configuring IR receiver for MCE protocol\n"); ir_proto_packet[0] = 0x01; context->ir_protocol = IMON_IR_PROTOCOL_MCE; @@ -1125,11 +1117,18 @@ static void imon_set_ir_protocol(struct imon_context *context) context->ir_protocol = IMON_IR_PROTOCOL_IMON; break; } - memcpy(context->usb_tx_buf, &ir_proto_packet, - sizeof(ir_proto_packet)); + + memcpy(context->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet)); + retval = send_packet(context); - if (retval) - printk(KERN_INFO "%s: failed to set remote type\n", __func__); + if (retval) { + printk(KERN_INFO "%s: failed to set IR protocol, falling back " + "to standard iMON protocol mode\n", __func__); + ir_protocol = IMON_IR_PROTOCOL_IMON; + context->ir_protocol = IMON_IR_PROTOCOL_IMON; + } + + return; } @@ -1152,8 +1151,11 @@ static int ir_open(void *data) context->rx.prev_bit = 0; /* set new IR protocol if it has changed since init or last open */ - if (ir_protocol != context->ir_protocol) + if (ir_protocol != context->ir_protocol) { + mutex_lock(&context->lock); imon_set_ir_protocol(context); + mutex_unlock(&context->lock); + } context->ir_isopen = 1; printk(KERN_INFO MOD_NAME ": IR port opened\n"); diff --git a/ubuntu/lirc/lirc_ite8709/lirc_ite8709.c b/ubuntu/lirc/lirc_ite8709/lirc_ite8709.c index bcbc2ad..4e0f766 100644 --- a/ubuntu/lirc/lirc_ite8709/lirc_ite8709.c +++ b/ubuntu/lirc/lirc_ite8709/lirc_ite8709.c @@ -21,6 +21,9 @@ #include #include +#include +#include +#include #include #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) #include diff --git a/ubuntu/lirc/lirc_mceusb/lirc_mceusb.c b/ubuntu/lirc/lirc_mceusb/lirc_mceusb.c index 0851769..4a0c771 100644 --- a/ubuntu/lirc/lirc_mceusb/lirc_mceusb.c +++ b/ubuntu/lirc/lirc_mceusb/lirc_mceusb.c @@ -10,14 +10,9 @@ * Copyright (c) 2003-2004 Dan Conti * * Original lirc_mceusb driver deprecated in favor of this driver, which - * supports the 1st-gen device now too. Transmitting on the 1st-gen device - * only functions on port #2 at the moment. - * - * Support for 1st-gen device added June 2009, - * by Jarod Wilson - * - * Initial transmission support for 1st-gen device added August 2009, - * by Patrick Calhoun + * supports the 1st-gen device now too. Transmit and receive support for + * the 1st-gen device added June-September 2009, + * by Jarod Wilson and Patrick Calhoun * * Derived from ATI USB driver by Paul Miller and the original * MCE USB driver by Dan Conti ((and now including chunks of the latter @@ -164,6 +159,8 @@ static struct usb_device_id mceusb_dev_table[] = { { USB_DEVICE(VENDOR_SMK, 0x0322) }, /* bundled with Hauppauge PVR-150 */ { USB_DEVICE(VENDOR_SMK, 0x0334) }, + /* SMK eHome Infrared Transceiver */ + { USB_DEVICE(VENDOR_SMK, 0x0338) }, /* Tatung eHome Infrared Transceiver */ { USB_DEVICE(VENDOR_TATUNG, 0x9150) }, /* Shuttle eHome Infrared Transceiver */ @@ -237,6 +234,7 @@ static struct usb_device_id microsoft_gen1_list[] = { }; static struct usb_device_id transmitter_mask_list[] = { + { USB_DEVICE(VENDOR_MICROSOFT, 0x006d) }, { USB_DEVICE(VENDOR_SMK, 0x031d) }, { USB_DEVICE(VENDOR_SMK, 0x0322) }, { USB_DEVICE(VENDOR_SMK, 0x0334) }, @@ -904,20 +902,20 @@ static int mceusb_gen1_init(struct mceusb_dev *ir) dprintk("%s - data[0] = %d, data[1] = %d\n", __func__, data[0], data[1]); - /* set feature */ + /* set feature: bit rate 38400 bps */ ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), USB_REQ_SET_FEATURE, USB_TYPE_VENDOR, 0xc04e, 0x0000, NULL, 0, HZ * 3); dprintk("%s - ret = %d\n", __func__, ret); - /* strange: bRequest == 4 */ + /* bRequest 4: set char length to 8 bits */ ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), 4, USB_TYPE_VENDOR, 0x0808, 0x0000, NULL, 0, HZ * 3); dprintk("%s - retB = %d\n", __func__, ret); - /* strange: bRequest == 2 */ + /* bRequest 2: set handshaking to use DTR/DSR */ ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), 2, USB_TYPE_VENDOR, 0x0000, 0x0100, NULL, 0, HZ * 3); diff --git a/ubuntu/lirc/lirc_serial/lirc_serial.c b/ubuntu/lirc/lirc_serial/lirc_serial.c index 9b25e38..e506658 100644 --- a/ubuntu/lirc/lirc_serial/lirc_serial.c +++ b/ubuntu/lirc/lirc_serial/lirc_serial.c @@ -62,6 +62,15 @@ #include +#if defined(CONFIG_SERIAL) || defined(CONFIG_SERIAL_8250) +#warning "******************************************" +#warning " Your serial port driver is compiled into " +#warning " the kernel. You will have to release the " +#warning " port you want to use for LIRC with: " +#warning " setserial /dev/ttySx uart none " +#warning "******************************************" +#endif + #include #include #include diff --git a/ubuntu/lirc/lirc_sir/lirc_sir.c b/ubuntu/lirc/lirc_sir/lirc_sir.c index ac91ec7..becaff7 100644 --- a/ubuntu/lirc/lirc_sir/lirc_sir.c +++ b/ubuntu/lirc/lirc_sir/lirc_sir.c @@ -46,6 +46,16 @@ #endif #include +#if !defined(CONFIG_SERIAL_MODULE) +#if !defined(LIRC_ON_SA1100) +#warning "******************************************" +#warning " Your serial port driver is compiled into " +#warning " the kernel. You will have to release the " +#warning " port you want to use for LIRC with: " +#warning " setserial /dev/ttySx uart none " +#warning "******************************************" +#endif +#endif #include #include @@ -423,7 +433,7 @@ static int lirc_ioctl(struct inode *node, struct file *filep, unsigned int cmd, case LIRC_SET_SEND_DUTY_CYCLE: retval = get_user(ivalue, (unsigned int *) arg); if (retval) - return reetval; + return retval; if (ivalue <= 0 || ivalue > 100) return -EINVAL; /* (ivalue/100)*(1000000/freq) */