Author: pebender
Date: Sat Jun 6 10:48:39 2009
New Revision: 4900
Added:
trunk/gar-minimyth/script/system/lirc/files/lirc-20090606Z-mceusb2_mod_mce_0.2.0.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-20090606Z-no_python.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-20090606Z-remove_smp_unsafe_drivers.patch
Removed:
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.4a-imon_lcd_dynamic.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.4a-imon_module_param.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.4a-lirc_i2c_device.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.4a-no_python.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.4a-remove_smp_unsafe_drivers.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.4a-usb_sysfs.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.5-lircmd_uinput.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.5-mceusb2_mod_mce_0.2.0.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.5-no_python.patch
trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.5-remove_smp_unsafe_drivers.patch
Modified:
trunk/gar-minimyth/html/minimyth/document-changelog.txt
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/lirc.pm
trunk/gar-minimyth/script/system/lirc/Makefile
trunk/gar-minimyth/script/system/lirc/checksums
Log:
- Updated package system/lirc.
- Updated lirc to pick of the lircmd uinput support.
- Note lircd* devices have moved from /dev/ to /var/run/lirc/.
Modified: trunk/gar-minimyth/html/minimyth/document-changelog.txt
==============================================================================
--- trunk/gar-minimyth/html/minimyth/document-changelog.txt (original)
+++ trunk/gar-minimyth/html/minimyth/document-changelog.txt Sat Jun 6
10:48:39 2009
@@ -94,7 +94,8 @@
<http://www.minimyth.org/forum/viewtopic.php?f=2&t=2272>.
Improved LIRC
- - Patched lircmd so that it creates in uinput based event device.
+ - Updated lirc to pick of the lircmd uinput support.
+ - Note lircd* devices have moved from /dev/ to /var/run/lirc/.
- Added irxevent support.
- Added lircmd support.
Modified:
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/lirc.pm
==============================================================================
---
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/lirc.pm
(original)
+++
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/lirc.pm
Sat Jun 6 10:48:39 2009
@@ -164,7 +164,7 @@
{
$daemon_master = '/usr/sbin/lircd';
$daemon_master = $daemon_master . ' --driver=null';
- $daemon_master = $daemon_master . ' --output=/dev/lircd
--pidfile=/var/run/lircd.pid';
+ $daemon_master = $daemon_master . ' --output=/var/run/lirc/lircd
--pidfile=/var/run/lirc/lircd.pid';
for (my $index = 0 ; $index <= $#device_list ; $index++)
{
my $port = 8765 + $index;
@@ -273,8 +273,8 @@
# Create directories used by the LIRC daemon.
File::Path::mkpath('/var/lock', { mode => 0755 });
chmod(0755, '/var/lock');
- File::Path::mkpath('/var/run', { mode => 0755 });
- chmod(0755, '/var/run');
+ File::Path::mkpath('/var/run/lirc', { mode => 0755 });
+ chmod(0755, '/var/run/lirc');
# Enable wakeup and start an LIRC daemon for each device.
my $index = 0;
@@ -317,7 +317,7 @@
my $port = 8765 + $index;
$daemon = '/usr/sbin/lircd';
$daemon = $daemon . " --device=$device --driver=$driver";
- $daemon = $daemon . " --output=/dev/lircd-$instance
--pidfile=/var/run/lircd-$instance.pid";
+ $daemon = $daemon . " --output=/var/run/lirc/lircd-$instance
--pidfile=/var/run/lirc/lircd-$instance.pid";
$daemon = $daemon . " --listen=$port";
$daemon = $daemon . " $lircd_conf";
}
@@ -325,9 +325,9 @@
{
$daemon = '/usr/sbin/lircd';
$daemon = $daemon . " --device=$device --driver=$driver";
- $daemon = $daemon . ' --output=/dev/lircd
--pidfile=/var/run/lircd.pid';
+ $daemon = $daemon . ' --output=/var/run/lirc/lircd
--pidfile=/var/run/lirc/lircd.pid';
$daemon = $daemon . " $lircd_conf";
- symlink('/dev/lircd', "/dev/lircd-$instance");
+
symlink('/var/run/lirc/lircd', "/var/run/lirc/lircd-$instance");
}
$minimyth->message_log('info', "started '$daemon'.");
system(qq($daemon));
Modified: trunk/gar-minimyth/script/system/lirc/Makefile
==============================================================================
--- trunk/gar-minimyth/script/system/lirc/Makefile (original)
+++ trunk/gar-minimyth/script/system/lirc/Makefile Sat Jun 6 10:48:39 2009
@@ -1,14 +1,15 @@
GARNAME = lirc
#GARVERSION = 0.8.4a
-GARVERSION = 0.8.5
-#GARVERSION = 20090317Z
+#GARVERSION = 0.8.5
+GARVERSION = 20090606Z
CATEGORIES = system
-MASTER_SITES = http://easynews.dl.sourceforge.net/sourceforge/$(GARNAME)/
+#MASTER_SITES = http://easynews.dl.sourceforge.net/sourceforge/$(GARNAME)/
#MASTER_SITES = http://www.lirc.org/software/snapshots/
-#MASTER_SITES =
cvs://anonym...@$(GARNAME).cvs.sourceforge.net:/cvsroot/$(GARNAME)/
+MASTER_SITES =
cvs://anonym...@$(GARNAME).cvs.sourceforge.net:/cvsroot/$(GARNAME)/
DISTFILES = $(DISTNAME).tar.bz2
#PATCHFILES = $(DISTNAME)-usb_sysfs.patch
$(DISTNAME)-lirc_i2c_device.patch $(DISTNAME)-no_python.patch
$(DISTNAME)-imon_module_param.patch $(DISTNAME)-imon_lcd_dynamic.patch
$(DISTNAME)-remove_smp_unsafe_drivers.patch
-PATCHFILES = $(DISTNAME)-lircmd_uinput.patch
$(DISTNAME)-mceusb2_mod_mce_0.2.0.patch $(DISTNAME)-no_python.patch
$(DISTNAME)-remove_smp_unsafe_drivers.patch
+#PATCHFILES = $(DISTNAME)-lircmd_uinput.patch
$(DISTNAME)-mceusb2_mod_mce_0.2.0.patch $(DISTNAME)-no_python.patch
$(DISTNAME)-remove_smp_unsafe_drivers.patch
+PATCHFILES = $(DISTNAME)-mceusb2_mod_mce_0.2.0.patch
$(DISTNAME)-no_python.patch $(DISTNAME)-remove_smp_unsafe_drivers.patch
LICENSE = GPL2
DESCRIPTION =
@@ -49,7 +50,7 @@
@$(call FETCH_CVS, $*, $(GARNAME), $(GARVERSION), $(DISTNAME))
@$(MAKECOOKIE)
-x-checksum-$(DISTNAME).tar.bz2:
+checksum-$(DISTNAME).tar.bz2:
@$(MAKECOOKIE)
pre-configure:
Modified: trunk/gar-minimyth/script/system/lirc/checksums
==============================================================================
--- trunk/gar-minimyth/script/system/lirc/checksums (original)
+++ trunk/gar-minimyth/script/system/lirc/checksums Sat Jun 6 10:48:39 2009
@@ -1,14 +1,3 @@
-606b714ed843d28060163ffc571fc1f7 download/lirc-0.8.4a.tar.bz2
-b0109eb8f4b892d81617bd459a60b7bc download/lirc-0.8.4a-usb_sysfs.patch
-e219e2e9dc7669eda6a43a3a53927272
download/lirc-0.8.4a-lirc_i2c_device.patch
-c94215f94d8a6677875bde2c0977d9c5
download/lirc-0.8.4a-lirc_imon_cvs_20090116Z.patch
-1b7913de87a6ee1b71faf9fc7d32fb1d download/lirc-0.8.4a-no_python.patch
-24b2a057f96e754ef84ea07e2be3b3fb
download/lirc-0.8.4a-imon_module_param.patch
-7e52f1ab9b10e7dcebf23ccf2114f00b
download/lirc-0.8.4a-imon_lcd_dynamic.patch
-7fef9c434332248022774b90ccc234e1
download/lirc-0.8.4a-remove_smp_unsafe_drivers.patch
-
-5a274e4eaff8156b17903c22ea01f506 download/lirc-0.8.5.tar.bz2
-138e3e15bff1ea35dc577af721ff742f download/lirc-0.8.5-lircmd_uinput.patch
-0c6e1197f1cced83070509d56d24360c
download/lirc-0.8.5-mceusb2_mod_mce_0.2.0.patch
-e13b18b563136e8c50f490df4ef9250d download/lirc-0.8.5-no_python.patch
-e734f494fc683e9e6f3335c212c980af
download/lirc-0.8.5-remove_smp_unsafe_drivers.patch
+512687ddbabae5d0e3727d0f29751721
download/lirc-20090606Z-mceusb2_mod_mce_0.2.0.patch
+a005a9ef3e89aa530a2e9d972981a01e download/lirc-20090606Z-no_python.patch
+d90125741f14158dedeec4c1b343ef42
download/lirc-20090606Z-remove_smp_unsafe_drivers.patch
Added:
trunk/gar-minimyth/script/system/lirc/files/lirc-20090606Z-mceusb2_mod_mce_0.2.0.patch
==============================================================================
--- (empty file)
+++
trunk/gar-minimyth/script/system/lirc/files/lirc-20090606Z-mceusb2_mod_mce_0.2.0.patch
Sat Jun 6 10:48:39 2009
@@ -0,0 +1,586 @@
+diff -Naur lirc-20090606Z-old/drivers/lirc_mceusb2/lirc_mceusb2.c
lirc-20090606Z-new/drivers/lirc_mceusb2/lirc_mceusb2.c
+--- lirc-20090606Z-old/drivers/lirc_mceusb2/lirc_mceusb2.c 2009-04-15
07:20:26.000000000 -0700
++++ lirc-20090606Z-new/drivers/lirc_mceusb2/lirc_mceusb2.c 2009-06-06
09:27:15.000000000 -0700
+@@ -1,6 +1,8 @@
+ /*
+ * LIRC driver for Philips eHome USB Infrared Transceiver
+- * and the Microsoft MCE 2005 Remote Control
++ * and the Microsoft MCE 2005 Remote Control and Keyboard
++ *
++ * (C) by Florian Demski
+ *
+ * (C) by Martin A. Blatter <[email protected]>
+ *
+@@ -33,10 +35,11 @@
+ *
+ */
+
++
+ #include <linux/version.h>
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 5)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10)
+ #error "*******************************************************"
+-#error "Sorry, this driver needs kernel version 2.6.5 or higher"
++#error "Sorry, this driver needs kernel version 2.6.10 or higher"
+ #error "*******************************************************"
+ #endif
+ #include <linux/autoconf.h>
+@@ -56,6 +59,12 @@
+ #include <linux/usb.h>
+ #include <linux/wait.h>
+ #include <linux/time.h>
++#include <linux/input.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
++#include <linux/usb/input.h>
++#else
++#include <linux/usb_input.h>
++#endif
+
+ #include "drivers/lirc.h"
+ #include "drivers/kcompat.h"
+@@ -63,12 +72,16 @@
+
+ #define DRIVER_VERSION "$Revision: 1.81 $"
+ #define DRIVER_AUTHOR "Daniel Melander <[email protected]>, " \
+- "Martin Blatter <[email protected]>"
++ "Martin Blatter <[email protected]>, " \
++ "Florian Demski"
+ #define DRIVER_DESC "Philips eHome USB IR Transceiver and Microsoft " \
+- "MCE 2005 Remote Control driver for LIRC"
++ "MCE 2005 Remote Control and Keyboard driver for LIRC"
+ #define DRIVER_NAME "lirc_mceusb2"
+
+-#define USB_BUFLEN 32 /* USB reception buffer length */
++#define PEAK_BUFLEN 10000
++
++/* LIRC constants */
++#define USB_BUFLEN 256 /* USB reception buffer length */
+ #define LIRCBUF_SIZE 256 /* LIRC work buffer length */
+
+ /* MCE constants */
+@@ -87,6 +100,52 @@
+ #define MCE_PACKET_LENGTH_MASK 0x7F /* Pulse mask */
+
+
++/* Keyboard/Mouse constants */
++#define MODE2_PULSE 1
++#define MODE2_SPACE 0
++#define MODE2_NONE -1
++
++#define SYNC_MIN 52
++#define SYNC_MAX 66
++#define RC6_1_MIN 7
++#define RC6_1_MAX 12
++#define RC6_2_MIN 15
++#define RC6_2_MAX 20
++#define RC6_3_MIN 24
++#define RC6_3_MAX 32
++#define RC5_1_MIN 3
++#define RC5_1_MAX 9
++#define RC5_2_MIN 10
++#define RC5_2_MAX 15
++
++#define RC5_KEY_BUFLEN 74
++#define RC5_MOUSE_BUFLEN 68
++
++#define RC5_KEY_START 42
++#define RC5_MASK_START 58
++
++#define MOUSE_Y_START 26
++#define MOUSE_X_START 40
++#define MOUSE_BTN_START 54
++#define MOUSE_DATA_END 58
++
++#define MASK_KEYS 0xE0
++
++#define PULSE 2
++#define SPACE 1
++
++#ifndef BITS_PER_LONG
++#define BITS_PER_LONG (8 * sizeof(long))
++#endif
++
++#ifndef BIT_MASK
++#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
++#endif
++
++#ifndef BIT_WORD
++#define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
++#endif
++
+ /* module parameters */
+ #ifdef CONFIG_USB_DEBUG
+ static int debug = 1;
+@@ -218,15 +277,45 @@
+ {}
+ };
+
++static unsigned char usb_kbd_keycode[256] = {
++ 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23,
36, 37, 38,
++ 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21,
44, 2, 3,
++ 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57,
12, 13, 26,
++ 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61,
62, 63, 64,
++ 65, 66, 67, 68, 87, 88, 99, 70, 119, 110, 102, 104, 111, 107,
109, 106,
++ 105, 108, 103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75,
76, 77, 71,
++ 72, 73, 82, 83, 86, 127, 116, 117, 183, 184, 185, 186, 187, 188,
189, 190,
++ 191, 192, 193, 194, 134, 138, 130, 132, 128, 129, 131, 137, 133, 135,
136, 113,
++ 115, 114, 0, 0, 0, 121, 0, 89, 93, 124, 92, 94, 95,
0, 0, 0,
++ 122, 123, 90, 91, 85, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
++ 29, 42, 56, 125, 97, 54, 100, 126, 164, 166, 165, 163, 161, 115,
114, 113,
++ 150, 158, 159, 128, 136, 177, 178, 176, 142, 152, 173, 140
++};
++
++typedef struct {
++ int pulse;
++ int duration;
++} peak;
++
++#define is_pressed(a, b) ((a[b/8]) & (1 << (b % 8)))
++#define set_pressed(a, b) a[b/8] |= (1 << (b % 8));
++#define rst_pressed(a, b) a[b/8] &= (~(1 << (b % 8)));
++
+ /* data structure for each usb transceiver */
+ struct mceusb2_dev {
+
+ /* usb */
++ struct input_dev *idev;
+ struct usb_device *usbdev;
+ struct urb *urb_in;
+ int devnum;
+ struct usb_endpoint_descriptor *usb_ep_in;
+ struct usb_endpoint_descriptor *usb_ep_out;
++ unsigned char pressed[256/8];
+
+ /* buffers and dma */
+ unsigned char *buf_in;
+@@ -234,9 +323,16 @@
+ dma_addr_t dma_in;
+ dma_addr_t dma_out;
+
++ peak peaks[PEAK_BUFLEN];
++ int peak_index;
++
++ int in_sync;
++ int sync_pos;
++
+ /* lirc */
+ struct lirc_driver *d;
+ lirc_t lircdata;
++ int lirccnt;
+ unsigned char is_pulse;
+ struct {
+ u32 connected:1;
+@@ -253,6 +349,9 @@
+ wait_queue_head_t wait_out;
+
+ struct mutex lock;
++ char name[128];
++ char phys[64];
++ char uniq[64];
+ };
+
+ /* init strings */
+@@ -377,6 +476,261 @@
+ ir->devnum, res);
+ }
+
++static void do_rc5_keys(struct mceusb2_dev *ir, peak *peaks, int
num_peaks)
++{
++ int step1[1000];
++ unsigned char keycode, mask;
++ int i, j, unknown_bits;
++
++
++
++ for (i=0, j=0; i<num_peaks; i++) {
++ if (RC5_1_MIN <= peaks[i].duration && peaks[i].duration <=
RC5_1_MAX) {
++ step1[j++] = peaks[i].pulse;
++ if (j == 1000)
++ return;
++ } else if (RC5_2_MIN <= peaks[i].duration && peaks[i].duration <=
RC5_2_MAX) {
++ step1[j++] = peaks[i].pulse;
++ if (j == 1000)
++ return;
++ step1[j++] = peaks[i].pulse;
++ if (j == 1000)
++ return;
++ }
++ }
++
++
++ if (j&1 && j<1000) step1[j++] = SPACE;
++
++ if (j != RC5_KEY_BUFLEN)
++ return;
++
++ unknown_bits = 0;
++ keycode = 0;
++ mask = 0;
++
++ for (i=0; i<RC5_KEY_BUFLEN; i+=2) {
++ if (step1[i] == SPACE && step1[i+1] == PULSE) {
++ if (i < RC5_KEY_START) {
++ unknown_bits <<= 1;
++ } else if (i < RC5_MASK_START) {
++ keycode <<= 1;
++ } else {
++ mask <<= 1;
++ }
++ } else if (step1[i] == PULSE && step1[i+1] == SPACE) {
++ if (i < RC5_KEY_START) {
++ unknown_bits <<= 1;
++ unknown_bits |= 1;
++ } else if (i < RC5_MASK_START) {
++ keycode <<= 1;
++ keycode |= 1;
++ } else {
++ mask <<= 1;
++ mask |= 1;
++ }
++ } else {
++ dprintk(DRIVER_NAME "RC5: junk\n");
++ return;
++ }
++ }
++
++ dprintk(DRIVER_NAME " RC5: key=%02X mask=%02X\n", keycode, mask);
++
++ for (i=0; i<7; i++) {
++ unsigned char tc;
++
++ tc = usb_kbd_keycode[MASK_KEYS + i];
++
++ if (!is_pressed(ir->pressed, tc) && ((mask & (1<<i))>0)) {
++ input_report_key(ir->idev, tc, 1);
++ set_pressed(ir->pressed, tc);
++ } else if (is_pressed(ir->pressed, tc) && ((mask & (1<<i)) == 0))
{
++ input_report_key(ir->idev, tc, 0);
++ rst_pressed(ir->pressed, tc);
++ }
++ }
++
++ if (keycode) {
++ unsigned char tc;
++
++ tc = usb_kbd_keycode[keycode];
++ if (!is_pressed(ir->pressed, tc)) {
++ set_pressed(ir->pressed, tc);
++ input_report_key(ir->idev, tc, 1);
++ }
++ }
++ if (keycode == 0) {
++ for (i=0; i<MASK_KEYS; i++) {
++ if (is_pressed(ir->pressed, usb_kbd_keycode[i])) {
++ input_report_key(ir->idev, usb_kbd_keycode[i], 0);
++ }
++ rst_pressed(ir->pressed, usb_kbd_keycode[i]);
++ }
++ }
++}
++
++static void do_rc5_mouse(struct mceusb2_dev *ir, peak *peaks, int
num_peaks)
++{
++ int step1[1000];
++ int i, j;
++ unsigned int pre_data;
++ unsigned char ux, uy, btn;
++ signed char x, y;
++
++ for (i=0, j=0; i<num_peaks; i++) {
++ if (RC5_1_MIN <= peaks[i].duration && peaks[i].duration <=
RC5_1_MAX) {
++ step1[j++] = peaks[i].pulse;
++ if (j == 1000)
++ return;
++ } else if (RC5_2_MIN <= peaks[i].duration && peaks[i].duration <=
RC5_2_MAX) {
++ step1[j++] = peaks[i].pulse;
++ if (j == 1000)
++ return;
++ step1[j++] = peaks[i].pulse;
++ if (j == 1000)
++ return;
++ }
++ }
++
++
++ if (j&1 && j<1000) step1[j++] = SPACE;
++
++ if (j != RC5_MOUSE_BUFLEN)
++ return;
++
++ pre_data = 0;
++ ux = uy = btn = 0;
++
++ for (i=0; i<MOUSE_DATA_END; i+=2) {
++ if (step1[i] == SPACE && step1[i+1] == PULSE) {
++ if (i < MOUSE_Y_START) {
++ pre_data <<= 1;
++ } else if (i < MOUSE_X_START) {
++ uy <<= 1;
++ } else if (i < MOUSE_BTN_START) {
++ ux <<= 1;
++ } else {
++ btn <<= 1;
++ }
++ } else if (step1[i] == PULSE && step1[i+1] == SPACE) {
++ if (i < MOUSE_Y_START) {
++ pre_data <<= 1;
++ pre_data |= 1;
++ } else if (i < MOUSE_X_START) {
++ uy <<= 1;
++ uy |= 1;
++ } else if (i < MOUSE_BTN_START) {
++ ux <<= 1;
++ ux |= 1;
++ } else {
++ btn <<= 1;
++ btn |= 1;
++ }
++ } else {
++ dprintk(DRIVER_NAME " mouse: junk\n");
++ return;
++ }
++ }
++
++ if (ux & 0x40) {
++ x = -((~ux & 0x7F) + 1);
++ } else {
++ x = ux;
++ }
++
++ if (uy & 0x40) {
++ y = -((~uy & 0x7F) + 1);
++ } else {
++ y = uy;
++ }
++
++ dprintk(DRIVER_NAME " mouse: x=%d, y=%d, btn=%s%s%s\n",
++ x, y,
++ (btn & 1) ? "<L>" : "",
++ (btn == 3) ? "+" : "",
++ (btn & 2) ? "<R>" : "");
++
++ input_report_rel(ir->idev, REL_X, x);
++ input_report_rel(ir->idev, REL_Y, y);
++
++ input_report_key(ir->idev, BTN_LEFT, btn & 1);
++ input_report_key(ir->idev, BTN_RIGHT, btn & 2);
++}
++
++static void do_analyze(struct mceusb2_dev *ir, peak *peaks, int num_peaks)
++{
++ do_rc5_keys(ir, peaks, num_peaks);
++ do_rc5_mouse(ir, peaks, num_peaks);
++}
++
++static void decode_buffer(struct mceusb2_dev *ir, int len)
++{
++ int i;
++ int pulse, length, sync_pos;
++ int offset = 0, data_len = 0;
++
++ sync_pos = -1;
++
++ for (;;) {
++ if (ir->buf_in[offset] == MCE_CONTROL_HEADER)
++ break;
++
++ data_len = ir->buf_in[offset] & 0x7F;
++ offset++;
++
++ if (offset + data_len > len)
++ break;
++
++ if (data_len == 0)
++ break;
++
++ for (i = offset; i<offset + data_len; i++) {
++ pulse = (ir->buf_in[i] & 0x80) ? PULSE : SPACE;
++ length = (ir->buf_in[i] & 0x7F);
++
++ if (ir->peaks[ir->peak_index].pulse != pulse) {
++
++ if ((ir->peaks[ir->peak_index].pulse == PULSE) &&
++ (SYNC_MIN <= ir->peaks[ir->peak_index].duration) &&
++ (ir->peaks[ir->peak_index].duration <= SYNC_MAX)) {
++ if (ir->in_sync) {
++ do_analyze(ir, &ir->peaks[ir->sync_pos],
ir->peak_index - ir->sync_pos + 1);
++ }
++
++ ir->in_sync = 1;
++ ir->sync_pos = 0;
++ ir->peak_index = -1;
++ }
++
++ if ((ir->peaks[ir->peak_index].pulse == SPACE) &&
++ (ir->peaks[ir->peak_index].duration >= 2000)) {
++
++ if (ir->in_sync) {
++ do_analyze(ir, &ir->peaks[ir->sync_pos],
ir->peak_index - ir->sync_pos + 1);
++ }
++
++ ir->in_sync = 0;
++ ir->peak_index = -1;
++ ir->peaks[0].pulse = 0;
++ }
++
++ if (ir->peak_index < 0) {
++ ir->peak_index = 0;
++ } else {
++ ir->peak_index = (++ir->peak_index) % PEAK_BUFLEN;
++ if (ir->peak_index == 0) dprintk(DRIVER_NAME ": buffer
overflow\n");
++ }
++ ir->peaks[ir->peak_index].pulse = pulse;
++ ir->peaks[ir->peak_index].duration = length;
++ } else {
++ ir->peaks[ir->peak_index].duration += length;
++ }
++ }
++ offset += data_len;
++ }
++}
++
+ static int unregister_from_lirc(struct mceusb2_dev *ir)
+ {
+ struct lirc_driver *d = ir->d;
+@@ -498,6 +852,10 @@
+ switch (urb->status) {
+ /* success */
+ case 0:
++ {
++ decode_buffer(ir, buf_len);
++ input_sync(ir->idev);
++
+ for (i = 0; i < buf_len; i++) {
+ /* decode mce packets of the form (84),AA,BB,CC,DD */
+ if (ir->buf_in[i] >= 0x80 && ir->buf_in[i] <= 0x9e) {
+@@ -552,6 +910,7 @@
+ i = buf_len;
+ }
+ }
++ }
+
+ break;
+
+@@ -719,6 +1078,15 @@
+ }
+
+
++static int input_open(struct input_dev *id)
++{
++ return 0;
++}
++
++static void input_close(struct input_dev *id)
++{
++}
++
+ static int lirc_ioctl(struct inode *node, struct file *filep,
+ unsigned int cmd, unsigned long arg)
+ {
+@@ -810,10 +1178,11 @@
+ struct lirc_buffer *rbuf = NULL;
+ int devnum, pipe, maxp;
+ int minor = 0;
+- int i;
++ int i, len;
+ char buf[63], name[128] = "";
+ int mem_failure = 0;
+ int is_pinnacle;
++ struct input_dev *input_dev;
+
+ dprintk(DRIVER_NAME ": usb probe called\n");
+
+@@ -879,6 +1248,12 @@
+ return -ENODEV;
+ }
+
++ input_dev = input_allocate_device();
++ if (input_dev == NULL) {
++ dprintk(DRIVER_NAME ": could not get input device\n");
++ return -ENODEV;
++ }
++
+ devnum = dev->devnum;
+ pipe = usb_rcvintpipe(dev, ep_in->bEndpointAddress);
+ maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+@@ -976,6 +1351,55 @@
+ ir->is_pulse = 0;
+
+ /* ir->flags.transmitter_mask_inverted must be set */
++
++ usb_make_path(dev, ir->phys, sizeof(ir->phys));
++ strlcat(ir->phys, "/input", sizeof(ir->phys));
++ len = strlen(ir->phys);
++ if (len < sizeof(ir->phys) - 1)
++ snprintf(ir->phys + len, sizeof(ir->phys) - len,
++ "%d", intf->altsetting[0].desc.bInterfaceNumber);
++
++ if (usb_string(dev, dev->descriptor.iSerialNumber, ir->uniq, 64) <= 0)
++ ir->uniq[0] = 0;
++
++ if (dev->manufacturer)
++ strlcpy(ir->name, dev->manufacturer, sizeof(ir->name));
++ if (dev->product)
++ snprintf(ir->name, sizeof(ir->name), "%s %s", ir->name,
dev->product);
++ if (!strlen(ir->name))
++ snprintf(ir->name, sizeof(ir->name), DRIVER_DESC "(%04x,%04x)",
++ dev->descriptor.idVendor, dev->descriptor.idProduct);
++
++ input_dev->open = input_open;
++ input_dev->close = input_close;
++ input_dev->name = ir->name;
++ input_dev->phys = ir->phys;
++ usb_to_input_id(dev, &input_dev->id);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
++ input_dev->cdev.dev = &dev->dev;
++#endif
++ input_dev->dev.parent = ir->d->dev;
++ input_dev->evbit[BIT_WORD(EV_KEY)] |= BIT_MASK(EV_KEY);
++ input_dev->evbit[BIT_WORD(EV_REL)] |= BIT_MASK(EV_REL);
++ input_dev->relbit[BIT_WORD(REL_X)] |= BIT_MASK(REL_X);
++ input_dev->relbit[BIT_WORD(REL_Y)] |= BIT_MASK(REL_Y);
++
++ for (i=0; i<256; i++) {
++ set_bit(usb_kbd_keycode[i], input_dev->keybit);
++ }
++
++ clear_bit(0, input_dev->keybit);
++ input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT);
++ input_dev->keybit[BIT_WORD(BTN_RIGHT)] |= BIT_MASK(BTN_RIGHT);
++
++ input_register_device(input_dev);
++
++ memset(ir->pressed, 0, sizeof(ir->pressed));
++
++ ir->idev = input_dev;
++
++
++ /* ir->usbdev must be set */
+ set_transmitter_mask(ir, MCE_DEFAULT_TX_MASK);
+ /* Saving usb interface data for use by the transmitter routine */
+ ir->usb_ep_in = ep_in;
+@@ -990,6 +1414,7 @@
+ buf, sizeof(buf)) > 0)
+ 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);
+
+@@ -1068,6 +1493,12 @@
+ ir->usbdev = NULL;
+ wake_up_all(&ir->wait_out);
+
++ if (ir->idev) {
++ input_unregister_device(ir->idev);
++ ir->idev = NULL;
++ }
++
++
+ mutex_lock(&ir->lock);
+ usb_kill_urb(ir->urb_in);
+ usb_free_urb(ir->urb_in);
Added:
trunk/gar-minimyth/script/system/lirc/files/lirc-20090606Z-no_python.patch
==============================================================================
--- (empty file)
+++
trunk/gar-minimyth/script/system/lirc/files/lirc-20090606Z-no_python.patch
Sat Jun 6 10:48:39 2009
@@ -0,0 +1,14 @@
+diff -Naur lirc-20090606Z-old/configure.ac lirc-20090606Z-new/configure.ac
+--- lirc-20090606Z-old/configure.ac 2009-06-06 09:26:51.000000000 -0700
++++ lirc-20090606Z-new/configure.ac 2009-06-06 09:27:57.000000000 -0700
+@@ -22,8 +22,8 @@
+ AC_PATH_PROG(LIBUSB_CONFIG, libusb-config)
+ AC_PROG_LN_S
+ AC_PROG_LIBTOOL
+-AM_PATH_PYTHON
+-AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""])
++AM_PATH_PYTHON(,,[:])
++AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
+
+ dnl Checks for header files.
+ AC_HEADER_STDC
Added:
trunk/gar-minimyth/script/system/lirc/files/lirc-20090606Z-remove_smp_unsafe_drivers.patch
==============================================================================
--- (empty file)
+++
trunk/gar-minimyth/script/system/lirc/files/lirc-20090606Z-remove_smp_unsafe_drivers.patch
Sat Jun 6 10:48:39 2009
@@ -0,0 +1,106 @@
+diff -Naur lirc-20090606Z-old/configure.ac lirc-20090606Z-new/configure.ac
+--- lirc-20090606Z-old/configure.ac 2009-06-06 09:27:57.000000000 -0700
++++ lirc-20090606Z-new/configure.ac 2009-06-06 09:28:29.000000000 -0700
+@@ -169,7 +169,6 @@
+ (lirc_dev lirc_ite8709) \
+ (lirc_dev lirc_mceusb) \
+ (lirc_dev lirc_mceusb2) \
+- (lirc_dev lirc_parallel) \
+ (lirc_dev lirc_sasem) \
+ (lirc_dev lirc_serial) \
+ (lirc_dev lirc_sir) \
+@@ -303,9 +302,6 @@
+ AH_TEMPLATE([LIRC_IMON_LCD],
+ [Define if your iMON is an LCD and not a VFD.])
+
+-AH_TEMPLATE([LIRC_TIMER],
+- [Set the timer for the parallel port driver])
+-
+ AH_TEMPLATE([LOCALSTATEDIR],
+ [modifiable single-machine data])
+
+@@ -449,7 +445,7 @@
+ livedrive_midi, livedrive_seq, logitech,
+ lptX, macmini, mceusb, mceusb2, mediafocusI,
+ mouseremote, mouseremote_ps2, mp3anywhere,
+- mplay, nslu2,packard_bell, parallel, pcmak,
++ mplay, nslu2,packard_bell, pcmak,
+ pcmak_usb, pctv, pixelview_bt878,
+ pixelview_pak, pixelview_pro, provideo,
+ realmagic, remotemaster, sa1100, samsung,
+@@ -608,8 +604,6 @@
+ ;;
+ lirc_dev-lirc_mceusb2)
+ ;;
+- lirc_dev-lirc_parallel)
+- ;;
+ lirc_dev-lirc_sasem)
+ ;;
+ lirc_dev-lirc_serial)
+@@ -1133,18 +1127,6 @@
+ lircmd_conf="logitech/lircmd.conf.logitech"
+ fi
+
+-if test "$driver" = "lpt1"; then
+- lirc_driver="lirc_dev lirc_parallel"
+- port=0x378
+- irq=7
+-fi
+-
+-if test "$driver" = "lpt2"; then
+- lirc_driver="lirc_dev lirc_parallel"
+- port=0x278
+- irq=5
+-fi
+-
+ if test "$driver" = "macmini"; then
+ lirc_driver="$driver"
+ hw_module="hw_hiddev.o"
+@@ -1208,10 +1190,6 @@
+ lircd_conf="packard_bell/lircd.conf.packard_bell"
+ fi
+
+-if test "$driver" = "parallel"; then
+- lirc_driver="lirc_dev lirc_parallel"
+-fi
+-
+ if test "$driver" = "pcmak" -o "$driver" = "pcmak_usb"; then
+ lirc_driver="none"
+ hw_module="hw_pcmak.o serial.o"
+@@ -1500,7 +1478,6 @@
+ lirc_ite8709 \
+ lirc_mceusb \
+ lirc_mceusb2 \
+- lirc_parallel \
+ lirc_sasem \
+ lirc_serial \
+ lirc_sir \
+@@ -1571,10 +1548,6 @@
+ irq=${withval}
+ )
+
+-AC_ARG_WITH(timer,
+-[ --with-timer=value specify the timer value for the parallel
driver],
+-timer=${withval})
+-
+ dnl I dont think libirman will accept this at the moment
+ AC_ARG_WITH(tty,
+ [ --with-tty=file specify the tty to use (Irman, RemoteMaster,
etc.)],
+@@ -1705,9 +1678,6 @@
+ if test "$irq" != ""; then
+ AC_DEFINE_UNQUOTED(LIRC_IRQ, $irq)
+ fi
+-if test "$timer" != ""; then
+- AC_DEFINE_UNQUOTED(LIRC_TIMER, $timer)
+-fi
+ AC_DEFINE_UNQUOTED(LIRC_IRTTY, "$irtty")
+ AC_DEFINE_UNQUOTED(LIRC_SYSLOG, $facility)
+
+@@ -1780,7 +1750,6 @@
+ drivers/lirc_ite8709/Makefile
+ drivers/lirc_mceusb/Makefile
+ drivers/lirc_mceusb2/Makefile
+- drivers/lirc_parallel/Makefile
+ drivers/lirc_sasem/Makefile
+ drivers/lirc_serial/Makefile
+ drivers/lirc_sir/Makefile
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"minimyth-commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/minimyth-commits?hl=en
-~----------~----~----~----~------~----~------~--~---