rpms/kernel/devel kernel.spec, 1.1352, 1.1353 linux-2.6-hdpvr.patch, 1.4, 1.5 linux-2.6.29-lirc.patch, 1.3, 1.4
Jarod Wilson
jwilson at fedoraproject.org
Fri Feb 27 17:04:05 UTC 2009
- Previous message: rpms/gnome-power-manager/devel gnome-power-manager.spec, 1.147, 1.148
- Next message: rpms/bittorrent/devel bittorrent-4.4.0-formatstrings.patch, NONE, 1.1 bittorrent-4.4.0-syntax.patch, NONE, 1.1 bittorrent-4.4.0-threads-warning.patch, 1.1, 1.2 bittorrent.spec, 1.46, 1.47 bittorrent-5.0.1-shellbang.patch, 1.1, NONE bittorrent-5.0.5-wxversion.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: jwilson
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25015
Modified Files:
kernel.spec linux-2.6-hdpvr.patch linux-2.6.29-lirc.patch
Log Message:
* Fri Feb 27 2009 Jarod Wilson <jarod at redhat.com>
- minor lirc and hdpvr patch updates from respective upstreams
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1352
retrieving revision 1.1353
diff -u -r1.1352 -r1.1353
--- kernel.spec 27 Feb 2009 07:59:41 -0000 1.1352
+++ kernel.spec 27 Feb 2009 17:03:34 -0000 1.1353
@@ -1790,6 +1790,9 @@
# and build.
%changelog
+* Fri Feb 27 2009 Jarod Wilson <jarod at redhat.com>
+- minor lirc and hdpvr patch updates from respective upstreams
+
* Fri Feb 27 2009 Kyle McMartin <kyle at redhat.com> 2.6.29-0.172.rc6.git4
- avoid a 64-bit divide which generates a libgcc __udivdi3 call
in drm-nouveau. maybe.
linux-2.6-hdpvr.patch:
Index: linux-2.6-hdpvr.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-hdpvr.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-hdpvr.patch 27 Jan 2009 02:39:42 -0000 1.4
+++ linux-2.6-hdpvr.patch 27 Feb 2009 17:03:34 -0000 1.5
@@ -1,3 +1,24 @@
+Video capture driver for the Hauppauge HD PVR
+
+upstream: http://hg.jannau.net/hdpvr/
+product info: http://hauppauge.com/site/products/data_hdpvr.html
+
+Signed-off-by: Jarod Wilson <jarod at redhat.com>
+
+---
+ drivers/media/video/Kconfig | 2 +
+ drivers/media/video/Makefile | 2 +
+ drivers/media/video/hdpvr/Kconfig | 10 +
+ drivers/media/video/hdpvr/Makefile | 7 +
+ drivers/media/video/hdpvr/hdpvr-control.c | 212 +++++
+ drivers/media/video/hdpvr/hdpvr-core.c | 461 +++++++++++
+ drivers/media/video/hdpvr/hdpvr-i2c.c | 145 ++++
+ drivers/media/video/hdpvr/hdpvr-video.c | 1258 +++++++++++++++++++++++++++++
+ drivers/media/video/hdpvr/hdpvr.h | 326 ++++++++
+ drivers/media/video/v4l2-common.c | 3 +
+ include/linux/i2c-id.h | 1 +
+ 11 files changed, 2427 insertions(+), 0 deletions(-)
+
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 19cf3b8..4f29e1a 100644
--- a/drivers/media/video/Kconfig
@@ -12,18 +33,18 @@
source "drivers/media/video/usbvision/Kconfig"
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
-index 72f6d03..35ff442 100644
+index 72f6d03..e7e4508 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
-@@ -122,6 +122,8 @@ obj-$(CONFIG_USB_PWC) += pwc/
- obj-$(CONFIG_USB_ZC0301) += zc0301/
- obj-$(CONFIG_USB_GSPCA) += gspca/
+@@ -128,6 +128,8 @@ obj-$(CONFIG_USB_VICAM) += usbvideo/
+ obj-$(CONFIG_USB_QUICKCAM_MESSENGER) += usbvideo/
+ obj-$(CONFIG_USB_S2255) += s2255drv.o
-+obj-$(CONFIG_VIDEO_HDPVR) += hdpvr/
++obj-$(CONFIG_VIDEO_HDPVR) += hdpvr/
+
- obj-$(CONFIG_USB_IBMCAM) += usbvideo/
- obj-$(CONFIG_USB_KONICAWC) += usbvideo/
- obj-$(CONFIG_USB_VICAM) += usbvideo/
+ obj-$(CONFIG_VIDEO_IVTV) += ivtv/
+ obj-$(CONFIG_VIDEO_CX18) += cx18/
+
diff --git a/drivers/media/video/hdpvr/Kconfig b/drivers/media/video/hdpvr/Kconfig
new file mode 100644
index 0000000..de247f3
@@ -273,10 +294,10 @@
+}
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
new file mode 100644
-index 0000000..19e5282
+index 0000000..394309a
--- /dev/null
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
-@@ -0,0 +1,455 @@
+@@ -0,0 +1,461 @@
+/*
+ * Hauppage HD PVR USB driver
+ *
@@ -336,6 +357,8 @@
+/* table of devices that work with this driver */
+static struct usb_device_id hdpvr_table [] = {
+ { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID) },
++ { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID1) },
++ { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID2) },
+ { } /* Terminating entry */
+};
+MODULE_DEVICE_TABLE(usb, hdpvr_table);
@@ -452,6 +475,10 @@
+ dev->flags &= ~HDPVR_FLAG_AC3_CAP;
+ } else if (buf[1] == HDPVR_FIRMWARE_VERSION_AC3) {
+ dev->flags |= HDPVR_FLAG_AC3_CAP;
++ } else if (buf[1] > HDPVR_FIRMWARE_VERSION_AC3) {
++ hdpvr_print("untested firmware version 0x%x, the driver might "
++ "not work", buf[1]);
++ dev->flags |= HDPVR_FLAG_AC3_CAP;
+ } else {
+ hdpvr_err("unknown firmware version 0x%x", buf[1]);
+ ret = -EINVAL;
@@ -885,7 +912,7 @@
+}
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
new file mode 100644
-index 0000000..0297f91
+index 0000000..33788d0
--- /dev/null
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -0,0 +1,1258 @@
@@ -1253,7 +1280,7 @@
+ return retval;
+}
+
-+#if 0
++
+static void hdpvr_draw_down(struct hdpvr_device *dev)
+{
+ hdpvr_trace("status = %d", dev->status);
@@ -1279,7 +1306,6 @@
+
+ return 0;
+}
-+#endif
+
+static int hdpvr_release(struct file *file)
+{
@@ -1456,8 +1482,7 @@
+}
+
+
-+static long hdpvr_ioctl(struct file *filp, unsigned int cmd,
-+ unsigned long arg)
++static long hdpvr_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+ struct hdpvr_fh *fh = (struct hdpvr_fh *)filp->private_data;
+ struct hdpvr_device *dev = fh->dev;
@@ -1501,10 +1526,9 @@
+ .owner = THIS_MODULE,
+ .open = hdpvr_open,
+ .release = hdpvr_release,
-+/* .flush = hdpvr_flush, */
+ .read = hdpvr_read,
+ .poll = hdpvr_poll,
-+ .ioctl = hdpvr_ioctl,
++ .unlocked_ioctl = hdpvr_ioctl,
+};
+
+/*=======================================================================*/
@@ -1515,8 +1539,11 @@
+static int vidioc_querycap(struct file *file, void *priv,
+ struct v4l2_capability *cap)
+{
++ struct hdpvr_device *dev = video_drvdata(file);
++
+ strcpy(cap->driver, "hdpvr");
+ strcpy(cap->card, "Haupauge HD PVR");
++ usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
+ cap->version = HDPVR_VERSION;
+ cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
+ V4L2_CAP_AUDIO |
@@ -2149,10 +2176,10 @@
+}
diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h
new file mode 100644
-index 0000000..ffe3a36
+index 0000000..1514742
--- /dev/null
+++ b/drivers/media/video/hdpvr/hdpvr.h
-@@ -0,0 +1,324 @@
+@@ -0,0 +1,326 @@
+/*
+ * Hauppage HD PVR USB driver
+ *
@@ -2180,6 +2207,8 @@
+/* Define these values to match your devices */
+#define HD_PVR_VENDOR_ID 0x2040
+#define HD_PVR_PRODUCT_ID 0x4900
++#define HD_PVR_PRODUCT_ID1 0x4901
++#define HD_PVR_PRODUCT_ID2 0x4902
+
+#define UNSET (-1U)
+
linux-2.6.29-lirc.patch:
Index: linux-2.6.29-lirc.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6.29-lirc.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-2.6.29-lirc.patch 30 Jan 2009 19:15:58 -0000 1.3
+++ linux-2.6.29-lirc.patch 27 Feb 2009 17:03:34 -0000 1.4
@@ -1,30 +1,55 @@
+Linux Infrared Remote Control drivers (http://www.lirc.org/)
+
+Signed-off-by: Jarod Wilson <jarod at redhat.com>
+
+---
+ MAINTAINERS | 9 +
drivers/input/Kconfig | 2 +
drivers/input/Makefile | 2 +
drivers/input/lirc/Kconfig | 118 +++
drivers/input/lirc/Makefile | 21 +
drivers/input/lirc/lirc.h | 100 +++
drivers/input/lirc/lirc_bt829.c | 381 +++++++++
- drivers/input/lirc/lirc_dev.c | 754 ++++++++++++++++++
- drivers/input/lirc/lirc_dev.h | 178 +++++
- drivers/input/lirc/lirc_i2c.c | 649 ++++++++++++++++
- drivers/input/lirc/lirc_igorplugusb.c | 554 +++++++++++++
- drivers/input/lirc/lirc_imon.c | 1369 ++++++++++++++++++++++++++++++++
- drivers/input/lirc/lirc_it87.c | 984 +++++++++++++++++++++++
+ drivers/input/lirc/lirc_dev.c | 853 +++++++++++++++++++
+ drivers/input/lirc/lirc_dev.h | 180 ++++
+ drivers/input/lirc/lirc_i2c.c | 649 +++++++++++++++
+ drivers/input/lirc/lirc_igorplugusb.c | 555 +++++++++++++
+ drivers/input/lirc/lirc_imon.c | 1459 +++++++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_it87.c | 984 ++++++++++++++++++++++
drivers/input/lirc/lirc_it87.h | 116 +++
- drivers/input/lirc/lirc_ite8709.c | 539 +++++++++++++
- drivers/input/lirc/lirc_mceusb.c | 784 +++++++++++++++++++
- drivers/input/lirc/lirc_mceusb2.c | 1119 ++++++++++++++++++++++++++
- drivers/input/lirc/lirc_parallel.c | 709 +++++++++++++++++
+ drivers/input/lirc/lirc_ite8709.c | 539 ++++++++++++
+ drivers/input/lirc/lirc_mceusb.c | 747 +++++++++++++++++
+ drivers/input/lirc/lirc_mceusb2.c | 1097 +++++++++++++++++++++++++
+ drivers/input/lirc/lirc_parallel.c | 709 ++++++++++++++++
drivers/input/lirc/lirc_parallel.h | 26 +
- drivers/input/lirc/lirc_sasem.c | 933 ++++++++++++++++++++++
- drivers/input/lirc/lirc_serial.c | 1321 +++++++++++++++++++++++++++++++
- drivers/input/lirc/lirc_sir.c | 1294 ++++++++++++++++++++++++++++++
- drivers/input/lirc/lirc_streamzap.c | 772 ++++++++++++++++++
- drivers/input/lirc/lirc_ttusbir.c | 396 ++++++++++
- drivers/input/lirc/lirc_zilog.c | 1382 +++++++++++++++++++++++++++++++++
-
- 24 files changed, 14503 insertions(+), 0 deletions(-)
+ drivers/input/lirc/lirc_sasem.c | 933 +++++++++++++++++++++
+ drivers/input/lirc/lirc_serial.c | 1321 +++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_sir.c | 1294 +++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_streamzap.c | 773 +++++++++++++++++
+ drivers/input/lirc/lirc_ttusbir.c | 398 +++++++++
+ drivers/input/lirc/lirc_zilog.c | 1382 +++++++++++++++++++++++++++++++
+ 25 files changed, 14648 insertions(+), 0 deletions(-)
+diff --git a/MAINTAINERS b/MAINTAINERS
+index 59fd2d1..ad1b16c 100644
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -2749,6 +2749,15 @@ W: http://www.pasemi.com/
+ L: linuxppc-dev at ozlabs.org
+ S: Supported
+
++LINUX INFRARED REMOTE CONTROL DRIVERS (LIRC)
++P: Jarod Wilson
++M: jarod at redhat.com
++P: Christoph Bartelmus
++M: lirc at bartelmus.de
++W: http://www.lirc.org/
++L: lirc-list at lists.sourceforge.net
++S: Maintained
++
+ LINUX SECURITY MODULE (LSM) FRAMEWORK
+ P: Chris Wright
+ M: chrisw at sous-sol.org
diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig
index 5f9d860..2ba0904 100644
--- a/drivers/input/Kconfig
@@ -39,7 +64,7 @@
endif
diff --git a/drivers/input/Makefile b/drivers/input/Makefile
-index 98c4f9a..6a1049b 100644
+index 4c9c745..99e2b5e 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -25,3 +25,5 @@ obj-$(CONFIG_INPUT_MISC) += misc/
@@ -201,7 +226,7 @@
+obj-$(CONFIG_LIRC_ZILOG) += lirc_zilog.o
diff --git a/drivers/input/lirc/lirc.h b/drivers/input/lirc/lirc.h
new file mode 100644
-index 0000000..b6d124e
+index 0000000..599b21c
--- /dev/null
+++ b/drivers/input/lirc/lirc.h
@@ -0,0 +1,100 @@
@@ -270,27 +295,27 @@
+
+/*** IOCTL commands for lirc driver ***/
+
-+#define LIRC_GET_FEATURES _IOR('i', 0x00000000, __u32)
++#define LIRC_GET_FEATURES _IOR('i', 0x00000000, unsigned long)
+
-+#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32)
-+#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32)
-+#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, __u32)
-+#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, __u32)
-+#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, __u32)
-+#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, __u32)
-+#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32)
++#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, unsigned long)
++#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, unsigned long)
++#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, unsigned int)
++#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, unsigned int)
++#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, unsigned int)
++#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, unsigned int)
++#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, unsigned int)
+
+/* code length in bits, currently only for LIRC_MODE_LIRCCODE */
-+#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32)
++#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, unsigned long)
+
-+#define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, __u32)
-+#define LIRC_SET_REC_MODE _IOW('i', 0x00000012, __u32)
++#define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, unsigned long)
++#define LIRC_SET_REC_MODE _IOW('i', 0x00000012, unsigned long)
+/* Note: these can reset the according pulse_width */
-+#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32)
-+#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32)
-+#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32)
-+#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32)
-+#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32)
++#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, unsigned int)
++#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, unsigned int)
++#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, unsigned int)
++#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, unsigned int)
++#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, unsigned int)
+
+/*
+ * to set a range use
@@ -299,15 +324,15 @@
+ * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound
+ */
+
-+#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32)
-+#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32)
++#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, unsigned int)
++#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, unsigned int)
+
+#define LIRC_NOTIFY_DECODE _IO('i', 0x00000020)
+
+#endif
diff --git a/drivers/input/lirc/lirc_bt829.c b/drivers/input/lirc/lirc_bt829.c
new file mode 100644
-index 0000000..581f6e2
+index 0000000..7981849
--- /dev/null
+++ b/drivers/input/lirc/lirc_bt829.c
@@ -0,0 +1,381 @@
@@ -690,14 +715,14 @@
+MODULE_DESCRIPTION("IR remote driver for bt829 based TV cards");
+MODULE_LICENSE("GPL");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/input/lirc/lirc_dev.c b/drivers/input/lirc/lirc_dev.c
new file mode 100644
-index 0000000..e7b52c4
+index 0000000..dddd999
--- /dev/null
+++ b/drivers/input/lirc/lirc_dev.c
-@@ -0,0 +1,754 @@
+@@ -0,0 +1,853 @@
+/*
+ * LIRC base driver
+ *
@@ -735,6 +760,10 @@
+#include <linux/bitops.h>
+#include <linux/device.h>
+#include <linux/cdev.h>
++#include <linux/smp_lock.h>
++#ifdef CONFIG_COMPAT
++#include <linux/compat.h>
++#endif
+
+#include "lirc.h"
+#include "lirc_dev.h"
@@ -861,6 +890,9 @@
+ .write = lirc_dev_fop_write,
+ .poll = lirc_dev_fop_poll,
+ .ioctl = lirc_dev_fop_ioctl,
++#ifdef CONFIG_COMPAT
++ .compat_ioctl = lirc_dev_fop_compat_ioctl,
++#endif
+ .open = lirc_dev_fop_open,
+ .release = lirc_dev_fop_close,
+ .owner = THIS_MODULE,
@@ -1000,9 +1032,8 @@
+ d->name[sizeof(d->name)-1] = '\0';
+
+ bytes_in_key = BITS_TO_LONGS(d->code_length);
-+
-+ chunk_size = d->chunk_size ? d->chunk_size : bytes_in_key;
+ buffer_size = d->buffer_size ? d->buffer_size : BUFLEN / bytes_in_key;
++ chunk_size = d->chunk_size ? d->chunk_size : bytes_in_key;
+
+ if (d->rbuf) {
+ ir->buf = d->rbuf;
@@ -1277,8 +1308,7 @@
+ */
+ break;
+ case LIRC_GET_LENGTH:
-+ result = put_user((unsigned long)ir->d.code_length,
-+ (unsigned long *)arg);
++ result = put_user(ir->d.code_length, (unsigned long *)arg);
+ break;
+ default:
+ result = -EINVAL;
@@ -1291,6 +1321,100 @@
+}
+EXPORT_SYMBOL(lirc_dev_fop_ioctl);
+
++#ifdef CONFIG_COMPAT
++#define LIRC_GET_FEATURES_COMPAT32 _IOR('i', 0x00000000, __u32)
++
++#define LIRC_GET_SEND_MODE_COMPAT32 _IOR('i', 0x00000001, __u32)
++#define LIRC_GET_REC_MODE_COMPAT32 _IOR('i', 0x00000002, __u32)
++
++#define LIRC_GET_LENGTH_COMPAT32 _IOR('i', 0x0000000f, __u32)
++
++#define LIRC_SET_SEND_MODE_COMPAT32 _IOW('i', 0x00000011, __u32)
++#define LIRC_SET_REC_MODE_COMPAT32 _IOW('i', 0x00000012, __u32)
++
++long lirc_dev_fop_compat_ioctl(struct file *file,
++ unsigned int cmd32,
++ unsigned long arg)
++{
++ mm_segment_t old_fs;
++ int ret;
++ unsigned long val;
++ unsigned int cmd;
++
++ switch (cmd32) {
++ case LIRC_GET_FEATURES_COMPAT32:
++ case LIRC_GET_SEND_MODE_COMPAT32:
++ case LIRC_GET_REC_MODE_COMPAT32:
++ case LIRC_GET_LENGTH_COMPAT32:
++ case LIRC_SET_SEND_MODE_COMPAT32:
++ case LIRC_SET_REC_MODE_COMPAT32:
++ /*
++ * These commands expect (unsigned long *) arg
++ * but the 32-bit app supplied (__u32 *).
++ * Conversion is required.
++ */
++ if (get_user(val, (__u32 *)compat_ptr(arg)))
++ return -EFAULT;
++ lock_kernel();
++ /*
++ * tell lirc_dev_fop_ioctl that it's safe to use the pointer
++ * to val which is in kernel address space and not in
++ * user address space.
++ */
++ old_fs = get_fs();
++ set_fs(KERNEL_DS);
++
++ cmd = _IOC(_IOC_DIR(cmd32), _IOC_TYPE(cmd32), _IOC_NR(cmd32),
++ (_IOC_TYPECHECK(unsigned long)));
++ ret = lirc_dev_fop_ioctl(file->f_path.dentry->d_inode, file,
++ cmd, (unsigned long)(&val));
++
++ set_fs(old_fs);
++ unlock_kernel();
++ switch (cmd) {
++ case LIRC_GET_FEATURES:
++ case LIRC_GET_SEND_MODE:
++ case LIRC_GET_REC_MODE:
++ case LIRC_GET_LENGTH:
++ if (!ret && put_user(val, (__u32 *)compat_ptr(arg)))
++ return -EFAULT;
++ break;
++ }
++ return ret;
++
++ case LIRC_GET_SEND_CARRIER:
++ case LIRC_GET_REC_CARRIER:
++ case LIRC_GET_SEND_DUTY_CYCLE:
++ case LIRC_GET_REC_DUTY_CYCLE:
++ case LIRC_GET_REC_RESOLUTION:
++ case LIRC_SET_SEND_CARRIER:
++ case LIRC_SET_REC_CARRIER:
++ case LIRC_SET_SEND_DUTY_CYCLE:
++ case LIRC_SET_REC_DUTY_CYCLE:
++ case LIRC_SET_TRANSMITTER_MASK:
++ case LIRC_SET_REC_DUTY_CYCLE_RANGE:
++ case LIRC_SET_REC_CARRIER_RANGE:
++ /*
++ * These commands expect (unsigned int *)arg
++ * so no problems here. Just handle the locking.
++ */
++ lock_kernel();
++ cmd = cmd32;
++ ret = lirc_dev_fop_ioctl(file->f_path.dentry->d_inode,
++ file, cmd, arg);
++ unlock_kernel();
++ return ret;
++ default:
++ /* unknown */
++ printk(KERN_ERR "lirc_dev: %s(%s:%d): Unknown cmd %08x\n",
++ __func__, current->comm, current->pid, cmd32);
++ return -ENOIOCTLCMD;
++ }
++}
++EXPORT_SYMBOL(lirc_dev_fop_compat_ioctl);
++#endif
++
++
+ssize_t lirc_dev_fop_read(struct file *file,
+ char *buffer,
+ size_t length,
@@ -1450,14 +1574,14 @@
+MODULE_AUTHOR("Artur Lipowski");
+MODULE_LICENSE("GPL");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_dev.h b/drivers/input/lirc/lirc_dev.h
new file mode 100644
-index 0000000..bf05a7c
+index 0000000..b12d519
--- /dev/null
+++ b/drivers/input/lirc/lirc_dev.h
-@@ -0,0 +1,178 @@
+@@ -0,0 +1,180 @@
+/*
+ * LIRC base driver
+ *
@@ -1544,12 +1668,12 @@
+struct lirc_driver {
+ char name[40];
+ int minor;
-+ int code_length;
++ unsigned long code_length;
++ unsigned int buffer_size; /* in chunks holding one code each */
+ int sample_rate;
+ unsigned long features;
+
+ unsigned int chunk_size;
-+ unsigned int buffer_size; /* in chunks */
+
+ void *data;
+ int (*add_to_buf) (void *data, struct lirc_buffer *buf);
@@ -1634,11 +1758,13 @@
+ loff_t *ppos);
+ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length,
+ loff_t *ppos);
++long lirc_dev_fop_compat_ioctl(struct file *file, unsigned int cmd32,
++ unsigned long arg);
+
+#endif
diff --git a/drivers/input/lirc/lirc_i2c.c b/drivers/input/lirc/lirc_i2c.c
new file mode 100644
-index 0000000..01a4ced
+index 0000000..dedf415
--- /dev/null
+++ b/drivers/input/lirc/lirc_i2c.c
@@ -0,0 +1,649 @@
@@ -2283,20 +2409,20 @@
+ "Ulrich Mueller, Stefan Jahn, Jerome Brock");
+MODULE_LICENSE("GPL");
+
-+module_param(minor, int, 0444);
++module_param(minor, int, S_IRUGO);
+MODULE_PARM_DESC(minor, "Preferred minor device number");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
+
+module_init(lirc_i2c_init);
+module_exit(lirc_i2c_exit);
diff --git a/drivers/input/lirc/lirc_igorplugusb.c b/drivers/input/lirc/lirc_igorplugusb.c
new file mode 100644
-index 0000000..7dd8844
+index 0000000..51ccd1c
--- /dev/null
+++ b/drivers/input/lirc/lirc_igorplugusb.c
-@@ -0,0 +1,554 @@
+@@ -0,0 +1,555 @@
+/*
+ * lirc_igorplugusb - USB remote support for LIRC
+ *
@@ -2725,7 +2851,7 @@
+ driver->set_use_dec = &set_use_dec;
+ driver->sample_rate = sample_rate; /* per second */
+ driver->add_to_buf = &usb_remote_poll;
-+ driver->dev = &dev->dev;
++ driver->dev = &intf->dev;
+ driver->owner = THIS_MODULE;
+
+ init_waitqueue_head(&ir->wait_out);
@@ -2760,10 +2886,11 @@
+
+ if (dev->descriptor.iManufacturer
+ && usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
-+ strncpy(name, buf, 128);
++ strlcpy(name, buf, sizeof(name));
+ if (dev->descriptor.iProduct
+ && usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
-+ snprintf(name, 128, "%s %s", name, buf);
++ snprintf(name + strlen(name), sizeof(name) - strlen(name),
++ " %s", buf);
+ printk(DRIVER_NAME "[%d]: %s on usb%d:%d\n", devnum, name,
+ dev->bus->busnum, devnum);
+
@@ -2848,15 +2975,15 @@
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(usb, usb_remote_id_table);
+
-+module_param(sample_rate, int, 0644);
++module_param(sample_rate, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(sample_rate, "Sampling rate in Hz (default: 100)");
+
diff --git a/drivers/input/lirc/lirc_imon.c b/drivers/input/lirc/lirc_imon.c
new file mode 100644
-index 0000000..a0d052a
+index 0000000..5655a0d
--- /dev/null
+++ b/drivers/input/lirc/lirc_imon.c
-@@ -0,0 +1,1369 @@
+@@ -0,0 +1,1459 @@
+/*
+ * lirc_imon.c: LIRC/VFD/LCD driver for Ahanix/Soundgraph IMON IR/VFD/LCD
+ * including the iMON PAD model
@@ -2885,6 +3012,7 @@
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+#include <linux/usb.h>
++#include <linux/time.h>
+
+#include "lirc.h"
+#include "lirc_dev.h"
@@ -2912,7 +3040,7 @@
+static void usb_rx_callback(struct urb *urb);
+static void usb_tx_callback(struct urb *urb);
+
-+/* Display file_operations function prototypes */
++/* display file_operations function prototypes */
+static int display_open(struct inode *inode, struct file *file);
+static int display_close(struct inode *inode, struct file *file);
+
@@ -2937,14 +3065,14 @@
+struct imon_context {
+ struct usb_device *usbdev;
+ int display_supported; /* not all controllers do */
-+ int display_isopen; /* Display port has been opened */
++ int display_isopen; /* display port has been opened */
+ int ir_isopen; /* IR port open */
+ int ir_isassociating; /* IR port open for association */
+ int dev_present; /* USB device presence */
+ struct mutex lock; /* to lock this object */
+ wait_queue_head_t remove_ok; /* For unexpected USB disconnects */
+
-+ int display_proto_6p; /* Display requires 6th packet */
++ int display_proto_6p; /* display requires 6th packet */
+ int ir_onboard_decode; /* IR signals decoded onboard */
+
+ struct lirc_driver *driver;
@@ -2970,7 +3098,7 @@
+ } tx;
+};
+
-+/* Display file operations. Nb: lcd_write will be subbed in as needed later */
++/* display file operations. Nb: lcd_write will be subbed in as needed later */
+static struct file_operations display_fops = {
+ .owner = THIS_MODULE,
+ .open = &display_open,
@@ -2995,7 +3123,7 @@
+ { USB_DEVICE(0x04e8, 0xff30) },
+ /* iMON USB Control Board (IR & VFD) */
+ { USB_DEVICE(0x15c2, 0xffda) },
-+ /* iMON USB Control Board (IR & LCD) *and* iMon Knob (IR only) */
++ /* iMON USB Control Board (IR & LCD) *and* iMON Knob (IR only) */
+ { USB_DEVICE(0x15c2, 0xffdc) },
+ /* iMON USB Control Board (IR & LCD) */
+ { USB_DEVICE(0x15c2, 0x0034) },
@@ -3033,7 +3161,7 @@
+static unsigned char display_packet6[] = {
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF };
+
-+/* newer iMon models use control endpoints */
++/* newer iMON models use control endpoints */
+static struct usb_device_id ctl_ep_device_list[] = {
+ { USB_DEVICE(0x15c2, 0x0034) },
+ { USB_DEVICE(0x15c2, 0x0036) },
@@ -3046,7 +3174,7 @@
+ {}
+};
+
-+/* iMon LCD models user a different write op */
++/* iMON LCD models user a different write op */
+static struct usb_device_id lcd_device_list[] = {
+ { USB_DEVICE(0x15c2, 0xffdc) },
+ { USB_DEVICE(0x15c2, 0x0034) },
@@ -3055,7 +3183,7 @@
+ {}
+};
+
-+/* iMon devices with front panel buttons need a larger buffer */
++/* iMON devices with front panel buttons need a larger buffer */
+static struct usb_device_id large_buffer_list[] = {
+ { USB_DEVICE(0x15c2, 0x0038) },
+ { USB_DEVICE(0x15c2, 0x0045) },
@@ -3075,7 +3203,7 @@
+ {}
+};
+
-+/* Some iMon devices have no lcd/vfd, don't set one up */
++/* Some iMON devices have no lcd/vfd, don't set one up */
+static struct usb_device_id ir_only_list[] = {
+ { USB_DEVICE(0x0aa8, 0x8001) },
+ { USB_DEVICE(0x04e8, 0xff30) },
@@ -3117,9 +3245,9 @@
+MODULE_VERSION(MOD_VERSION);
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(usb, imon_usb_id_table);
-+module_param(debug, int, 0);
++module_param(debug, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)");
-+module_param(display_type, int, 0);
++module_param(display_type, int, S_IRUGO);
+MODULE_PARM_DESC(display_type, "Type of attached display. 0=autodetect, "
+ "1=vfd, 2=lcd, 3=none (default: autodetect)");
+
@@ -3152,7 +3280,7 @@
+}
+
+/**
-+ * Called when the Display device (e.g. /dev/lcd0)
++ * Called when the display device (e.g. /dev/lcd0)
+ * is opened by the application.
+ */
+static int display_open(struct inode *inode, struct file *file)
@@ -3185,15 +3313,15 @@
+ mutex_lock(&context->lock);
+
+ if (!context->display_supported) {
-+ err("%s: Display not supported by device", __func__);
++ err("%s: display not supported by device", __func__);
+ retval = -ENODEV;
+ } else if (context->display_isopen) {
-+ err("%s: Display port is already open", __func__);
++ err("%s: display port is already open", __func__);
+ retval = -EBUSY;
+ } else {
+ context->display_isopen = 1;
+ file->private_data = context;
-+ printk(KERN_INFO "Display port opened\n");
++ printk(KERN_INFO "display port opened\n");
+ }
+
+ mutex_unlock(&context->lock);
@@ -3204,7 +3332,7 @@
+}
+
+/**
-+ * Called when the Display device (e.g. /dev/lcd0)
++ * Called when the display device (e.g. /dev/lcd0)
+ * is closed by the application.
+ */
+static int display_close(struct inode *inode, struct file *file)
@@ -3222,14 +3350,14 @@
+ mutex_lock(&context->lock);
+
+ if (!context->display_supported) {
-+ err("%s: Display not supported by device", __func__);
++ err("%s: display not supported by device", __func__);
+ retval = -ENODEV;
+ } else if (!context->display_isopen) {
-+ err("%s: Display is not open", __func__);
++ err("%s: display is not open", __func__);
+ retval = -EIO;
+ } else {
+ context->display_isopen = 0;
-+ printk(KERN_INFO "Display port closed\n");
++ printk(KERN_INFO "display port closed\n");
+ if (!context->dev_present && !context->ir_isopen) {
+ /*
+ * Device disconnected before close and IR port is not
@@ -3247,7 +3375,7 @@
+}
+
+/**
-+ * Sends a packet to the Display.
++ * Sends a packet to the display.
+ */
+static int send_packet(struct imon_context *context)
+{
@@ -3698,18 +3826,113 @@
+ return;
+}
+
++static inline int tv2int(const struct timeval *a, const struct timeval *b)
++{
++ int usecs = 0;
++ int sec = 0;
++
++ if (b->tv_usec > a->tv_usec) {
++ usecs = 1000000;
++ sec--;
++ }
++
++ usecs += a->tv_usec - b->tv_usec;
++
++ sec += a->tv_sec - b->tv_sec;
++ sec *= 1000;
++ usecs /= 1000;
++ sec += usecs;
++
++ if (sec < 0)
++ sec = 1000;
++
++ return sec;
++}
++
++/**
++ * The directional pad is overly sensitive in keyboard mode, so we do some
++ * interesting contortions to make it less touchy.
++ */
++#define IMON_PAD_TIMEOUT 1000 /* in msecs */
++#define IMON_PAD_THRESHOLD 80 /* 160x160 square */
++static int stabilize(int a, int b)
++{
++ struct timeval ct;
++ static struct timeval prev_time = {0, 0};
++ static struct timeval hit_time = {0, 0};
++ static int x, y, prev_result, hits;
++ int result = 0;
++ int msec, msec_hit;
++
++ do_gettimeofday(&ct);
++ msec = tv2int(&ct, &prev_time);
++ msec_hit = tv2int(&ct, &hit_time);
++
++ if (msec > 100) {
++ x = 0;
++ y = 0;
++ hits = 0;
++ }
++
++ x += a;
++ y += b;
++
++ prev_time = ct;
++
++ if (abs(x) > IMON_PAD_THRESHOLD || abs(y) > IMON_PAD_THRESHOLD) {
++ if (abs(y) > abs(x))
++ result = (y > 0) ? 0x7F : 0x80;
++ else
++ result = (x > 0) ? 0x7F00 : 0x8000;
++
++ x = 0;
++ y = 0;
++
++ if (result == prev_result) {
++ hits++;
++
++ if (hits > 3) {
++ switch (result) {
++ case 0x7F:
++ y = 17 * IMON_PAD_THRESHOLD / 30;
++ break;
++ case 0x80:
++ y -= 17 * IMON_PAD_THRESHOLD / 30;
++ break;
++ case 0x7F00:
++ x = 17 * IMON_PAD_THRESHOLD / 30;
++ break;
++ case 0x8000:
++ x -= 17 * IMON_PAD_THRESHOLD / 30;
++ break;
++ }
++ }
++
++ if (hits == 2 && msec_hit < IMON_PAD_TIMEOUT) {
++ result = 0;
++ hits = 1;
++ }
++ } else {
++ prev_result = result;
++ hits = 1;
++ hit_time = ct;
++ }
++ }
++
++ return result;
++}
++
+/**
+ * Process the incoming packet
+ */
+static void incoming_packet(struct imon_context *context,
-+ struct urb *urb)
++ struct urb *urb)
+{
+ int len = urb->actual_length;
+ unsigned char *buf = urb->transfer_buffer;
+ int octet, bit;
+ unsigned char mask;
-+ int chunk_num;
-+ int i;
++ int i, chunk_num, dir;
+
+ /*
+ * we need to add some special handling for
@@ -3731,17 +3954,11 @@
+ * try to ignore when they get too close
+ */
+ if ((buf[1] == 0) && ((buf[2] != 0) || (buf[3] != 0))) {
-+ int y = (int)(char)buf[2];
-+ int x = (int)(char)buf[3];
-+ if (abs(abs(x) - abs(y)) < 3) {
++ dir = stabilize((int)(char)buf[2], (int)(char)buf[3]);
++ if (!dir)
+ return;
-+ } else if (abs(y) > abs(x)) {
-+ buf[2] = 0x00;
-+ buf[3] = (y > 0) ? 0x7f : 0x80;
-+ } else {
-+ buf[3] = 0x00;
-+ buf[2] = (x > 0) ? 0x7f : 0x80;
-+ }
++ buf[2] = dir & 0xFF;
++ buf[3] = (dir >> 8) & 0xFF;
+ }
+ }
+
@@ -3930,7 +4147,7 @@
+ /*
+ * Scan the endpoint list and set:
+ * first input endpoint = IR endpoint
-+ * first output endpoint = Display endpoint
++ * first output endpoint = display endpoint
+ */
+ for (i = 0; i < num_endpts && !(ir_ep_found && display_ep_found); ++i) {
+ struct usb_endpoint_descriptor *ep;
@@ -3963,7 +4180,7 @@
+
+ /*
+ * If we didn't find a display endpoint, this is probably one of the
-+ * newer iMon devices that use control urb instead of interrupt
++ * newer iMON devices that use control urb instead of interrupt
+ */
+ if (!display_ep_found) {
+ if (usb_match_id(interface, ctl_ep_device_list)) {
@@ -3977,7 +4194,7 @@
+ }
+
+ /*
-+ * Some iMon receivers have no display. Unfortunately, it seems
++ * Some iMON receivers have no display. Unfortunately, it seems
+ * that SoundGraph recycles device IDs between devices both with
+ * and without... :\
+ */
@@ -4006,7 +4223,7 @@
+ ir_onboard_decode);
+ }
+
-+ /* Determine if Display requires 6 packets */
++ /* Determine if display requires 6 packets */
+ if (display_ep_found) {
+ if (usb_match_id(interface, display_proto_6p_list))
+ display_proto_6p = 1;
@@ -4020,13 +4237,13 @@
+
+ context = kzalloc(sizeof(struct imon_context), GFP_KERNEL);
+ if (!context) {
-+ err("%s: kmalloc failed for context", __func__);
++ err("%s: kzalloc failed for context", __func__);
+ alloc_status = 1;
+ goto alloc_status_switch;
+ }
+ driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
+ if (!driver) {
-+ err("%s: kmalloc failed for lirc_driver", __func__);
++ err("%s: kzalloc failed for lirc_driver", __func__);
+ alloc_status = 2;
+ goto alloc_status_switch;
+ }
@@ -4050,7 +4267,7 @@
+ if (display_ep_found) {
+ tx_urb = usb_alloc_urb(0, GFP_KERNEL);
+ if (!tx_urb) {
-+ err("%s: usb_alloc_urb failed for Display urb",
++ err("%s: usb_alloc_urb failed for display urb",
+ __func__);
+ alloc_status = 6;
+ goto alloc_status_switch;
@@ -4071,7 +4288,7 @@
+ driver->rbuf = rbuf;
+ driver->set_use_inc = ir_open;
+ driver->set_use_dec = ir_close;
-+ driver->dev = &usbdev->dev;
++ driver->dev = &interface->dev;
+ driver->owner = THIS_MODULE;
+
+ mutex_lock(&context->lock);
@@ -4115,11 +4332,11 @@
+
+ if (display_ep_found && context->display_supported) {
+ if (debug)
-+ printk(KERN_INFO "Registering Display with sysfs\n");
++ printk(KERN_INFO "Registering display with sysfs\n");
+ if (usb_register_dev(interface, &imon_class)) {
+ /* Not a fatal error, so ignore */
+ printk(KERN_INFO "%s: could not get a minor number for "
-+ "Display\n", __func__);
++ "display\n", __func__);
+ }
+ }
+
@@ -4228,7 +4445,7 @@
+module_exit(imon_exit);
diff --git a/drivers/input/lirc/lirc_it87.c b/drivers/input/lirc/lirc_it87.c
new file mode 100644
-index 0000000..3a3484c
+index 0000000..232ba97
--- /dev/null
+++ b/drivers/input/lirc/lirc_it87.c
@@ -0,0 +1,984 @@
@@ -5181,24 +5398,24 @@
+MODULE_AUTHOR("Hans-Gunter Lutke Uphues");
+MODULE_LICENSE("GPL");
+
-+module_param(io, int, 0444);
++module_param(io, int, S_IRUGO);
+MODULE_PARM_DESC(io, "I/O base address (default: 0x310)");
+
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+#ifdef LIRC_IT87_DIGIMATRIX
+MODULE_PARM_DESC(irq, "Interrupt (1,3-12) (default: 9)");
+#else
+MODULE_PARM_DESC(irq, "Interrupt (1,3-12) (default: 7)");
+#endif
+
-+module_param(it87_enable_demodulator, bool, 0444);
++module_param(it87_enable_demodulator, bool, S_IRUGO);
+MODULE_PARM_DESC(it87_enable_demodulator,
+ "Receiver demodulator enable/disable (1/0), default: 0");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
+
-+module_param(digimatrix, bool, 0644);
++module_param(digimatrix, bool, S_IRUGO | S_IWUSR);
+#ifdef LIRC_IT87_DIGIMATRIX
+MODULE_PARM_DESC(digimatrix,
+ "Asus Digimatrix it87 compat. enable/disable (1/0), default: 1");
@@ -5208,7 +5425,7 @@
+#endif
+
+
-+module_param(it87_freq, int, 0444);
++module_param(it87_freq, int, S_IRUGO);
+#ifdef LIRC_IT87_DIGIMATRIX
+MODULE_PARM_DESC(it87_freq,
+ "Carrier demodulator frequency (kHz), (default: 36)");
@@ -5340,7 +5557,7 @@
+/********************************* ITE IT87xx ************************/
diff --git a/drivers/input/lirc/lirc_ite8709.c b/drivers/input/lirc/lirc_ite8709.c
new file mode 100644
-index 0000000..6a544ec
+index 0000000..3d53181
--- /dev/null
+++ b/drivers/input/lirc/lirc_ite8709.c
@@ -0,0 +1,539 @@
@@ -5881,14 +6098,14 @@
+MODULE_AUTHOR("Grégory Lardière");
+MODULE_LICENSE("GPL");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_mceusb.c b/drivers/input/lirc/lirc_mceusb.c
new file mode 100644
-index 0000000..16f9757
+index 0000000..2e94699
--- /dev/null
+++ b/drivers/input/lirc/lirc_mceusb.c
-@@ -0,0 +1,784 @@
+@@ -0,0 +1,747 @@
+/*
+ * USB Microsoft IR Transceiver driver - 0.2
+ *
@@ -5980,15 +6197,9 @@
+ struct urb *write_urb; /* the urb used to send data */
+ __u8 bulk_out_endpointAddr; /* the address of bulk out endpoint */
+
-+ atomic_t write_busy; /* true iff write urb is busy */
-+ struct completion write_finished; /* wait for the write to finish */
-+
+ wait_queue_head_t wait_q; /* for timeouts */
-+ int open_count; /* number of times this port has been opened */
+ struct mutex lock; /* locks this structure */
+
-+ int present; /* if the device is not disconnected */
-+
+ struct lirc_driver *driver;
+
+ int lircdata[256]; /* place to store data until lirc processes it */
@@ -6037,21 +6248,6 @@
+ .id_table = mceusb_table,
+};
+
-+
-+static void usb_mceusb_debug_data(const char *function, int size,
-+ const unsigned char *data)
-+{
-+ int i;
-+ if (!debug)
-+ return;
-+
-+ printk(KERN_DEBUG __FILE__": %s - length = %d, data = ",
-+ function, size);
-+ for (i = 0; i < size; ++i)
-+ printk(KERN_DEBUG "%.2x ", data[i]);
-+ printk(KERN_DEBUG "\n");
-+}
-+
+static void mceusb_delete(struct mceusb_device *dev)
+{
+ dprintk("%s", __func__);
@@ -6193,8 +6389,6 @@
+ /* handle signals and USB disconnects */
+ if (signal_pending(current))
+ return dev->lirccnt ? dev->lirccnt : -EINTR;
-+ if (!dev->udev)
-+ return -ENODEV;
+
+ bulkidx = 0;
+
@@ -6375,12 +6569,6 @@
+
+ mutex_lock(&dev->lock);
+
-+ /* verify device still present */
-+ if (dev->udev == NULL) {
-+ mutex_unlock(&dev->lock);
-+ return -ENODEV;
-+ }
-+
+ if (!dev->lirccnt) {
+ int res;
+ dev->lircidx = 0;
@@ -6561,7 +6749,7 @@
+ driver->set_use_dec = &set_use_dec;
+ driver->sample_rate = 80; /* sample at 100hz (10ms) */
+ driver->add_to_buf = &mceusb_add_to_buf;
-+ driver->dev = &udev->dev;
++ driver->dev = &interface->dev;
+ driver->owner = THIS_MODULE;
+ if (lirc_register_driver(driver) < 0) {
+ kfree(driver);
@@ -6623,14 +6811,6 @@
+ /* unhook lirc things */
+ lirc_unregister_driver(minor);
+ kfree(dev->driver);
-+ /* terminate an ongoing write */
-+ if (atomic_read(&dev->write_busy)) {
-+ usb_kill_urb(dev->write_urb);
-+ wait_for_completion(&dev->write_finished);
-+ }
-+
-+ /* prevent device read, write and ioctl */
-+ dev->present = 0;
+
+ mutex_unlock(&dev->lock);
+ mceusb_delete(dev);
@@ -6671,14 +6851,14 @@
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(usb, mceusb_table);
+
-+module_param(debug, int, 0644);
++module_param(debug, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/input/lirc/lirc_mceusb2.c b/drivers/input/lirc/lirc_mceusb2.c
new file mode 100644
-index 0000000..8bc9263
+index 0000000..089ee21
--- /dev/null
+++ b/drivers/input/lirc/lirc_mceusb2.c
-@@ -0,0 +1,1119 @@
+@@ -0,0 +1,1097 @@
+/*
+ * LIRC driver for Philips eHome USB Infrared Transceiver
+ * and the Microsoft MCE 2005 Remote Control
@@ -6733,7 +6913,7 @@
+ "MCE 2005 Remote Control driver for LIRC"
+#define DRIVER_NAME "lirc_mceusb2"
+
-+#define USB_BUFLEN 16 /* USB reception buffer length */
++#define USB_BUFLEN 32 /* USB reception buffer length */
+#define LIRCBUF_SIZE 256 /* LIRC work buffer length */
+
+/* MCE constants */
@@ -6794,8 +6974,6 @@
+#define VENDOR_COMPRO 0x185b
+
+static struct usb_device_id mceusb_dev_table[] = {
-+ /* Philips eHome Infrared Transceiver */
-+ { USB_DEVICE(VENDOR_PHILIPS, 0x0815) },
+ /* Philips Infrared Transceiver - Sahara branded */
+ { USB_DEVICE(VENDOR_PHILIPS, 0x0608) },
+ /* Philips Infrared Transceiver - HP branded */
@@ -6806,6 +6984,8 @@
+ { USB_DEVICE(VENDOR_PHILIPS, 0x060f) },
+ /* Philips Infrared Transceiver - Spinel plus */
+ { USB_DEVICE(VENDOR_PHILIPS, 0x0613) },
++ /* Philips eHome Infrared Transceiver */
++ { USB_DEVICE(VENDOR_PHILIPS, 0x0815) },
+ /* SMK/Toshiba G83C0004D410 */
+ { USB_DEVICE(VENDOR_SMK, 0x031d) },
+ /* SMK eHome Infrared Transceiver (Sony VAIO) */
@@ -7145,26 +7325,8 @@
+ case 0:
+ for (i = 0; i < buf_len; i++) {
+ /* decode mce packets of the form (84),AA,BB,CC,DD */
-+ switch (ir->buf_in[i]) {
-+
++ if (ir->buf_in[i] >= 0x80 && ir->buf_in[i] <= 0x9e) {
+ /* data headers */
-+ case 0x90: /* used Pinnacle Remote Kit */
-+ case 0x8F:
-+ case 0x8E:
-+ case 0x8D:
-+ case 0x8C:
-+ case 0x8B:
-+ case 0x8A:
-+ case 0x89:
-+ case 0x88:
-+ case 0x87:
-+ case 0x86:
-+ case 0x85:
-+ case 0x84:
-+ case 0x83:
-+ case 0x82:
-+ case 0x81:
-+ case 0x80:
+ /* decode packet data */
+ packet_len = ir->buf_in[i] &
+ MCE_PACKET_LENGTH_MASK;
@@ -7190,10 +7352,8 @@
+ }
+
+ i += packet_len;
-+ break;
-+
++ } else if (ir->buf_in[i] == MCE_CONTROL_HEADER) {
+ /* status header (0x9F) */
-+ case MCE_CONTROL_HEADER:
+ /*
+ * A transmission containing one or
+ * more consecutive ir commands always
@@ -7215,9 +7375,6 @@
+
+ /* end decode loop */
+ i = buf_len;
-+ break;
-+ default:
-+ break;
+ }
+ }
+
@@ -7596,7 +7753,7 @@
+ driver->set_use_dec = &set_use_dec;
+ driver->code_length = sizeof(int) * 8;
+ driver->fops = &lirc_fops;
-+ driver->dev = &dev->dev;
++ driver->dev = &intf->dev;
+ driver->owner = THIS_MODULE;
+
+ mutex_init(&ir->lock);
@@ -7648,10 +7805,11 @@
+
+ if (dev->descriptor.iManufacturer
+ && usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
-+ strncpy(name, buf, 128);
++ strlcpy(name, buf, sizeof(name));
+ if (dev->descriptor.iProduct
+ && usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
-+ snprintf(name, 128, "%s %s", name, buf);
++ snprintf(name + strlen(name), sizeof(name) - strlen(name),
++ " %s", buf);
+ printk(DRIVER_NAME "[%d]: %s on usb%d:%d\n", devnum, name,
+ dev->bus->busnum, devnum);
+
@@ -7796,11 +7954,11 @@
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(usb, mceusb_dev_table);
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/input/lirc/lirc_parallel.c b/drivers/input/lirc/lirc_parallel.c
new file mode 100644
-index 0000000..b66c57f
+index 0000000..07d0d02
--- /dev/null
+++ b/drivers/input/lirc/lirc_parallel.c
@@ -0,0 +1,709 @@
@@ -8499,19 +8657,19 @@
+MODULE_AUTHOR("Christoph Bartelmus");
+MODULE_LICENSE("GPL");
+
-+module_param(io, int, 0444);
++module_param(io, int, S_IRUGO);
+MODULE_PARM_DESC(io, "I/O address base (0x3bc, 0x378 or 0x278)");
+
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+MODULE_PARM_DESC(irq, "Interrupt (7 or 5)");
+
-+module_param(tx_mask, int, 0444);
++module_param(tx_mask, int, S_IRUGO);
+MODULE_PARM_DESC(tx_maxk, "Transmitter mask (default: 0x01)");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
+
-+module_param(check_pselecd, bool, 0644);
++module_param(check_pselecd, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Check for printer (default: 0)");
diff --git a/drivers/input/lirc/lirc_parallel.h b/drivers/input/lirc/lirc_parallel.h
new file mode 100644
@@ -8547,7 +8705,7 @@
+#endif
diff --git a/drivers/input/lirc/lirc_sasem.c b/drivers/input/lirc/lirc_sasem.c
new file mode 100644
-index 0000000..e26cda2
+index 0000000..3b79372
--- /dev/null
+++ b/drivers/input/lirc/lirc_sasem.c
@@ -0,0 +1,933 @@
@@ -8715,7 +8873,7 @@
+MODULE_AUTHOR(MOD_AUTHOR);
+MODULE_DESCRIPTION(MOD_DESC);
+MODULE_LICENSE("GPL");
-+module_param(debug, int, 0);
++module_param(debug, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes (default: no)");
+
+static void delete_context(struct sasem_context *context)
@@ -9299,13 +9457,13 @@
+
+ context = kzalloc(sizeof(struct sasem_context), GFP_KERNEL);
+ if (!context) {
-+ err("%s: kmalloc failed for context", __func__);
++ err("%s: kzalloc failed for context", __func__);
+ alloc_status = 1;
+ goto alloc_status_switch;
+ }
+ driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
+ if (!driver) {
-+ err("%s: kmalloc failed for lirc_driver", __func__);
++ err("%s: kzalloc failed for lirc_driver", __func__);
+ alloc_status = 2;
+ goto alloc_status_switch;
+ }
@@ -9347,7 +9505,7 @@
+ driver->rbuf = rbuf;
+ driver->set_use_inc = ir_open;
+ driver->set_use_dec = ir_close;
-+ driver->dev = &dev->dev;
++ driver->dev = &interface->dev;
+ driver->owner = THIS_MODULE;
+
+ mutex_lock(&context->lock);
@@ -9486,7 +9644,7 @@
+module_exit(sasem_exit);
diff --git a/drivers/input/lirc/lirc_serial.c b/drivers/input/lirc/lirc_serial.c
new file mode 100644
-index 0000000..643c762
+index 0000000..692634f
--- /dev/null
+++ b/drivers/input/lirc/lirc_serial.c
@@ -0,0 +1,1321 @@
@@ -10371,7 +10529,7 @@
+ /* If pin is high, then this must be an active low receiver. */
+ if (sense == -1) {
+ /* wait 1/2 sec for the power supply */
-+ msleep(HZ/2);
++ msleep(jiffies_to_msecs(HZ/2));
+
+ /*
+ * probe 9 times every 0.04s, collect "votes" for
@@ -10384,7 +10542,7 @@
+ nlow++;
+ else
+ nhigh++;
-+ msleep(HZ/25);
++ msleep(jiffies_to_msecs(HZ/25));
+ }
+ sense = (nlow >= nhigh ? 1 : 0);
+ printk(KERN_INFO LIRC_DRIVER_NAME ": auto-detected active "
@@ -10769,16 +10927,16 @@
+ "Christoph Bartelmus, Andrei Tanas");
+MODULE_LICENSE("GPL");
+
-+module_param(type, int, 0444);
++module_param(type, int, S_IRUGO);
+MODULE_PARM_DESC(type, "Hardware type (0 = home-brew, 1 = IRdeo,"
+ " 2 = IRdeo Remote, 3 = AnimaX, 4 = IgorPlug,"
+ " 5 = NSLU2 RX:CTS2/TX:GreenLED)");
+
-+module_param(io, int, 0444);
++module_param(io, int, S_IRUGO);
+MODULE_PARM_DESC(io, "I/O address base (0x3f8 or 0x2f8)");
+
+/* some architectures (e.g. intel xscale) have memory mapped registers */
-+module_param(iommap, bool, 0444);
++module_param(iommap, bool, S_IRUGO);
+MODULE_PARM_DESC(iommap, "physical base for memory mapped I/O"
+ " (0 = no memory mapped io)");
+
@@ -10787,33 +10945,33 @@
+ * on 32bit word boundaries.
+ * See linux-kernel/serial/8250.c serial_in()/out()
+ */
-+module_param(ioshift, int, 0444);
++module_param(ioshift, int, S_IRUGO);
+MODULE_PARM_DESC(ioshift, "shift I/O register offset (0 = no shift)");
+
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+MODULE_PARM_DESC(irq, "Interrupt (4 or 3)");
+
-+module_param(share_irq, bool, 0444);
++module_param(share_irq, bool, S_IRUGO);
+MODULE_PARM_DESC(share_irq, "Share interrupts (0 = off, 1 = on)");
+
-+module_param(sense, bool, 0444);
++module_param(sense, bool, S_IRUGO);
+MODULE_PARM_DESC(sense, "Override autodetection of IR receiver circuit"
+ " (0 = active high, 1 = active low )");
+
+#ifdef CONFIG_LIRC_SERIAL_TRANSMITTER
-+module_param(txsense, bool, 0444);
++module_param(txsense, bool, S_IRUGO);
+MODULE_PARM_DESC(txsense, "Sense of transmitter circuit"
+ " (0 = active high, 1 = active low )");
+#endif
+
-+module_param(softcarrier, bool, 0444);
++module_param(softcarrier, bool, S_IRUGO);
+MODULE_PARM_DESC(softcarrier, "Software carrier (0 = off, 1 = on, default on)");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_sir.c b/drivers/input/lirc/lirc_sir.c
new file mode 100644
-index 0000000..093cfd2
+index 0000000..306c77a
--- /dev/null
+++ b/drivers/input/lirc/lirc_sir.c
@@ -0,0 +1,1294 @@
@@ -12096,27 +12254,27 @@
+MODULE_LICENSE("GPL");
+
+#ifdef LIRC_ON_SA1100
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+MODULE_PARM_DESC(irq, "Interrupt (16)");
+#else
-+module_param(io, int, 0444);
++module_param(io, int, S_IRUGO);
+MODULE_PARM_DESC(io, "I/O address base (0x3f8 or 0x2f8)");
+
-+module_param(irq, int, 0444);
++module_param(irq, int, S_IRUGO);
+MODULE_PARM_DESC(irq, "Interrupt (4 or 3)");
+
-+module_param(threshold, int, 0444);
++module_param(threshold, int, S_IRUGO);
+MODULE_PARM_DESC(threshold, "space detection threshold (3)");
+#endif
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_streamzap.c b/drivers/input/lirc/lirc_streamzap.c
new file mode 100644
-index 0000000..cb05b58
+index 0000000..f91c1e3
--- /dev/null
+++ b/drivers/input/lirc/lirc_streamzap.c
-@@ -0,0 +1,772 @@
+@@ -0,0 +1,773 @@
+/*
+ * Streamzap Remote Control driver
+ *
@@ -12333,7 +12491,7 @@
+ (unsigned char *) &data);
+ }
+ if (sz->timer_running) {
-+ sz->delay_timer.expires += timer_inc;
++ sz->delay_timer.expires = jiffies + timer_inc;
+ add_timer(&sz->delay_timer);
+ }
+ } else {
@@ -12641,7 +12799,7 @@
+ sz->driver.set_use_inc = &streamzap_use_inc;
+ sz->driver.set_use_dec = &streamzap_use_dec;
+ sz->driver.fops = &streamzap_fops;
-+ sz->driver.dev = &udev->dev;
++ sz->driver.dev = &interface->dev;
+ sz->driver.owner = THIS_MODULE;
+
+ sz->idle = 1;
@@ -12664,11 +12822,12 @@
+
+ if (udev->descriptor.iManufacturer
+ && usb_string(udev, udev->descriptor.iManufacturer, buf, 63) > 0)
-+ strncpy(name, buf, 128);
++ strlcpy(name, buf, sizeof(name));
+
+ if (udev->descriptor.iProduct
+ && usb_string(udev, udev->descriptor.iProduct, buf, 63) > 0)
-+ snprintf(name, 128, "%s %s", name, buf);
++ snprintf(name + strlen(name), sizeof(name) - strlen(name),
++ " %s", buf);
+
+ printk(KERN_INFO DRIVER_NAME "[%d]: %s on usb%d:%d attached\n",
+ sz->driver.minor, name,
@@ -12761,7 +12920,7 @@
+
+ switch (cmd) {
+ case LIRC_GET_REC_RESOLUTION:
-+ result = put_user(STREAMZAP_RESOLUTION, (unsigned long *) arg);
++ result = put_user(STREAMZAP_RESOLUTION, (unsigned int *) arg);
+ if (result)
+ return result;
+ break;
@@ -12887,14 +13046,14 @@
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
+
-+module_param(debug, bool, 0644);
++module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
diff --git a/drivers/input/lirc/lirc_ttusbir.c b/drivers/input/lirc/lirc_ttusbir.c
new file mode 100644
-index 0000000..8e65ee7
+index 0000000..4d18084
--- /dev/null
+++ b/drivers/input/lirc/lirc_ttusbir.c
-@@ -0,0 +1,396 @@
+@@ -0,0 +1,398 @@
+/*
+ * lirc_ttusbir.c
+ *
@@ -12957,7 +13116,7 @@
+static void set_use_dec(void *data);
+
+static int num_urbs = 2;
-+module_param(num_urbs, int, 0444);
++module_param(num_urbs, int, S_IRUGO);
+MODULE_PARM_DESC(num_urbs,
+ "Number of URBs in queue. Try to increase to 4 in case "
+ "of problems (default: 2; minimum: 2)");
@@ -13204,6 +13363,8 @@
+ ttusbir->driver.rbuf = &ttusbir->rbuf;
+ ttusbir->driver.set_use_inc = set_use_inc;
+ ttusbir->driver.set_use_dec = set_use_dec;
++ ttusbir->driver.fops = NULL;
++ ttusbir->driver.dev = &intf->dev;
+ ttusbir->driver.owner = THIS_MODULE;
+ ttusbir->driver.features = LIRC_CAN_REC_MODE2;
+ ttusbir->minor = lirc_register_driver(&ttusbir->driver);
- Previous message: rpms/gnome-power-manager/devel gnome-power-manager.spec, 1.147, 1.148
- Next message: rpms/bittorrent/devel bittorrent-4.4.0-formatstrings.patch, NONE, 1.1 bittorrent-4.4.0-syntax.patch, NONE, 1.1 bittorrent-4.4.0-threads-warning.patch, 1.1, 1.2 bittorrent.spec, 1.46, 1.47 bittorrent-5.0.1-shellbang.patch, 1.1, NONE bittorrent-5.0.5-wxversion.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list