diff options
author | 2010-08-23 16:08:08 +0200 | |
---|---|---|
committer | 2010-08-23 16:08:08 +0200 | |
commit | 142362bcf755c1250c60c0942e71a1677d2b2e48 (patch) | |
tree | a56c81c0a75adc291a2f6449ac87d164b1ee5391 | |
parent | update manifest (diff) | |
download | iElectric-142362bcf755c1250c60c0942e71a1677d2b2e48.tar.gz iElectric-142362bcf755c1250c60c0942e71a1677d2b2e48.tar.bz2 iElectric-142362bcf755c1250c60c0942e71a1677d2b2e48.zip |
adding lirc patched to install wb677 for ION 330 remote
47 files changed, 7814 insertions, 0 deletions
diff --git a/app-misc/lirc/ChangeLog b/app-misc/lirc/ChangeLog new file mode 100644 index 0000000..c5e47d9 --- /dev/null +++ b/app-misc/lirc/ChangeLog @@ -0,0 +1,967 @@ +# ChangeLog for app-misc/lirc +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/ChangeLog,v 1.216 2010/05/21 02:47:00 beandog Exp $ + +*lirc-0.8.6-r4 (23 Aug 2010) + + 23 Aug 2010; Domen Kožar <domen@dev.si> +files/2.6.33.patch, + +files/lirc-0.8.3-imon-pad2keys.patch, + +files/lirc-0.8.3-kernel-2.6.26.diff, + +files/lirc-0.8.3-kernel-2.6.27.diff, +files/lirc-0.8.3-pa19.patch, + +files/lirc-0.8.3_pre1-imon-pad2keys.patch, + +files/lirc-0.8.3_pre1-kernel-2.6.24.diff, + +files/lirc-0.8.3_pre1-remotewonderplus.patch, + +files/lirc-0.8.3_pre3-imon-pad2keys.patch, + +files/lirc-0.8.4-portaudio_check.patch, +files/irexec-initd-0.8.6-r2, + +files/lirc-0.8.6-i2c.patch, +files/lirc-0.8.6-send-evsyn.diff, + +files/Makefile, +files/Makefile.old, +files/Module.symvers, + +files/autoconf.patch, +files/irexec-confd, +files/irexec-initd, + +files/lirc-nct677x-lirc0.8.6.patch, +files/lirc_wb677_common_extern.h, + +files/lirc_wb677_main.c, +files/lirc_wb677_main.o, + +files/lirc_wb677_mouse_kbd.c, +files/lirc_wb677.h, +files/lircd-0.8.3, + +files/lirc_wb677_mouse_kbd.h, +files/lirc_wb677.ko, + +files/lirc_wb677.mod.c, +files/lircd-0.8.6, + +files/lirc_wb677_mouse_kbd.o, +files/lirc_wb677.mod.o, + +files/lirc_wb677.o, +lirc-0.8.6-r4.ebuild, +files/lircd, + +files/lircd.conf.2, +files/lircd.conf.wb677, +files/lircmd, + +files/lircrc_nuvoton, +files/modprobed.lirc, +files/modules.order, + +files/modulesd.lirc, +files/wb83677hg_ir.h, +files/xbox-lircd.conf, + +metadata.xml: + Add support for wb677 driver for ION 330 remote + +*lirc-0.8.7_pre1 (21 May 2010) + + 21 May 2010; Steve Dibb <beandog@gentoo.org> +lirc-0.8.7_pre1.ebuild: + Version bump + +*lirc-0.8.6-r3 (21 May 2010) + + 21 May 2010; Steve Dibb <beandog@gentoo.org> files/lircd-0.8.6, + +lirc-0.8.6-r3.ebuild, +files/lirc-0.8.6-i2c.patch, + +files/lirc-0.8.6-send-evsyn.diff: + I2C patch to build against gentoo-sources-2.6.32, bug 296739; Add + localmount, modules to startup init, bug 314545; evdev input patch, bug + 299030 + + 21 May 2010; Steve Dibb <beandog@gentoo.org> files/lircd.conf.2: + Typo in conf.d sample, bug 301346 + + 10 Mar 2010; Joseph Jezak <josejx@gentoo.org> lirc-0.8.6-r2.ebuild: + Marked ~ppc/~ppc64 for bug #287662. + +*lirc-0.8.6-r2 (15 Nov 2009) + + 15 Nov 2009; Matthias Schwarzott <zzam@gentoo.org> + +files/irexec-initd-0.8.6-r2, +lirc-0.8.6-r2.ebuild: + Let irexec init-script depend on the virtual service lirc to be able to + use a different lirc server, Bug #277588. + + 03 Nov 2009; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.6-r1.ebuild: + Change ebuild, so that lirc package does no longer own lircd.conf. That + way portage should not delete lircd.conf on update or unmerge. + + 03 Nov 2009; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.6-r1.ebuild: + Change ebuild, so that lirc package does no longer own lircd.conf. That + way portage should not delete lircd.conf on update or unmerge. + + 06 Oct 2009; Christian Faulhammer <fauli@gentoo.org> lirc-0.8.5.ebuild: + remove iguanaIR, because it is still in testing + +*lirc-0.8.6-r1 (04 Oct 2009) + + 04 Oct 2009; Christian Faulhammer <fauli@gentoo.org> +files/lircd-0.8.6, + -lirc-0.8.6.ebuild, +lirc-0.8.6-r1.ebuild: + Revision bump that will fix some new and some old issues: + * Merge mceusb and mceusb2 driver (bug 286269 by candrews AT integralblue + DOT com) + * New init.d file that will keep the old socket location so we don't break + all applications (thanks to Oldrich Jedlicka <oldium DOT pro AT seznam DOT + cz> in bug 286451) + * Add new ene0100 device + * Correct entry for iguanaIR device (bug 208785 by MasterC <MasterCLC AT + gmail DOT com>) + * Fix DEPEND and RDEPEND relations + + 04 Oct 2009; Christian Faulhammer <fauli@gentoo.org> lirc-0.8.5.ebuild: + readd stable keywords that have been accidentally removed + + 03 Oct 2009; Christian Faulhammer <fauli@gentoo.org> lirc-0.8.5.ebuild: + Rework dependencies: + * Add dev-embedded/libftdi for some drivers, bug 276518 (with help + from sping) + * Correct assignment of RDEPEND and DEPEND + + 25 Sep 2009; Diego E. Pettenò <flameeyes@gentoo.org> lirc-0.8.4.ebuild, + -files/lirc-0.8.4-imon-pad2keys.patch, lirc-0.8.4a.ebuild: + Remove duplicate patch. + +*lirc-0.8.6 (23 Sep 2009) + + 23 Sep 2009; Christian Faulhammer <fauli@gentoo.org> +lirc-0.8.6.ebuild: + version bump, bug 284865 + + 29 Aug 2009; nixnut <nixnut@gentoo.org> lirc-0.8.5.ebuild: + ppc stable #275872 + + 11 Jul 2009; <chainsaw@gentoo.org> lirc-0.8.5.ebuild: + Marked stable on AMD64 for bug #275872; compile-tested on a dual Opteron + 2354. No IR-capable hardware but utilities tested and working. + + 30 Jun 2009; Christian Faulhammer <fauli@gentoo.org> lirc-0.8.5.ebuild: + stable x86, bug 275872 + + 18 Jun 2009; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.4a.ebuild, + lirc-0.8.5.ebuild: + Rename modprobe config file to lirc.conf + +*lirc-0.8.5 (17 Jun 2009) + + 17 Jun 2009; Steve Dibb <beandog@gentoo.org> +lirc-0.8.5.ebuild: + Version bump, bug 271482 + + 18 Mar 2009; Joseph Jezak <josejx@gentoo.org> lirc-0.8.4.ebuild: + Marked ppc stable for bug #253920. + + 13 Mar 2009; Christian Faulhammer <fauli@gentoo.org> + +files/lirc-0.8.4-portaudio_check.patch, lirc-0.8.4.ebuild, + lirc-0.8.4a.ebuild: + Only detect media-libs/portaudio if LIRC_DEVICES=audio is enabled, thus + preventing build failures, see bug 251703 and bug 251522 + + 10 Mar 2009; Steve Dibb <beandog@gentoo.org> lirc-0.8.4.ebuild, + lirc-0.8.4a.ebuild: + Fix amd64 keywords, bug 253920 + + 10 Mar 2009; Steve Dibb <beandog@gentoo.org> lirc-0.8.4a.ebuild: + amd64 stable, bug 253920 + + 07 Mar 2009; Christian Faulhammer <fauli@gentoo.org> lirc-0.8.4.ebuild: + stable x86, bug 253920 + + 28 Feb 2009; Christian Faulhammer <fauli@gentoo.org> + -files/lirc-0.8.0-conf-pixelview_bt878.diff, + -files/lirc-0.8.0-i2c-kernel-2.6.17.diff, + -files/lirc-0.8.0-imon-pad2keys.patch, + -files/lirc-0.8.0-kernel-2.6.16.diff, + -files/lirc-0.8.0-kernel-2.6.17.diff, + -files/lirc-0.8.0-kernel-2.6.18.diff, + -files/lirc-0.8.0-kernel-2.6.19.diff, -files/lirc-0.8.0-sandbox-fix.diff, + -files/lirc-0.8.0-too-many-connections-overflow.diff, + -files/lirc-0.8.0pre4-xbox-remote.diff, + -files/lirc-0.8.1-atiusb-xbox.diff, -files/lirc-0.8.1-imon-pad2keys.patch, + -files/lirc-0.8.1-kernel-2.6.20.diff, + -files/lirc-0.8.2-kernel-2.6.22.patch, + -files/lirc-0.8.2-kernel-2.6.23.patch, -files/lirc-udev-094.diff, + -files/lirc-remotewonderplus.patch, -files/lircd.conf, + -lirc-0.8.0-r8.ebuild, -lirc-0.8.1.ebuild, -lirc-0.8.2_pre2.ebuild, + -lirc-0.8.2.ebuild, -lirc-0.8.2-r1.ebuild, -lirc-0.8.2-r2.ebuild, + -lirc-0.8.3_pre3.ebuild, -lirc-0.8.3.ebuild, -lirc-0.8.3-r1.ebuild: + clean up, hopefully without breaking anything + +*lirc-0.8.4a (28 Feb 2009) + + 28 Feb 2009; Christian Faulhammer <fauli@gentoo.org> +lirc-0.8.4a.ebuild: + version bump for 251703 and fix for 251522 + + 10 Jan 2009; Steve Dibb <beandog@gentoo.org> lirc-0.8.3-r1.ebuild, + lirc-0.8.3-r2.ebuild, lirc-0.8.4.ebuild: + Remove MODULE_UNLOAD kernel check, add ewarn notice + + 25 Dec 2008; Thomas Anderson <gentoofan23@gentoo.org> + +files/lirc-0.8.3-kernel-2.6.27.diff, lirc-0.8.3-r2.ebuild: + Add Kernel 2.6.27 compatibility to lirc-0.8.3-r2. Fixes bug #236713, thanks + to James <cctsurf at gmail dot com> for the patch. Committed with permission + of beandog + + 17 Nov 2008; Diego E. Pettenò <flameeyes@gentoo.org> + files/lirc-0.8.3_pre1-kernel-2.6.24.diff: + Fix patch with absolute paths. + +*lirc-0.8.4 (12 Oct 2008) + + 12 Oct 2008; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.4-imon-pad2keys.patch, lirc-0.8.0-r8.ebuild, + +lirc-0.8.4.ebuild: + Version bumped. This adds Kernel 2.6.27 compatibility. Added driver + options irlink, commandir, ite8709 and samsung, Bug #221727. Removed + portaudio patch. Shorten description of lirc-0.8.0-r8. + + 12 Oct 2008; Matthias Schwarzott <zzam@gentoo.org> files/lircd.conf.2: + Fix config example for devinput, Bug #235107 + + 08 Aug 2008; Steve Dibb <beandog@gentoo.org> lirc-0.8.3-r2.ebuild: + amd64 stable, bug 230792 + + 01 Aug 2008; nixnut <nixnut@gentoo.org> lirc-0.8.3-r2.ebuild: + Stable on ppc wrt bug 230792 + + 31 Jul 2008; Ulrich Mueller <ulm@gentoo.org> metadata.xml: + Add USE flag description to metadata wrt GLEP 56. + + 28 Jul 2008; Matthias Schwarzott <zzam@gentoo.org> + files/lirc-0.8.3-kernel-2.6.26.diff: + Remove those annoying cvs-keywords from the patch, bug #233081 + + 26 Jul 2008; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.3-kernel-2.6.26.diff, lirc-0.8.3-r2.ebuild: + Make lirc compile against linux-2.6.26, thanks to enkil <enkil@cvmx.org> for + the patch, Bug #231867. + + 17 Jul 2008; Christian Faulhammer <opfer@gentoo.org> lirc-0.8.3-r2.ebuild: + stable x86, bug 230792 + + 16 Jun 2008; Samuli Suominen <drac@gentoo.org> + +files/lirc-0.8.3-pa19.patch, lirc-0.8.3-r2.ebuild: + Portaudio v19 patch from bug 222841, Comment #8 by Thomas Beierlein. + + 06 Jun 2008; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.3-r2.ebuild: + Added imon_lcd to list of possible lirc_devices, thanks to Jan Paesmans + <jan.paesmans@gmail.com>. + +*lirc-0.8.3-r2 (19 May 2008) + + 19 May 2008; Matthias Schwarzott <zzam@gentoo.org> +files/modprobed.lirc, + +lirc-0.8.3-r2.ebuild: + Removed old syntax from modprobe config file. + +*lirc-0.8.3-r1 (10 May 2008) + + 10 May 2008; Steve Dibb <beandog@gentoo.org> +lirc-0.8.3-r1.ebuild: + Check for MODULE_UNLOAD in kernel + + 05 May 2008; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.3.ebuild: + Adding hack to stop portage from deleting lircd.conf. + +*lirc-0.8.3 (05 May 2008) + + 05 May 2008; Matthias Schwarzott <zzam@gentoo.org> +files/lircd-0.8.3, + +files/lirc-0.8.3-imon-pad2keys.patch, +lirc-0.8.3.ebuild: + Version bumped. Init-script changes: Now provide lirc, Bug #190669. Use + pidfile to allow starting more than one lircd, Bug #212551. This may also + fix the Kernel Oops of Bug #218612. Fixed keys in imon-pad2keys config, + Bug #219101. Do install all avail remote config files to + /usr/share/lirc/remotes and skip the auto-preserving of the old conf-file, + Bug #219097. + + 04 May 2008; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.3_pre3.ebuild: + Added imon_knob to possible LIRC_DEVICES, Bug #208719. + +*lirc-0.8.3_pre3 (28 Apr 2008) + + 28 Apr 2008; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.3_pre3-imon-pad2keys.patch, +lirc-0.8.3_pre3.ebuild: + Version bumped. Create /etc/modprobe.d instead of /etc/modules.d, Bug + #214019. + + 16 Apr 2008; Markus Rothe <corsair@gentoo.org> lirc-0.8.3_pre1.ebuild: + Stable on ppc64; bug #208433 + + 28 Mar 2008; Markus Meier <maekke@gentoo.org> lirc-0.8.3_pre1.ebuild: + amd64 stable, bug #208433 + + 06 Feb 2008; nixnut <nixnut@gentoo.org> lirc-0.8.3_pre1.ebuild: + stable on ppc wrt bug #208433 + + 01 Feb 2008; Christian Faulhammer <opfer@gentoo.org> + lirc-0.8.3_pre1.ebuild: + stable x86, bug 208433 + + 28 Dec 2007; Joerg Bornkessel <hd_brummy@gentoo.org> + files/lirc-0.8.3_pre1-kernel-2.6.24.diff, lirc-0.8.3_pre1.ebuild: + rewrite patch; bug 200508 + + 27 Dec 2007; Joerg Bornkessel <hd_brummy@gentoo.org> + lirc-0.8.3_pre1.ebuild: + removed workless kernel-2.6.24.diff, wont work with LIRC_DEVICES=serial; + reopend bug 200508 + + 26 Dec 2007; Joerg Bornkessel <hd_brummy@gentoo.org> + lirc-0.8.3_pre1.ebuild: + fixed typo; patch/diff + + 26 Dec 2007; Joerg Bornkessel <hd_brummy@gentoo.org> + +files/lirc-0.8.3_pre1-kernel-2.6.24.diff, lirc-0.8.3_pre1.ebuild: + bug 200508 fixed; thanks to A.Stirling M.Marte T.Kost + + 02 Dec 2007; Markus Rothe <corsair@gentoo.org> lirc-0.8.2-r2.ebuild: + Stable on ppc64; bug #197768 + + 16 Nov 2007; Steve Dibb <beandog@gentoo.org> lirc-0.8.2-r2.ebuild: + amd64 stable, bug 197768 + + 12 Nov 2007; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.2-r2.ebuild, + lirc-0.8.3_pre1.ebuild: + Fix libusb depend for atilibusb driver, Bug #196994. + + 12 Nov 2007; Matthias Schwarzott <zzam@gentoo.org> +files/lircd.conf.2, + lirc-0.8.2-r2.ebuild, lirc-0.8.3_pre1.ebuild: + Supply a good default conf-file. This fixes Bug 198482. + + 02 Nov 2007; Lars Weiler <pylon@gentoo.org> lirc-0.8.2-r2.ebuild: + stable ppc, bug #197768 + + 01 Nov 2007; Christian Faulhammer <opfer@gentoo.org> lirc-0.8.2-r2.ebuild: + stable x86, bug 197768 + + 18 Oct 2007; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.2-r1.ebuild, + lirc-0.8.2-r2.ebuild, lirc-0.8.3_pre1.ebuild: + Disabling lirc_gpio for Kernel 2.6.22+, as it did not work/failed to + compile, Bug #187418. + + 18 Oct 2007; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.3_pre1.ebuild: + Force non-parallel make. Bug #196134. + + 17 Oct 2007; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.3_pre1-imon-pad2keys.patch, lirc-0.8.3_pre1.ebuild: + Updated imon-pad2key patch. This makes the option switchable via + module-parameter instead of recompiling. Bug 196134 + + 14 Oct 2007; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.3_pre1-remotewonderplus.patch, lirc-0.8.3_pre1.ebuild: + Fixed some sed code, Bug 195786. Fixed remotewonderplus patch. + +*lirc-0.8.3_pre1 (13 Oct 2007) + + 13 Oct 2007; Matthias Schwarzott <zzam@gentoo.org> + +lirc-0.8.3_pre1.ebuild: + Added new pre-release ebuild. This improves gpio support with newer kernels. + + 13 Oct 2007; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.2-r2.ebuild: + Switch installing to emake. + + 13 Oct 2007; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r8.ebuild, + lirc-0.8.1.ebuild, lirc-0.8.2_pre2.ebuild, lirc-0.8.2.ebuild, + lirc-0.8.2-r1.ebuild, lirc-0.8.2-r2.ebuild: + General cleanup, and quote fixing. + +*lirc-0.8.2-r2 (11 Oct 2007) + + 11 Oct 2007; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.2-kernel-2.6.23.patch, +lirc-0.8.2-r2.ebuild: + Fixed device-node to work with udev-115-r2+. Compiling fixed for Kernel + 2.6.23+, Bug 195432. + + 01 Sep 2007; Joseph Jezak <josejx@gentoo.org> lirc-0.8.2-r1.ebuild: + Marked ppc stable for bug #187822. + + 14 Aug 2007; Markus Rothe <corsair@gentoo.org> lirc-0.8.2-r1.ebuild: + Stable on ppc64; bug #187822 + + 14 Aug 2007; Christian Faulhammer <opfer@gentoo.org> lirc-0.8.2-r1.ebuild: + stable x86, bug 187822 + + 13 Aug 2007; Doug Goldstein <cardoe@gentoo.org> lirc-0.8.2-r1.ebuild: + amd64 stable + +*lirc-0.8.2-r1 (12 Aug 2007) + + 12 Aug 2007; Steve Dibb <beandog@gentoo.org> + +files/lirc-0.8.2-kernel-2.6.22.patch, +lirc-0.8.2-r1.ebuild: + Fix compile under 2.6.22, bug 187822 + + 22 Jul 2007; David Shakaryan <omp@gentoo.org> lirc-0.8.0-r8.ebuild: + Remove virtual/x11 from dependencies. + +*lirc-0.8.2 (04 Jul 2007) + + 04 Jul 2007; Matthias Schwarzott <zzam@gentoo.org> +lirc-0.8.2.ebuild: + Version bumped. Adds support for macmini and ttusbir. Removed special + settings com? and lpt?, use serial und parallel instead, and set io-ports + with module-parameters. + + 27 Jun 2007; Raúl Porcel <armin76@gentoo.org> lirc-0.8.0-r8.ebuild, + lirc-0.8.1.ebuild, lirc-0.8.2_pre2.ebuild: + Drop alpha/ia64 keyword as nobody has hardware to test + + 24 May 2007; Matthias Schwarzott <zzam@gentoo.org> files/irexec-initd: + Fixed irexec initscript to work with non-bash shells, Bug #179634. + + 18 May 2007; Matthias Schwarzott <zzam@gentoo.org> metadata.xml: + Assigned to herd media-tv. + +*lirc-0.8.2_pre2 (27 Apr 2007) + + 27 Apr 2007; Matthias Schwarzott <zzam@gentoo.org> + +lirc-0.8.2_pre2.ebuild: + Version bumped. + + 27 Apr 2007; Matthias Schwarzott <zzam@gentoo.org> -lirc-0.8.0-r5.ebuild: + Removed old ebuild. + + 21 Apr 2007; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r5.ebuild, + lirc-0.8.0-r8.ebuild, lirc-0.8.1.ebuild: + Corrected --without-X to the correct lower case version --without-x, now it + has an effect, solving Bug #173174. + + 08 Apr 2007; Christian Faulhammer <opfer@gentoo.org> lirc-0.8.1.ebuild: + stable amd64, bug 166557 + + 07 Apr 2007; Joseph Jezak <josejx@gentoo.org> lirc-0.8.1.ebuild: + Marked ppc stable for bug #166557. + + 02 Apr 2007; Raúl Porcel <armin76@gentoo.org> lirc-0.8.1.ebuild: + ia64 stable wrt bug 166557 + + 27 Mar 2007; Christian Faulhammer <opfer@gentoo.org> lirc-0.8.1.ebuild: + stable x86, bug 166557 + + 15 Mar 2007; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.1.ebuild: + Added lirc device usb_uirt_raw, as requested by Robert Parenton + <rparenton@lada.org>, Bug #170698. + + 27 Feb 2007; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.1.ebuild: + Fixed disabling lirc_parallel on SMP systems, thanks to Helau + <helmut@helmutauer.de>. + + 22 Feb 2007; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.1-kernel-2.6.20.diff, lirc-0.8.1.ebuild: + Added patch to compile with kernel 2.6.20, Bug #166557. + + 14 Jan 2007; Joseph Jezak <josejx@gentoo.org> lirc-0.8.0-r8.ebuild: + Marked ppc stable for bug #159980. + + 09 Jan 2007; Markus Rothe <corsair@gentoo.org> lirc-0.8.0-r8.ebuild: + Stable on ppc64; bug #159980 + + 08 Jan 2007; Matthias Schwarzott <zzam@gentoo.org> -lirc-0.7.0-r1.ebuild, + -lirc-0.7.2.ebuild, -lirc-0.8.0-r1.ebuild, -lirc-0.8.1_pre5.ebuild: + Removed some old cruft, solving Bug #159983. + +*lirc-0.8.1 (07 Jan 2007) + + 07 Jan 2007; Matthias Schwarzott <zzam@gentoo.org> +lirc-0.8.1.ebuild: + Version bumped. + + 06 Jan 2007; Bryan Østergaard <kloeri@gentoo.org> lirc-0.8.0-r8.ebuild, + lirc-0.8.1_pre5.ebuild: + Stable on Alpha. + + 06 Jan 2007; Matthias Schwarzott <zzam@gentoo.org> lirc-0.7.0-r1.ebuild, + lirc-0.7.2.ebuild, lirc-0.8.0-r1.ebuild, lirc-0.8.0-r5.ebuild, + lirc-0.8.0-r8.ebuild, lirc-0.8.1_pre5.ebuild: + Converted to elog. + + 04 Jan 2007; Peter Weller (welp) <welp@gentoo.org> lirc-0.8.0-r8.ebuild: + Stable on amd64 wrt bug #159980 + + 04 Jan 2007; Bryan Østergaard <kloeri@gentoo.org> lirc-0.8.0-r8.ebuild, + lirc-0.8.1_pre5.ebuild: + Stable on IA64. + + 04 Jan 2007; Christian Faulhammer <opfer@gentoo.org> lirc-0.8.0-r8.ebuild: + stable x86, bug #159980 + +*lirc-0.8.1_pre5 (03 Jan 2007) + + 03 Jan 2007; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.1-atiusb-xbox.diff, +files/lirc-0.8.1-imon-pad2keys.patch, + +lirc-0.8.1_pre5.ebuild: + Added a pre-release as it contains a lot of fixes, thanks to mcummings for + noticing. Use newer xbox-patch that can unconditionally be applied. + + 14 Dec 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.7.2.ebuild, + lirc-0.8.0-r1.ebuild, lirc-0.8.0-r5.ebuild, lirc-0.8.0-r8.ebuild: + Unconditionally installing udev-rules due to Bug #158114. + +*lirc-0.8.0-r8 (02 Dec 2006) + + 02 Dec 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.0-sandbox-fix.diff, files/irexec-confd, + files/irexec-initd, -lirc-0.8.0-r7.ebuild, +lirc-0.8.0-r8.ebuild: + Solve sandbox-violation, fix from dsd, Bug #156807. Starting irexec as user + is now possible, suggested by Sebastian Kemper <sebastian_ml@gmx.net>. + +*lirc-0.8.0-r7 (01 Dec 2006) + + 01 Dec 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.0-too-many-connections-overflow.diff, +files/irexec-confd, + +files/irexec-initd, +files/lirc-remotewonderplus.patch, + -lirc-0.8.0-r6.ebuild, +lirc-0.8.0-r7.ebuild: + Fixing overflow, Bug #123704. Allow building more than one driver (with big + warning), Bug #144951. Added irexec-initscript, Bug #124295. Added support + for remotewonderplus-device, Bug #149130. + +*lirc-0.8.0-r6 (30 Nov 2006) + + 30 Nov 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.0-kernel-2.6.19.diff, +lirc-0.8.0-r6.ebuild: + Makes lirc compatible with kernel-2.6.19 + + 24 Nov 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r1.ebuild, + lirc-0.8.0-r5.ebuild: + Switched over to request latest autoconf/automake as that also works. + + 05 Oct 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r1.ebuild, + lirc-0.8.0-r5.ebuild: + Removed unused use-flags alsa and usb, due to Bug #150083. + + 24 Sep 2006; Michael Hanselmann <hansmi@gentoo.org> lirc-0.8.0-r5.ebuild: + Stable on ppc. + + 19 Sep 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r1.ebuild, + lirc-0.8.0-r5.ebuild: + Now depend on the correct autotools versions, as no longer all versions are + automagically pulled in by system. + + 15 Sep 2006; Matthias Schwarzott <zzam@gentoo.org> -lirc-0.8.0.ebuild: + Removed older revision. + + 12 Sep 2006; <blubb@gentoo.org> lirc-0.8.0-r5.ebuild: + stable on amd64 + + 07 Sep 2006; Markus Rothe <corsair@gentoo.org> lirc-0.8.0-r5.ebuild: + Stable on ppc64; bug #146725 + + 07 Sep 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r5.ebuild: + Stable on x86. + + 07 Sep 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r5.ebuild: + Stable on x86. + + 04 Sep 2006; <blubb@gentoo.org> lirc-0.8.0-r1.ebuild: + stable on amd64 + + 03 Sep 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r5.ebuild: + Added conditional depend on inputlircd as it now has all necessary keywords. + + 03 Sep 2006; <blubb@gentoo.org> lirc-0.8.0-r5.ebuild: + added ~amd64 + + 04 Aug 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.0-conf-pixelview_bt878.diff, -lirc-0.8.0-r3.ebuild, + -lirc-0.8.0-r4.ebuild, lirc-0.8.0-r5.ebuild: + Removed older ebuild-revisions. Added a patch to solve bug #142732, thanks + to Bartlomiej Celary <semiquasi@o2.pl> for reporting. + +*lirc-0.8.0-r5 (31 Jul 2006) + + 31 Jul 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.0-i2c-kernel-2.6.17.diff, +lirc-0.8.0-r5.ebuild: + Added Patch from lirc-cvs to solve issue with Kernel 2.6.17/ivtv driver, see + Bug #141841. + + 27 Jul 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r4.ebuild: + Bugfix, now also apply xbox-patch when xbox-driver was autoselected by + PROFILE_ARCH. + + 27 Jul 2006; Matthias Schwarzott <zzam@gentoo.org> + files/lirc-0.8.0-kernel-2.6.17.diff: + Small change to match the patch in lirc-cvs. + +*lirc-0.8.0-r4 (25 Jul 2006) + + 25 Jul 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.0-kernel-2.6.18.diff, +files/modulesd.lirc, + +lirc-0.8.0-r4.ebuild: + Added patch for compatibility with kernel 2.6.18. Set compiled in default + device-node depending on activated driver (for e.g. usbirboy), removed older + hack for setting device-node. Without set driver use option userspace. Added + /etc/modules.d/lirc. + + 23 Jul 2006; Tobias Scherbaum <dertobi123@gentoo.org> + lirc-0.8.0-r1.ebuild, lirc-0.8.0-r3.ebuild: + 0.8.0-r1 ppc stable, 0.8.0-r3 added ~ppc, bug #138636 + + 12 Jul 2006; Aron Griffis <agriffis@gentoo.org> lirc-0.8.0-r1.ebuild: + Mark 0.8.0-r1 stable on ia64 + + 06 Jul 2006; Markus Rothe <corsair@gentoo.org> lirc-0.8.0-r1.ebuild: + Stable on ppc64 + + 05 Jul 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0-r1.ebuild: + Marked stable on x86. + +*lirc-0.8.0-r3 (30 Jun 2006) + + 30 Jun 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-udev-094.diff, lirc-0.8.0-r1.ebuild, -lirc-0.8.0-r2.ebuild, + +lirc-0.8.0-r3.ebuild: + Added patch to solve Bug #138532. Install udev-rules-file conditionally by + use-flag udev and not based on existance of sys-fs/udev. + + 30 Jun 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0.ebuild, + lirc-0.8.0-r1.ebuild, lirc-0.8.0-r2.ebuild: + Corrected missing function call in error-handling. + + 26 Jun 2006; Markus Rothe <corsair@gentoo.org> lirc-0.8.0-r2.ebuild: + Added ~ppc64; bug #138025 + + 26 Jun 2006; Simon Stelling <blubb@gentoo.org> lirc-0.8.0.ebuild: + stable on amd64 + +*lirc-0.8.0-r2 (26 Jun 2006) + + 26 Jun 2006; Matthias Schwarzott <zzam@gentoo.org> +lirc-0.8.0-r2.ebuild: + Added support for using external-driver-ebuild usbirboy. Degraded keywords + to only ~x86. + + 21 Jun 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.0-kernel-2.6.17.diff, lirc-0.8.0.ebuild, + lirc-0.8.0-r1.ebuild: + Make it compile with Kernel 2.6.17, solving Bug #137409. + + 07 Jun 2006; Markus Rothe <corsair@gentoo.org> lirc-0.8.0-r1.ebuild: + Added ~ppc64; bug #131306 + +*lirc-0.8.0-r1 (05 Jun 2006) + + 05 Jun 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.0-imon-pad2keys.patch, + +files/lirc-0.8.0pre4-xbox-remote.diff, +lirc-0.8.0-r1.ebuild: + Redesigned ebuild to use use-expanded variable LIRC_DEVICES instead of + LIRC_OPTS. Now uses /dev/lirc/0 per default as created by udev. Has proper + depends now (Bug #131306). Added support for xboxusb (Bug #135490). Added + imon_pad2keys driver. Removed ~ppc64 because of not keyworded + media-libs/libirman. + + 31 May 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0.ebuild: + Small corrections (sleep -> epause, added missing call to + linux-mod_pkg_preinst) + + 29 May 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0.ebuild: + DEPEND-Cosmetics. + + 21 May 2006; Markus Rothe <corsair@gentoo.org> lirc-0.8.0.ebuild: + Stable on ppc64 + + 03 May 2006; Matthias Schwarzott <zzam@gentoo.org> metadata.xml: + Set maintainer to myself + + 27 Apr 2006; Marien Zwart <marienz@gentoo.org> files/digest-lirc-0.7.2, + files/digest-lirc-0.8.0, Manifest: + Fixing SHA256 digest, pass four + + 16 Apr 2006; Michael Hanselmann <hansmi@gentoo.org> lirc-0.8.0.ebuild: + Stable on ppc. + + 14 Apr 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0.ebuild: + Marked stable on x86 + + 14 Apr 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0.ebuild: + Moved WANT_AUTOCONF to pkg_setup - Thanks to Przemyslaw Maciag + <p_maciag@wp.pl> for reporting - Bug #123727 + + 14 Apr 2006; Matthias Schwarzott <zzam@gentoo.org> + +files/lirc-0.8.0-kernel-2.6.16.diff, lirc-0.8.0.ebuild: + Added patch to compile against Kernel 2.6.16 - Thanks to Paul Marks + <pmarks@purdue.edu> and Marc Rodarte <mrodarte19@gmail.com> - See Bug + #127122 + + 06 Mar 2006; Simon Stelling <blubb@gentoo.org> lirc-0.7.0-r1.ebuild: + somehow the files vanished from SRC_URI.. fixing that + + 20 Feb 2006; Gustavo Zacarias <gustavoz@gentoo.org> ChangeLog: + Fix lirc-0.8.0 digests + +*lirc-0.8.0 (20 Feb 2006) + + 20 Feb 2006; Heinrich Wendel <lanius@gentoo.org> + -files/lirc-0.6.6-gentoo.diff.bz2, -files/lirc-0.7.0-configure.in.patch, + -files/lirc-0.7.0_pre2-i2c.patch.gz, + -files/lirc-0.7.0_pre7-configure.patch, + -files/lirc-0.7.0_pre7-streamzap.patch.bz2, files/lircd.conf, + -lirc-0.8.0_pre1.ebuild, -lirc-0.8.0_pre3.ebuild, +lirc-0.8.0.ebuild: + version bump; cleanups; modular X port + +*lirc-0.8.0_pre3 (10 Jan 2006) + + 10 Jan 2006; Doug Goldstein <cardoe@gentoo.org> +lirc-0.8.0_pre3.ebuild: + Reworked the ebuild a little bit and hopefully fixed the problems people are + having with it. + + 05 Jan 2006; Jeremy Huddleston <eradicator@gentoo.org> + lirc-0.8.0_pre1.ebuild: + Fixed modular X dependency. + + 03 Jan 2006; Diego Pettenò <flameeyes@gentoo.org> lirc-0.8.0_pre1.ebuild: + Replace libtoolize with eautoreconf so that it does not break with + mis-versioning with portage sanity checks. + + 14 Dec 2005; Doug Goldstein <cardoe@gentoo.org> lirc-0.7.2.ebuild: + Adding modular X depends + + 04 Dec 2005; Jeroen Roovers <jer@gentoo.org> lirc-0.7.0-r1.ebuild: + Fixed sed script number two. + +*lirc-0.7.2 (23 Aug 2005) + + 23 Aug 2005; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.1.ebuild, + +lirc-0.7.2.ebuild: + version bump; fix rules file + + 10 Jul 2005; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.1.ebuild: + add udev rules file, bug #98171 + + 15 May 2005; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0-r1.ebuild, + lirc-0.7.1.ebuild: + add support for the X use flag, bug #91624 + + 14 May 2005; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0-r1.ebuild, + lirc-0.7.1.ebuild: + make xbox patch default in 0.7.0; uncomment it in 0.7.1, is doesn't work there + + 11 May 2005; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.1.ebuild: + always apply the xbox patch, it still has to be enabled + +*lirc-0.7.1 (22 Apr 2005) + + 22 Apr 2005; Heinrich Wendel <lanius@gentoo.org> +lirc-0.7.1.ebuild: + version bump + + 13 Apr 2005; Heinrich Wendel <lanius@gentoo.org> -lirc-0.7.0_pre3.ebuild, + -lirc-0.7.0_pre6.ebuild, -lirc-0.7.0_pre7.ebuild, -lirc-0.7.0_pre8.ebuild, + -lirc-0.7.0.ebuild, lirc-0.7.0-r1.ebuild: + don't overwrite lircd.conf, bug #88199 + + 13 Apr 2005; Heinrich Wendel <lanius@gentoo.org> -lirc-0.7.0_pre3.ebuild, + -lirc-0.7.0_pre6.ebuild, -lirc-0.7.0_pre7.ebuild, -lirc-0.7.0_pre8.ebuild, + -lirc-0.7.0.ebuild, lirc-0.7.0-r1.ebuild: + cleanups + + 13 Apr 2005; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0-r1.ebuild: + fix bt878 compilation, bug #87505 + + 13 Apr 2005; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0-r1.ebuild: + update driver list; fix smp detection + + 31 Mar 2005; Aron Griffis <agriffis@gentoo.org> lirc-0.7.0-r1.ebuild: + stable on ia64 + + 25 Mar 2005; Bryan Østergaard <kloeri@gentoo.org> lirc-0.7.0-r1.ebuild: + Stable on alpha, bug 84888. + + 24 Mar 2005; Joseph Jezak <josejx@gentoo.org> lirc-0.7.0-r1.ebuild: + Marked ppc stable for bug #84888. + + 10 Mar 2005; Markus Rothe <corsair@gentoo.org> lirc-0.7.0-r1.ebuild: + Stable on ppc64 + + 26 Jan 2005; lanius@gentoo.org lirc-0.7.0-r1.ebuild: + filter some flags; stable on amd64 + + 20 Jan 2005; lanius@gentoo.org lirc-0.7.0-r1.ebuild: + stable on x86 + + 02 Jan 2005; Ciaran McCreesh <ciaranm@gentoo.org> : + Change encoding to UTF-8 for GLEP 31 compliance + + 25 Dec 2004; Doug Goldstein <cardoe@gentoo.org> lirc-0.7.0-r1.ebuild: + compile fix, add libtoolize + + 09 Dec 2004; lanius@gentoo.org lirc-0.7.0-r1.ebuild: + fix dependencies; require autoconf 2.5 + +*lirc-0.7.0-r1 (03 Dec 2004) + + 03 Dec 2004; Chris Bainbridge <chrb@gentoo.org> + +files/lirc-0.7.0-xbox.patch.bz2, +lirc-0.7.0-r1.ebuild: + Added xbox driver. Only used when the xbox profile is selected. + Thanks to Tim Dodge for the patch. + +*lirc-0.7.0_pre8 (03 Dec 2004) + + 03 Dec 2004; Chris Bainbridge <chrb@gentoo.org> +lirc-0.7.0_pre8.ebuild: + Version bump, pre8 doesnt appear to need the patches that were applied to pre7 + + 30 Nov 2004; Brian Jackson <iggy@gentoo.org> metadata.xml, + lirc-0.7.0.ebuild: + update lirc-0.7.0 to use linux-mod, added lanius as maintainer + + 29 Nov 2004; lanius@gentoo.org files/lircd.conf: + fix default path of lirc device, bug #71618 + + 29 Nov 2004; <heino@gentoo.org> lirc-0.7.0.ebuild: + remove bogus configure.in patch + + 22 Nov 2004; Daniel Black <dragonheart@gentoo.org> lirc-0.7.0.ebuild: + added debug support as per bug #71989. Thanks to Colin Macdonald <cbm@sfu.ca> + + 17 Nov 2004; Gustavo Zacarias <gustavoz@gentoo.org> lirc-0.7.0_pre7.ebuild: + Keyworded sparc + +*lirc-0.7.0 (17 Nov 2004) + + 17 Nov 2004; <lanius@gentoo.org> +files/lirc-0.7.0-configure.in.patch, + +files/lirc-0.7.0-streamzap.patch.bz2, -lirc-0.6.6-r1.ebuild, + +lirc-0.7.0.ebuild, -lirc-0.7.0_pre4.ebuild: + - version bump, bug #68613 + - move to kernel-mod eclass, bug #67431 + - fix undefined AC_MACROS, bug #67433 + + 19 Oct 2004; Dylan Carlson <absinthe@gentoo.org> lirc-0.7.0_pre7.ebuild: + Stable on amd64. + + 05 Oct 2004; Pieter Van den Abeele <pvdabeel@gentoo.org> + lirc-0.6.6-r1.ebuild, lirc-0.7.0_pre4.ebuild, lirc-0.7.0_pre7.ebuild: + Masked lirc-0.7.0_pre7.ebuild stable for ppc + + 05 Oct 2004; Pieter Van den Abeele <pvdabeel@gentoo.org> + lirc-0.6.6-r1.ebuild, lirc-0.7.0_pre4.ebuild: + Masked lirc-0.7.0_pre4.ebuild stable for ppc + + 05 Oct 2004; Pieter Van den Abeele <pvdabeel@gentoo.org> + lirc-0.6.6-r1.ebuild: + Masked lirc-0.6.6-r1.ebuild stable for ppc + + 02 Oct 2004; Bryan Østergaard <kloeri@gentoo.org> lirc-0.7.0_pre7.ebuild: + Stable on alpha. + + 28 Sep 2004; Sven Wegener <swegener@gentoo.org> files/lircmd: + Gentoo Technologies, Inc. -> Gentoo Foundation + + 26 Sep 2004; Heinrich Wendel <lanius@gentoo.org> files/lircd: + remove need net from init script + + 26 Sep 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre7-r1.ebuild: + make streamzap driver depend on a use flag, because it can break other things, + bug #64557 + + 25 Sep 2004; Heinrich Wendel <lanius@gentoo.org> + +files/lirc-0.7.0_pre7-configure.patch, lirc-0.7.0_pre7-r1.ebuild, + lirc-0.7.0_pre7.ebuild: + fix typo in configure that leads to a compile error, bug #64356 + +*lirc-0.7.0_pre7-r1 (16 Sep 2004) + + 16 Sep 2004; Heinrich Wendel <lanius@gentoo.org> + +files/lirc-0.7.0_pre7-streamzap.patch.bz2, +lirc-0.7.0_pre7-r1.ebuild: + add streamcap pc remote support, bug #60110, mark pre7 x86 + + 08 Sep 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre7.ebuild: + fix pid file, bug #62838 + + 03 Aug 2004; Michael Sterrett <mr_bones_@gentoo.org> lirc-0.7.0_pre7.ebuild: + fix use invocation + + 03 Aug 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre7.ebuild: + don't use kmod if no modules are build, bug #59250 + + 03 Aug 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre7.ebuild: + check if is_koutput, bug #59159 + + 02 Aug 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre7.ebuild: + add lircmd init script, bug #17167 + +*lirc-0.7.0_pre7 (02 Aug 2004) + + 02 Aug 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre7.ebuild: + version bump, make it work with 2.6 kernels, install graphics + + 28 Jul 2004; Tom Gall <tgall@gentoo.org> lirc-0.7.0_pre6.ebuild: + stable on ppc64, bug #55076 + + 03 Jul 2004; Bryan Østergaard <kloeri@gentoo.org> lirc-0.7.0_pre4.ebuild: + Stable on alpha. + +*lirc-0.7.0_pre6 (30 Jun 2004) + + 30 Jun 2004; Chris Bainbridge <chrb@gentoo.org> +lirc-0.7.0_pre6.ebuild: + Version bump, fix ARCH and xbox config support + + 26 Jun 2004; Danny van Dyk <kugelfang@gentoo.org> lirc-0.7.0_pre4.ebuild: + Marked stable on amd64. + + 07 Jun 2004; Daniel Black <dragonheart@gentoo.org> +metadata.xml, + lirc-0.6.6-r1.ebuild, lirc-0.7.0_pre3.ebuild, lirc-0.7.0_pre4.ebuild: + x86 stable.QA fixes. Use LIRC_OPTS to set options. + + 24 May 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.6.6-r1.ebuild, + lirc-0.7.0_pre2.ebuild, lirc-0.7.0_pre3.ebuild, lirc-0.7.0_pre4.ebuild: + fix GREP in global scope, bug #48382 + + 22 Apr 2004; Danny van Dyk <kugelfang@gentoo.org> lirc-0.7.0_pre4.ebuild: + marked ~amd64. Someone forgot to mark ~amd64 on a version bump. + +*lirc-0.7.0_pre4 (09 Apr 2004) + + 09 Apr 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre4.ebuild: + version bump, enable syslog logging, bug #47311 + + 14 Mar 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre3.ebuild: + fix url to kernel 2.6 patch, remove irda warning, it's obsolete, bug #44395 + +*lirc-0.7.0_pre3 (08 Mar 2004) + + 08 Mar 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre3.ebuild: + version bump + + 24 Feb 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre2.ebuild: + stable on x86 + + 17 Feb 2004; Aron Griffis <agriffis@gentoo.org> lirc-0.7.0_pre2.ebuild: + stable on alpha and ia64 + + 05 Feb 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre2.ebuild, + files/lircd.conf: + added /etc/conf.d/lircd + + 19 Jan 2004; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre2.ebuild, + files/lirc-0.7.0_pre2-i2c.patch.gz: + added patch to compile with i2c 2.8 + + 17 Jan 2004; Bartosch Pixa <darkspecter@gentoo.org> lirc-0.7.0_pre2.ebuild: + set ppc in keywords + + 14 Jan 2004; Brian Jackson <iggy@gentoo.org> lirc-0.6.6-r1.ebuild, + lirc-0.7.0_pre2.ebuild, files/lircd: + updated dates in ebuilds, added ${LIRCD_OPTS} to the start cmd line to + pass extra options to the daemon + + 29 Dec 2003; Sven Blumenstein <bazik@gentoo.org> lirc-0.6.6-r1.ebuild: + Marked sparc to fix gxine depend. + + 29 Dec 2003; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre2.ebuild: + finally fix kernel 2.6 support + + 29 Nov 2003; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre2.ebuild: + fixed typo in LIRC_OPTS + + 26 Nov 2003; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre2.ebuild: + added check for 2.6 kernel which removes all drivers from build + + 25 Nov 2003; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre2.ebuild: + added warning about 2.6 kernel + + 16 Nov 2003; Brad House <brad_mssw@gentoo.org> lirc-0.6.6-r1.ebuild: + mark stable on amd64 + + 23 Oct 2003; Martin Holzer <mholzer@gentoo.org> lirc-0.7.0_pre2.ebuild: + added warning about irda and kernel. Closes #30847. + + 13 Oct 2003; Martin Holzer <mholzer@gentoo.org> : + fixing sandbox issue. closes #30982 + +*lirc-0.7.0_pre2 (11 Oct 2003) + + 11 Oct 2003; Heinrich Wendel <lanius@gentoo.org> lirc-0.6.5.ebuild, + lirc-0.7.0_pre2.ebuild, files/lirc-0.6.5-gentoo.diff.bz2: + cleanups + +*lirc-0.7.0_pre2 (11 Oct 2003) + + 11 Oct 2003; Heinrich Wendel <lanius@gentoo.org> lirc-0.7.0_pre2.ebuild: + version bump + +*lirc-0.6.6-r2 (09 Sep 2003) + + 09 Sep 2003; Martin Holzer <mholzer@gentoo.org> lirc-0.6.6-r2.ebuild, + files/lirc-0.6.6-r2-gentoo.diff.bz2: + Adding 2003-08-01 patch from rivatv.sf.net for asus support + +*lirc-0.6.6-r1 (27 Feb 2003) + + 27 Feb 2003; Mark Guertin <gerk@gentoo.org> lirc-0.6.6-r1.ebuild : + set ~ppc in keywords + +*lirc-0.6.6 (04 Feb 2003) + + 04 Feb 2003; Nick Hadaway <raker@gentoo.org> lirc-0.6.6.ebuild, + files/digest-lirc-0.6.6, files/lirc-0.6.6-gentoo.diff.bz2 : + Migrated previous patch's mknod and depmod related fixes. Added to the + patch removing references to a seemingly missing hw_udp.c. Added + an SMP workaround started on bug #13241. Version bump. + +*lirc-0.6.5 (11 Jul 2002) + + 09 JuL 2002; Georg Sauthoff <g_sauthoff@web.de> lirc-0.6.5.ebuild, files/lircd, + files/lirc-0.6.5-gentoo.diff: Initial ebuild. diff --git a/app-misc/lirc/Manifest b/app-misc/lirc/Manifest new file mode 100644 index 0000000..e74428b --- /dev/null +++ b/app-misc/lirc/Manifest @@ -0,0 +1,47 @@ +AUX 2.6.33.patch 7138 RMD160 6aec1dd049a745a707fdd53be7433cb564155900 SHA1 e6b1f6ad314e25ddea27c65f7291506cb1b9e794 SHA256 0744775f0c5ed37ae97d7cc998296700e4535312b9dba0abc97d9b7c9ce5b1d0 +AUX Makefile 1569 RMD160 697ce3382103fcdaf5a5ac0bfe1582e8cfdc14f4 SHA1 339fbd216f3267356618652a068607afc6632fb2 SHA256 446cb12957c2c4aa183bd5e95642f12a9a89afef183b8b0d5219dc46fe6fcf78 +AUX Makefile.old 2077 RMD160 000269c99f7ac3ccdfc687d80dafce4848e6d78a SHA1 5cbbacca6a2ada8cabfd2df59cebc9df271fef91 SHA256 30fd443f239269abefb82e8548938a3cc3e719729f0bfde2e39d7f30258b2512 +AUX Module.symvers 0 RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 SHA1 da39a3ee5e6b4b0d3255bfef95601890afd80709 SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 +AUX autoconf.patch 6589 RMD160 b880e8b02bac4b7bb1adea645578a0caf6a3ae26 SHA1 5b566aa762ea6f04c6ac36db548709d78b143e1e SHA256 2323b3ad9fad278f6c75df3a57b6ee0c563e8871df34ef01fc458ead60745400 +AUX irexec-confd 280 RMD160 f669c7c98b9d7cac2010284ab6068d29d47ec811 SHA1 c6decc19a273d98d451de137a2ffbe16d5df28ae SHA256 c404ad3b624004cab25bd3a89593cdeb0abbc25771d6e52caf2f37cb4f7b2b79 +AUX irexec-initd 808 RMD160 06b02232f892ab032e2bf8b35bb2945a623a2610 SHA1 5c5630e5434c2430b9a74b725fc5350e29adaede SHA256 9325419aa45d80c205bc1cd47fe839b178da74bca5dd928cbe3ae17423b92493 +AUX irexec-initd-0.8.6-r2 816 RMD160 e9969072ccbdcb284781a4224c9fa2afc72fecaf SHA1 ab066d769417e13c194112ba99f309bb1cb0d2e5 SHA256 5e5a31fbd93294a6e210499a880fcab371b23706824c9d60d827b0187d7bade4 +AUX lirc-0.8.3-imon-pad2keys.patch 11556 RMD160 89a050f7099593000a40b15c46de6137f3b10dfa SHA1 019b1aa3d72df9e4b28796c173fb4fa1fc3e457d SHA256 347c6195d971f8d1a3f4c29a1ff4750d04cea297d16679aeda7529ac1720d42e +AUX lirc-0.8.3-kernel-2.6.26.diff 3233 RMD160 654d6375f8b0a4e45ce2c60d18581cb2dc7c38a3 SHA1 3465689927bd998fcd4e6875ccc004346c93c4cf SHA256 2e70c6806dc24e0c3288f55f5a20ad7484e05752ca8efd5254e3be3ff73cbefd +AUX lirc-0.8.3-kernel-2.6.27.diff 1253 RMD160 9ece885b51b356ef1001f5f58fb913e1931365a6 SHA1 8da93ede404e425bcc676079129ba70e8f581a4b SHA256 64c0e4d7bca25d07f903352329445f6e95c42edd73b21ac040e190609f34807f +AUX lirc-0.8.3-pa19.patch 1954 RMD160 bb90abc0c35fd5e9827ca993bca51d3075ccb3b8 SHA1 7cae24797dd132a226293bd1e47d87505be4c37a SHA256 d5c4959c78a4f83bc494788c45da2ec5fe7d5c1362f82136233068cc2e87ca8e +AUX lirc-0.8.3_pre1-imon-pad2keys.patch 10312 RMD160 6f61031cd3035289b2d52797dd02d027f593873d SHA1 c59aab62c9b59e27b93d5613e050438fcf2c6eed SHA256 2f79f223d5d2e998321284c50edea044ad26ab8607eae1e9e79e7c0ea6a8f2cd +AUX lirc-0.8.3_pre1-kernel-2.6.24.diff 3140 RMD160 ad09e63973827b180530c63a6c49c4e180629198 SHA1 e66cae5faf48a7f9e8d7e391b3fdf6f8984e2074 SHA256 d992cca976d34d7e78a3709908852b828722a9ef18d7ee2151cd1e9de9b529d3 +AUX lirc-0.8.3_pre1-remotewonderplus.patch 943 RMD160 05a0696d51ff01c7d9644ad3ff4d56fef20be439 SHA1 971ad8b27d57c31439a1f7fb87dac2dc39d6c1e8 SHA256 547efbfa30f282ba9100495044e3b720c8f74c44f9a4e34db934d2ac7976fe29 +AUX lirc-0.8.3_pre3-imon-pad2keys.patch 11556 RMD160 96137f08691e341844d7ebc860337e1b6e4baf25 SHA1 885ac9bbcc73e0f815c9e3eb867b36e335eeb52f SHA256 7ce01a1fe0dd2021b9dcf1d3c764d5a4704aab33cd616d92f1ff401f31d17d3f +AUX lirc-0.8.4-portaudio_check.patch 769 RMD160 d83b1a167da5b0c4e09ef716a4fc80f7261f7665 SHA1 81537dc12f897756d24fcf2cf4d178dc8169e360 SHA256 01e2034aaa6a7eb039e5c0e6c3b4a6ed38860614d3d0b0005d99a4aac2b3827e +AUX lirc-0.8.6-i2c.patch 2093 RMD160 f553702710f20975b4ab2b58cf27475e0bc59d93 SHA1 7335f0b9328a01db3634060f90accda950005923 SHA256 c50e4cb6e2539767653ceb68f057d1c9d0a2696ef4efcec097f3a11d7e398bcb +AUX lirc-0.8.6-send-evsyn.diff 563 RMD160 9f0e43f296c103f43445fbd6bbbc61492ab1f346 SHA1 7c704c46eb80eececfbb15a0a23f88773f6225a0 SHA256 26c442281253732b0fda80168893f2bef90c4684edeb902bf52faca680bde0c7 +AUX lirc-nct677x-lirc0.8.6.patch 476 RMD160 57bba72be7535ed8e72c158d6c3c1aa8a2748f16 SHA1 3e00ba442f6f7f5bc32d1b1bb32d4cfc0a8c4003 SHA256 7072779ee21ed266072f3d396cf05ec10c95e0633b2ead070b22bf7a18a94bdb +AUX lirc_wb677.h 19236 RMD160 a839592f93da5e5c258f0d88f694a985722b7aa3 SHA1 9a646def74a299ec3d18304ded4e37c4db31b4cd SHA256 bea65c40c52d6568918945c5cbe099cf41259cc6b6497b7c1da9256d6bbe2ab1 +AUX lirc_wb677.ko 26557 RMD160 db0cb75130f52eb2401c0f65c32a6bee9fc254a9 SHA1 14c1e6629382ad19f27a628da63c5f91ab5a5aea SHA256 28ffe3cc71c106de43e7a087c42055e8a951e16215a034906c5d4b6487cbeeb0 +AUX lirc_wb677.mod.c 572 RMD160 9dec221a70fa3e7ae06721a309435421b504b74d SHA1 cda660ca0ab45484677908391e7bbb55c35b5f20 SHA256 80be9270c3870fe8d43c95fb636609dd44b9ceb896303152844041dd2175eb9f +AUX lirc_wb677.mod.o 1584 RMD160 a65cd8af99cefb0166a5f7d029476aefa90cf3c8 SHA1 922c55267a8d68ef3e67b066d1d9f08177b13db6 SHA256 40ed8bbe3cee1ba0789b3d3772cadf50602a65599f9c7c9e6bdadd2c74595b61 +AUX lirc_wb677.o 25591 RMD160 aebb03c782ce792ff8d30d9b85bfaadd92d56289 SHA1 e5b53a33b163fe2804c00b5937182d4506272cb0 SHA256 b1919909da0555c2310774d0bd6791def60c03122e2f07e044c0912902d4f176 +AUX lirc_wb677_common_extern.h 2855 RMD160 61e97b3dd8457db6254ebc5ee01ec065bcd64749 SHA1 7b6861909cec8427127efa47a26b60d513e304dd SHA256 918cff4c7c42aa3c4c4f5107382a01e2c575c168cd62422cd6fe7e920b3ac696 +AUX lirc_wb677_main.c 43223 RMD160 446c7657c849f4ad48d35d1ef0405f11ef285f75 SHA1 17100d2739940ca54449ecc828416b354f607350 SHA256 16ba34384450bbc092abb73f7b6465105a66c83812778e82836b06031f2a59ea +AUX lirc_wb677_main.o 22940 RMD160 01becd275982e1abea7ed6aef73ecb57129cdc3d SHA1 d8da59945ce04f390928f096f71cebee076c4d7e SHA256 38798ba9f6ea4405134ce393dbb891a8c4c061908c27c47e1eed6c3dcaf8b1a0 +AUX lirc_wb677_mouse_kbd.c 23549 RMD160 dfbd41fa6d9669fc7393375e13aceb7ebdf05eb1 SHA1 572af225c2623e82286f38d9e502b791b53e73d2 SHA256 831ee4d7ac6be9aad644752497dad99ab9713ce53208e53de9461bff2f183654 +AUX lirc_wb677_mouse_kbd.h 5417 RMD160 913d4a7c061dccf58fe395be20424454d63f4d27 SHA1 5992deea81ff49f8518d97ecb6624c570d6d693c SHA256 b223d65a8636a98627f65c7204749d22051c261743d94888dd78a86d36051027 +AUX lirc_wb677_mouse_kbd.o 3412 RMD160 0b5a3ed8471f1dd1f3905367091b4ee3fc890f29 SHA1 a88ad6c62f7133cc52e5f8ad09149bffddd842b9 SHA256 b0fb36fdc8c5dde57a4fa65b4e08eea7b6cb7e969ccd0a7d4ced84e0bcc0cef4 +AUX lircd 450 RMD160 73cf3057f420632e90e80eeb30e79cdbb3390b5d SHA1 e43d500a672bf89b7dc5e6bdedc9ed8e90dac3b3 SHA256 a9d6d2cc0abd0efe3267c1477fac012378e63e26aa021cfce7a0e25b27f196df +AUX lircd-0.8.3 581 RMD160 162a54bb19df7b97aa982355a6d009ddc82580eb SHA1 c0f7a0a65169d02bdc7003d574d8610694241a5d SHA256 9ba3c5a8c0ca5966729dc5e2c7a5960bbf12b443d91e9e319a0277f153df1b1f +AUX lircd-0.8.6 973 RMD160 4e8a04b8d052558a91e8278589cc04d70f164a0d SHA1 e333b816a396e4005bdafce2b77501098fbcec5a SHA256 473cf04b2f6addf7c86d23103b1eff68bf3758fda2bf25401ff0631c568c7805 +AUX lircd.conf.2 317 RMD160 dbd600cb97ce10ba06e29e32fe5d3eac6cf19a7d SHA1 054bde131b965e2fea8599accbf69fc489cb66e8 SHA256 694d96ffc0c5b8d258592d89c0221aa9b10d69ce024a69a0cc935d899e0b855e +AUX lircd.conf.wb677 9559 RMD160 f69c0edbb891dc4e638be052a4f01fb5402a21bf SHA1 60549622e8744f55559c1cf2c63a0fd00d416af6 SHA256 9a83e0a0bcd5a05a8b265d01ff056d3ea452af4d6553ac0ea4cd3d4d303307d6 +AUX lircmd 466 RMD160 32f2b2411afc60522944f5c3dff9f53aac242a9c SHA1 79939de790d20704009643bd810e3186090d0e36 SHA256 d47f22a33a83c14a4a0c333d6a445c40e550c491899fb0c6d323e23fe1eac7b7 +AUX lircrc_nuvoton 5115 RMD160 6c10141812483240c0377f441b12e655cd724b66 SHA1 76e2b216685b5b36e15d62d3f67df0be46e615aa SHA256 b310dea726c2e8ac9a1b83edb89311adc190f363dded67fb00d7ce333b6873d1 +AUX modprobed.lirc 549 RMD160 89edfd587932959df9e521d146cef7c67cf97b18 SHA1 f59d8f031859eb6b6dccd1faf15d7ed2251288b1 SHA256 b4951252321ea326d3ec401e5ff1112716c5aaf5b2ca94d9f5e187e22ad35c44 +AUX modules.order 71 RMD160 8828d797a99c95ce3ac3532db2d7c9900c24d062 SHA1 70bacaae786c60a0d8ac526278e860d42174d2c2 SHA256 429ea47e3d7ec22b1cd81caf7c8d6ab2f05c2af03596f5cfa1dba4415c7e8d04 +AUX modulesd.lirc 482 RMD160 0c7ec9881b337529acaf15eb4bf7a66a8623fc6c SHA1 8415e466cad31278496bafa817ccabbb72c56ce4 SHA256 3906b61951e1245cb3c9b16e81255a735f7bcdbbfcbedcdf44cd53236e2a3f28 +AUX wb83677hg_ir.h 1224 RMD160 08b63c9c67f9825a6a04860eebc616bf41448d4b SHA1 ccdd7cb43c40e87543d1c9f0985be6f771f3b16e SHA256 5f8d423e434b569f6cc38eab3cefb5a3a8c52a10032e2ac21dac8e7197a8389f +AUX xbox-lircd.conf 784 RMD160 844b08d504f5afb996f900d3d225cc855fbf4884 SHA1 65c3b9c295bc8ab8f80077dd3a40b599d1a60ce3 SHA256 03979bd658ed4a5705c358a1278b1565dd10463ab6eb14fa8d25b3d98e645008 +DIST lirc-0.8.6.tar.bz2 730341 RMD160 c4301b1ac966be48c856b606ae0fedd366cb608d SHA1 199aad7381e785945e4634f9a002e5ac35bf8930 SHA256 0a82e73b1bbf1712cff9d757739f9a2083be246d1b1d071f8808b5e6cca4d1a1 +EBUILD lirc-0.8.6-r4.ebuild 10356 RMD160 e7c6d25e29b63b4015f39b71ee02af83d141d8bc SHA1 b1be08f5d35a31a41dbe45156235879d918919f4 SHA256 ae8c8ec72aded12fef173aecdce7f52cd4886dbda6be86271d16569493a5f1b1 +MISC ChangeLog 36755 RMD160 200776d575cd0970210bd42c550c1438cbd787f1 SHA1 31201482af914bf7c21e23d19ea44c4153ec8fb3 SHA256 0bca3ac17af35bbc3beff0657c2b05abc38ca8359fed8e0d596cde4b837e2015 +MISC metadata.xml 376 RMD160 7b854dad1999c38592eabe928aab80615ba1f1e5 SHA1 17dc9c9591c77aa4ec2d98b9bc1f34ff68da31ad SHA256 e3b4637a67a93eb4b9457fa5941e8a6a891adca11a1ebc80c21a59650eac93aa diff --git a/app-misc/lirc/files/2.6.33.patch b/app-misc/lirc/files/2.6.33.patch new file mode 100644 index 0000000..e933e64 --- /dev/null +++ b/app-misc/lirc/files/2.6.33.patch @@ -0,0 +1,269 @@ +--- drivers/lirc_dev/lirc_dev.h 2009/03/15 09:34:00 1.37 ++++ drivers/lirc_dev/lirc_dev.h 2010/01/23 16:28:07 1.39 +@@ -4,7 +4,7 @@ + * (L) by Artur Lipowski <alipowski@interia.pl> + * This code is licensed under GNU GPL + * +- * $Id: lirc_dev.h,v 1.37 2009/03/15 09:34:00 lirc Exp $ ++ * $Id: lirc_dev.h,v 1.39 2010/01/23 16:28:07 lirc Exp $ + * + */ + +@@ -30,14 +30,19 @@ + + struct lirc_buffer { + wait_queue_head_t wait_poll; +- spinlock_t lock; ++ spinlock_t fifo_lock; + unsigned int chunk_size; + unsigned int size; /* in chunks */ + /* Using chunks instead of bytes pretends to simplify boundary checking + * And should allow for some performance fine tunning later */ + #ifdef LIRC_HAVE_KFIFO ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + struct kfifo *fifo; + #else ++ struct kfifo fifo; ++ u8 fifo_initialized; ++#endif ++#else + unsigned int fill; /* in chunks */ + int head, tail; /* in chunks */ + unsigned char *data; +@@ -47,12 +52,12 @@ + static inline void lirc_buffer_lock(struct lirc_buffer *buf, + unsigned long *flags) + { +- spin_lock_irqsave(&buf->lock, *flags); ++ spin_lock_irqsave(&buf->fifo_lock, *flags); + } + static inline void lirc_buffer_unlock(struct lirc_buffer *buf, + unsigned long *flags) + { +- spin_unlock_irqrestore(&buf->lock, *flags); ++ spin_unlock_irqrestore(&buf->fifo_lock, *flags); + } + static inline void _lirc_buffer_clear(struct lirc_buffer *buf) + { +@@ -64,10 +69,21 @@ + static inline void lirc_buffer_clear(struct lirc_buffer *buf) + { + #ifdef LIRC_HAVE_KFIFO ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + if (buf->fifo) + kfifo_reset(buf->fifo); + #else + unsigned long flags; ++ ++ if (buf->fifo_initialized) { ++ spin_lock_irqsave(&buf->fifo_lock, flags); ++ kfifo_reset(&buf->fifo); ++ spin_unlock_irqrestore(&buf->fifo_lock, flags); ++ } ++#endif ++#else ++ unsigned long flags; ++ + lirc_buffer_lock(buf, &flags); + _lirc_buffer_clear(buf); + lirc_buffer_unlock(buf, &flags); +@@ -77,31 +93,47 @@ + unsigned int chunk_size, + unsigned int size) + { ++ int ret = 0; ++ + init_waitqueue_head(&buf->wait_poll); +- spin_lock_init(&buf->lock); ++ spin_lock_init(&buf->fifo_lock); + #ifndef LIRC_HAVE_KFIFO + _lirc_buffer_clear(buf); + #endif + buf->chunk_size = chunk_size; + buf->size = size; + #ifdef LIRC_HAVE_KFIFO +- buf->fifo = kfifo_alloc(size*chunk_size, GFP_KERNEL, &buf->lock); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) ++ buf->fifo = kfifo_alloc(size*chunk_size, GFP_KERNEL, &buf->fifo_lock); + if (!buf->fifo) + return -ENOMEM; + #else ++ ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL); ++ if (ret == 0) ++ buf->fifo_initialized = 1; ++#endif ++#else + buf->data = kmalloc(size*chunk_size, GFP_KERNEL); + if (buf->data == NULL) + return -ENOMEM; + memset(buf->data, 0, size*chunk_size); + #endif +- return 0; ++ ++ return ret; + } + static inline void lirc_buffer_free(struct lirc_buffer *buf) + { + #ifdef LIRC_HAVE_KFIFO ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + if (buf->fifo) + kfifo_free(buf->fifo); + #else ++ if (buf->fifo_initialized) { ++ kfifo_free(&buf->fifo); ++ buf->fifo_initialized = 0; ++ } ++#endif ++#else + kfree(buf->data); + buf->data = NULL; + buf->head = 0; +@@ -111,6 +143,25 @@ + buf->size = 0; + #endif + } ++ ++#ifdef LIRC_HAVE_KFIFO ++static inline int lirc_buffer_len(struct lirc_buffer *buf) ++{ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) ++ return kfifo_len(buf->fifo); ++#else ++ int len; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&buf->fifo_lock, flags); ++ len = kfifo_len(&buf->fifo); ++ spin_unlock_irqrestore(&buf->fifo_lock, flags); ++ ++ return len; ++#endif ++} ++#endif ++ + #ifndef LIRC_HAVE_KFIFO + static inline int _lirc_buffer_full(struct lirc_buffer *buf) + { +@@ -120,7 +171,7 @@ + static inline int lirc_buffer_full(struct lirc_buffer *buf) + { + #ifdef LIRC_HAVE_KFIFO +- return kfifo_len(buf->fifo) == buf->size * buf->chunk_size; ++ return lirc_buffer_len(buf) == buf->size * buf->chunk_size; + #else + unsigned long flags; + int ret; +@@ -139,7 +190,7 @@ + static inline int lirc_buffer_empty(struct lirc_buffer *buf) + { + #ifdef LIRC_HAVE_KFIFO +- return !kfifo_len(buf->fifo); ++ return !lirc_buffer_len(buf); + #else + unsigned long flags; + int ret; +@@ -158,7 +209,7 @@ + static inline int lirc_buffer_available(struct lirc_buffer *buf) + { + #ifdef LIRC_HAVE_KFIFO +- return buf->size - (kfifo_len(buf->fifo) / buf->chunk_size); ++ return buf->size - (lirc_buffer_len(buf) / buf->chunk_size); + #else + unsigned long flags; + int ret; +@@ -177,21 +228,30 @@ + buf->fill -= 1; + } + #endif +-static inline void lirc_buffer_read(struct lirc_buffer *buf, +- unsigned char *dest) ++static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf, ++ unsigned char *dest) + { ++ unsigned int ret = 0; ++ + #ifdef LIRC_HAVE_KFIFO +- if (kfifo_len(buf->fifo) >= buf->chunk_size) +- kfifo_get(buf->fifo, dest, buf->chunk_size); ++ if (lirc_buffer_len(buf) >= buf->chunk_size) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) ++ ret = kfifo_get(buf->fifo, dest, buf->chunk_size); ++#else ++ ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size, ++ &buf->fifo_lock); ++#endif + #else + unsigned long flags; + lirc_buffer_lock(buf, &flags); + _lirc_buffer_read_1(buf, dest); + lirc_buffer_unlock(buf, &flags); + #endif ++ ++ return ret; + } + #ifndef LIRC_HAVE_KFIFO +-static inline void _lirc_buffer_write_1(struct lirc_buffer *buf, ++static inline _lirc_buffer_write_1(struct lirc_buffer *buf, + unsigned char *orig) + { + memcpy(&buf->data[buf->tail*buf->chunk_size], orig, buf->chunk_size); +@@ -199,17 +259,26 @@ + buf->fill++; + } + #endif +-static inline void lirc_buffer_write(struct lirc_buffer *buf, +- unsigned char *orig) ++static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, ++ unsigned char *orig) + { ++ unsigned int ret = 0; ++ + #ifdef LIRC_HAVE_KFIFO +- kfifo_put(buf->fifo, orig, buf->chunk_size); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) ++ ret = kfifo_put(buf->fifo, orig, buf->chunk_size); ++#else ++ ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size, ++ &buf->fifo_lock); ++#endif + #else + unsigned long flags; + lirc_buffer_lock(buf, &flags); + _lirc_buffer_write_1(buf, orig); + lirc_buffer_unlock(buf, &flags); + #endif ++ ++ return ret; + } + #ifndef LIRC_HAVE_KFIFO + static inline void _lirc_buffer_write_n(struct lirc_buffer *buf, +@@ -234,17 +303,26 @@ + buf->fill += count; + } + #endif +-static inline void lirc_buffer_write_n(struct lirc_buffer *buf, +- unsigned char *orig, int count) ++static inline unsigned int lirc_buffer_write_n(struct lirc_buffer *buf, ++ unsigned char *orig, int count) + { ++ unsigned int ret = 0; ++ + #ifdef LIRC_HAVE_KFIFO +- kfifo_put(buf->fifo, orig, count * buf->chunk_size); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) ++ ret = kfifo_put(buf->fifo, orig, count * buf->chunk_size); ++#else ++ ret = kfifo_in_locked(&buf->fifo, orig, count * buf->chunk_size, ++ &buf->fifo_lock); ++#endif + #else + unsigned long flags; + lirc_buffer_lock(buf, &flags); + _lirc_buffer_write_n(buf, orig, count); + lirc_buffer_unlock(buf, &flags); + #endif ++ ++ return ret; + } + + struct lirc_driver { diff --git a/app-misc/lirc/files/Makefile b/app-misc/lirc/files/Makefile new file mode 100644 index 0000000..860fa04 --- /dev/null +++ b/app-misc/lirc/files/Makefile @@ -0,0 +1,45 @@ +#!/bin/bash + + LIRC_DIR := /usr/src/lirc-0.8.6/ + + obj-m += lirc_wb677.o + + lirc_wb677-objs := lirc_wb677_main.o lirc_wb677_mouse_kbd.o + + KSRC ?= /lib/modules/$(shell uname -r)/build + + PWD := $(shell pwd) + +modules: + echo KERNELDIR=$(KSRC) + $(MAKE) -C $(KSRC) -I $(LIRC_DIR) M=$(PWD) modules + + +install: + # Following line edited but then commented out because it stops script if lircd not already running: + # /etc/init.d/lircd stop + rmmod lirc_wb677 || echo "lirc_wb677.ko is not executing" + file="lirc_wb677.ko"; \ + dir="/lib/modules/$(shell uname -r)/misc"; \ + if test -d "$$dir"; then echo ""; else mkdir -p $$dir; fi; \ + cp -vf *.ko $$dir + depmod -a + # Following line edited but then commented out because /usr/share/lirc/lirc.hwdb does not exist on my PC: + # patch -p0 /usr/share/lirc/lirc.hwdb < /usr/src/lirc_wb677-1.0.4/lirc_nct667x-lirc0.8.6.patch + @echo "" + @echo "Hint: You can configure lirc." + @echo " And start lirc by executing \"/etc/init.d/lircd start\"" + +uninstall: + # Following line edited but then commented out because it stops script if lircd not already running: + # /etc/init.d/lircd stop + ( rmmod lirc_wb677 ) || echo "lirc_wb677.ko is not executing" + dir="/lib/modules/$(shell uname -r)/misc"; \ + if test -d "$$dir"; then rm -R $$dir; fi; + depmod -a + # Following line edited but then commented out because /usr/share/lirc/lirc.hwdb does not exist on my PC: + # patch -R -p0 /usr/share/lirc/lirc.hwdb < /usr/src/lirc_wb677-1.0.4/lirc_nct667x-lirc0.8.6.patch + +clean: + rm -rf *.o *.ko *.mod.c Module.symvers .tmp_versions .*.cmd + diff --git a/app-misc/lirc/files/Makefile.old b/app-misc/lirc/files/Makefile.old new file mode 100755 index 0000000..eb8d995 --- /dev/null +++ b/app-misc/lirc/files/Makefile.old @@ -0,0 +1,66 @@ +#!/bin/bash + +# Notice : +# for dkms, make cmd was defined in dkms.conf as MAKE[0]. generally we define it as +# MAKE[0] = "make ..." +# however, when dkms build this target, it was invoked by "make KERNELRELEASE=xxx ..." instead +# that cause the plain make file below can not work again : +# +# ifneq ($(KERNELRELEASE),) +# obj-m := lirc_wb667.o +# lirc_wb667-objs := lirc_wb667.o +# else +# KERNEL_SRC_TREE ?= /lib/modules/$(shell uname -r)/build +# PWD := $(shell pwd) +# modules modules_install clean: +# make -C $(KERNEL_SRC_TREE) M=$(PWD) $@ +# endif +# +# it can not work because KERNELRELEASE was defined in dkms's case. so we should merge the two +# cases together : + +# on Linux 2.6 kernel +# If KERNELRELEASE is defined, we've been invoked from the +# kernel build system and can use its language. + + + + LIRC_DIR := /usr/src/lirc-0.8.6 + + obj-m += lirc_wb677.o + + lirc_wb677-objs := lirc_wb677_main.o lirc_wb677_mouse_kbd.o + + KSRC ?= /lib/modules/$(shell uname -r)/build + + PWD := $(shell pwd) +modules: + echo KERNELDIR=$(KSRC) + $(MAKE) -C $(KSRC) -I $(LIRC_DIR) M=$(PWD) modules + + +# Following "install", "uninstall" and "clean" are not for dkms. + +install: + /etc/init.d/lirc stop + rmmod lirc_wb677 || echo "lirc_wb677.ko is not executing" + file="lirc_wb677.ko"; \ + dir="/lib/modules/$(shell uname -r)/kernel/ubuntu/lirc/lirc_wb677"; \ + if test -d "$$dir"; then echo ""; else mkdir -p $$dir; fi; \ + cp -vf *.ko $$dir + depmod -a + patch -p0 /usr/share/lirc/lirc.hwdb < /usr/share/lirc/lirc_nct667x-src-1.0.0-ubuntu9.10.patch + @echo "" + @echo "Hint: You can execute \"dpkg-reconfigure lirc\" to configure lirc." + @echo " And start lirc by executing \"/etc/init.d/lirc start\"" + +uninstall: + /etc/init.d/lirc stop + ( rmmod lirc_wb677 ) || echo "lirc_wb677.ko is not executing" + dir="/lib/modules/$(shell uname -r)/kernel/ubuntu/lirc/lirc_wb677"; \ + if test -d "$$dir"; then rm -R $$dir; fi; + depmod -a + patch -R -p0 /usr/share/lirc/lirc.hwdb < /usr/share/lirc/lirc_nct667x-src-1.0.0-ubuntu9.10.patch + +clean: + rm -rf *.o *.ko *.mod.c Module.symvers .tmp_versions .*.cmd diff --git a/app-misc/lirc/files/Module.symvers b/app-misc/lirc/files/Module.symvers new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app-misc/lirc/files/Module.symvers diff --git a/app-misc/lirc/files/autoconf.patch b/app-misc/lirc/files/autoconf.patch new file mode 100644 index 0000000..6e4fd50 --- /dev/null +++ b/app-misc/lirc/files/autoconf.patch @@ -0,0 +1,194 @@ +--- lirc-0.8.6/drivers/lirc_dev/lirc_dev.c.old 2009-08-31 12:57:55.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_dev/lirc_dev.c 2010-03-07 01:40:17.000000000 -0500 +@@ -32,7 +32,11 @@ + #error "**********************************************************" + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + #include <linux/module.h> + #include <linux/kernel.h> + #include <linux/sched.h> +--- lirc-0.8.6/drivers/lirc_sir/lirc_sir.c.old 2009-07-09 18:24:23.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_sir/lirc_sir.c 2010-03-07 01:40:17.000000000 -0500 +@@ -45,7 +45,11 @@ + # include <config.h> + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + #if !defined(CONFIG_SERIAL_MODULE) + #if !defined(LIRC_ON_SA1100) + #warning "******************************************" +--- lirc-0.8.6/drivers/lirc_serial/lirc_serial.c.old 2009-03-15 05:34:00.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_serial/lirc_serial.c 2010-03-07 01:40:17.000000000 -0500 +@@ -60,7 +60,11 @@ + #error "**********************************************************" + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + + #if defined(CONFIG_SERIAL) || defined(CONFIG_SERIAL_8250) + #warning "******************************************" +--- lirc-0.8.6/drivers/lirc_bt829/lirc_bt829.c.old 2009-03-09 14:54:17.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_bt829/lirc_bt829.c 2010-03-07 01:40:17.000000000 -0500 +@@ -22,7 +22,11 @@ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) + #error "This driver needs kernel version 2.4.0 or higher" + #endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + #include <linux/kernel.h> + #include <linux/module.h> + #include <linux/threads.h> +--- lirc-0.8.6/drivers/lirc_sasem/lirc_sasem.c.old 2009-02-28 05:27:10.000000000 -0500 ++++ lirc-0.8.6/drivers/lirc_sasem/lirc_sasem.c 2010-03-07 01:40:17.000000000 -0500 +@@ -41,7 +41,11 @@ + #error "*** Sorry, this driver requires kernel version 2.4.22 or higher" + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + + #include <linux/errno.h> + #include <linux/init.h> +--- lirc-0.8.6/drivers/lirc_igorplugusb/lirc_igorplugusb.c.old 2009-08-02 05:54:10.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_igorplugusb/lirc_igorplugusb.c 2010-03-07 01:40:17.000000000 -0500 +@@ -47,7 +47,11 @@ + #error "*******************************************************" + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + #include <linux/module.h> + #include <linux/kernel.h> + #include <linux/kmod.h> +--- lirc-0.8.6/drivers/lirc_imon/lirc_imon.c.old 2009-09-11 00:56:18.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_imon/lirc_imon.c 2010-03-07 01:40:17.000000000 -0500 +@@ -30,7 +30,11 @@ + #error "*** Sorry, this driver requires a 2.6 kernel" + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + + #include <linux/errno.h> + #include <linux/init.h> +--- lirc-0.8.6/drivers/lirc_it87/lirc_it87.c.old 2009-06-01 08:21:31.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_it87/lirc_it87.c 2010-03-07 01:40:17.000000000 -0500 +@@ -36,7 +36,11 @@ + + #include <linux/version.h> + #include <linux/module.h> ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + #include <linux/sched.h> + #include <linux/errno.h> + #include <linux/signal.h> +--- lirc-0.8.6/drivers/lirc_streamzap/lirc_streamzap.c.old 2009-03-15 05:34:00.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_streamzap/lirc_streamzap.c 2010-03-07 01:40:17.000000000 -0500 +@@ -35,7 +35,11 @@ + #error "Sorry, this driver needs kernel version 2.4.0 or higher" + #error "*******************************************************" + #endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + #include <linux/kernel.h> + #include <linux/errno.h> + #include <linux/init.h> +--- lirc-0.8.6/drivers/lirc_atiusb/lirc_atiusb.c.old 2009-03-10 20:21:46.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_atiusb/lirc_atiusb.c 2010-03-07 01:40:17.000000000 -0500 +@@ -43,7 +43,11 @@ + #error "*******************************************************" + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + + #include <linux/kernel.h> + #include <linux/errno.h> +--- lirc-0.8.6/drivers/lirc_parallel/lirc_parallel.c.old 2009-03-08 15:22:28.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_parallel/lirc_parallel.c 2010-03-07 01:40:17.000000000 -0500 +@@ -34,7 +34,11 @@ + #error "**********************************************************" + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + #ifdef CONFIG_SMP + #error "--- Sorry, this driver is not SMP safe. ---" + #endif +@@ -43,7 +47,11 @@ + #include <linux/sched.h> + #include <linux/errno.h> + #include <linux/signal.h> ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + #include <linux/fs.h> + #include <linux/kernel.h> + #include <linux/ioport.h> +--- lirc-0.8.6/drivers/lirc_wpc8769l/lirc_wpc8769l.c.old 2009-03-15 05:34:01.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_wpc8769l/lirc_wpc8769l.c 2010-03-07 01:40:17.000000000 -0500 +@@ -37,7 +37,11 @@ + #error "**********************************************************" + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + + #include <linux/module.h> + #include <linux/errno.h> +--- lirc-0.8.6/drivers/lirc_mceusb/lirc_mceusb.c.old 2009-09-02 10:04:02.000000000 -0400 ++++ lirc-0.8.6/drivers/lirc_mceusb/lirc_mceusb.c 2010-03-07 01:40:17.000000000 -0500 +@@ -52,7 +52,11 @@ + #error "Sorry, this driver needs kernel version 2.6.5 or higher" + #error "*******************************************************" + #endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + #include <linux/autoconf.h> ++#else ++#include <generated/autoconf.h> ++#endif + #include <linux/kernel.h> + #include <linux/errno.h> + #include <linux/init.h> diff --git a/app-misc/lirc/files/irexec-confd b/app-misc/lirc/files/irexec-confd new file mode 100644 index 0000000..48eb8dd --- /dev/null +++ b/app-misc/lirc/files/irexec-confd @@ -0,0 +1,9 @@ +# Options to pass to the irexec process +IREXEC_OPTS="/etc/lircrc" + +# User to execute irexec as. +# Warning: Running irexec as root can open security holes +#IREXEC_USER="root" + +# Use this to disable the warning printed when starting irexec as root +# IREXEC_DISABLE_ROOT_WARNING=yes diff --git a/app-misc/lirc/files/irexec-initd b/app-misc/lirc/files/irexec-initd new file mode 100755 index 0000000..e1defee --- /dev/null +++ b/app-misc/lirc/files/irexec-initd @@ -0,0 +1,28 @@ +#!/sbin/runscript +# Copyright 2003 Martin Hierling <mad@cc.fh-lippe.de> +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/irexec-initd,v 1.3 2007/05/24 20:12:16 zzam Exp $ + +: ${IREXEC_USER:=root} + +depend() { + need lircd +} + +start() { + if [ "x${IREXEC_USER}" = "xroot" -a "x${IREXEC_DISABLE_ROOT_WARNING}" != "xyes" ]; then + ewarn "Warning: Running irexec as root can open security holes" + fi + + ebegin "Starting irexec" + start-stop-daemon --start --chuid ${IREXEC_USER} --user ${IREXEC_USER} --chdir / \ + --exec /usr/bin/irexec -- --daemon ${IREXEC_OPTS} + eend $? "Failed to start irexec." +} + +stop() { + ebegin "Stopping irexec" + start-stop-daemon --stop --exec /usr/bin/irexec --user ${IREXEC_USER} + eend $? "Failed to stop irexec." +} + diff --git a/app-misc/lirc/files/irexec-initd-0.8.6-r2 b/app-misc/lirc/files/irexec-initd-0.8.6-r2 new file mode 100755 index 0000000..567322a --- /dev/null +++ b/app-misc/lirc/files/irexec-initd-0.8.6-r2 @@ -0,0 +1,28 @@ +#!/sbin/runscript +# Copyright 2003 Martin Hierling <mad@cc.fh-lippe.de> +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/irexec-initd-0.8.6-r2,v 1.1 2009/11/15 10:04:21 zzam Exp $ + +: ${IREXEC_USER:=root} + +depend() { + need lirc +} + +start() { + if [ "x${IREXEC_USER}" = "xroot" -a "x${IREXEC_DISABLE_ROOT_WARNING}" != "xyes" ]; then + ewarn "Warning: Running irexec as root can open security holes" + fi + + ebegin "Starting irexec" + start-stop-daemon --start --chuid ${IREXEC_USER} --user ${IREXEC_USER} --chdir / \ + --exec /usr/bin/irexec -- --daemon ${IREXEC_OPTS} + eend $? "Failed to start irexec." +} + +stop() { + ebegin "Stopping irexec" + start-stop-daemon --stop --exec /usr/bin/irexec --user ${IREXEC_USER} + eend $? "Failed to stop irexec." +} + diff --git a/app-misc/lirc/files/lirc-0.8.3-imon-pad2keys.patch b/app-misc/lirc/files/lirc-0.8.3-imon-pad2keys.patch new file mode 100644 index 0000000..578489d --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.3-imon-pad2keys.patch @@ -0,0 +1,291 @@ +diff -ruN lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c +--- lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c 2008-04-28 22:15:54.281654857 +0200 ++++ lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c 2008-04-28 22:16:51.381649620 +0200 +@@ -73,9 +73,9 @@ + + + #define MOD_AUTHOR "Venky Raju <dev@venky.ws>" +-#define MOD_DESC "Driver for Soundgraph iMON MultiMedia IR/VFD" ++#define MOD_DESC "Driver for Soundgraph iMON MultiMedia IR/VFD w/imon pad2keys patch" + #define MOD_NAME "lirc_imon" +-#define MOD_VERSION "0.3" ++#define MOD_VERSION "0.3p2k" + + #define VFD_MINOR_BASE 144 /* Same as LCD */ + #define DEVFS_MODE (S_IFCHR | S_IRUSR | S_IWUSR | \ +@@ -91,6 +91,7 @@ + #define TRUE 1 + #define FALSE 0 + ++#define CURSOR_LIMIT 16 + + /* ------------------------------------------------------------ + * P R O T O T Y P E S +@@ -177,6 +178,10 @@ + atomic_t busy; /* write in progress */ + int status; /* status of tx completion */ + } tx; ++ ++ int key_x; ++ int key_y; ++ int last_count; /* number of times pressed */ + }; + + #define LOCK_CONTEXT down(&context->sem) +@@ -248,6 +253,9 @@ + static int is_lcd; /* If LIRC_IMON_LCD not defined, default to non-LCD */ + #endif + ++/* pad2keys module parameter. pad2keys patch active? */ ++static int pad2keys_active = 0; ++ + #if !defined(KERNEL_2_5) + + #define MAX_DEVICES 4 /* In case there's more than one iMON device */ +@@ -271,6 +279,7 @@ + + MODULE_AUTHOR(MOD_AUTHOR); + MODULE_DESCRIPTION(MOD_DESC); ++MODULE_VERSION(MOD_VERSION); /* MBr: was missing */ + MODULE_LICENSE("GPL"); + MODULE_DEVICE_TABLE(usb, imon_usb_id_table); + +@@ -287,6 +296,9 @@ + "1=yes (default:no)"); + #endif + ++module_param (pad2keys_active, int, 0); ++MODULE_PARM_DESC (pad2keys_active, "pad2keys patch active: 0=no, 1=yes (default: no)"); ++ + static inline void delete_context(struct imon_context *context) + { + if (context->vfd_supported) +@@ -766,6 +778,11 @@ + context->rx.initial_space = 1; + context->rx.prev_bit = 0; + ++ /* init pad context for pad2keys */ ++ context ->key_x = 0; ++ context ->key_y = 0; ++ context ->last_count = 0; ++ + usb_fill_int_urb(context->rx_urb, context->dev, + usb_rcvintpipe(context->dev, + context->rx_endpoint->bEndpointAddress), +@@ -915,6 +932,94 @@ + + if (context->ir_onboard_decode) { + /* The signals have been decoded onboard the iMON controller */ ++ ++ if (pad2keys_active) ++ { ++ /* imon pad2keys patch ++ * ++ * make PAD and mouse buttons available for use with VDR, ++ * based on pad-mouse-emu patch from venky's forum ++ * ++ * last change: M.Brakemeier 2007-10-14 ++ * ++ * generated PAD key codes: ++ * Mouse_N 0x690281B7 ++ * Mouse_S 0x688291B7 ++ * Mouse_W 0x6A8281B7 ++ * Mouse_E 0x688A81B7 ++ * ++ * mouse buttons (non-synthetic): ++ * MouseRightClick 0x688481B7 ++ * MouseLeftClick 0x688301B7 ++ */ ++ if((buf[0] & 0x40) && ++ !(buf[1] & 0x01 || buf[1] >> 2 & 0x01)) ++ { ++ int rel_x = (buf[1] & 0x08) | (buf[1] & 0x10) >> 2 | (buf[1] & 0x20) >> 4 | (buf[1] & 0x40) >> 6; ++ int rel_y = (buf[2] & 0x08) | (buf[2] & 0x10) >> 2 | (buf[2] & 0x20) >> 4 | (buf[2] & 0x40) >> 6; ++ ++ if(buf[0] & 0x02) ++ rel_x |= ~0x10+1; ++ if(buf[0] & 0x01) ++ rel_y |= ~0x10+1; ++ ++ /* keyboard direction key emulation */ ++ if( context->last_count > 32 ) ++ { /* Hopefully eliminate drift*/ ++ context->last_count=0; ++ context->key_y=0; ++ context->key_x=0; ++ } ++ context->last_count++; ++ ++ /* limit decoded events */ ++ if(abs(context->key_x) > CURSOR_LIMIT || abs(context->key_y) > CURSOR_LIMIT ) ++ { ++ if(abs(context->key_y ) > abs(context->key_x)) ++ { /* mouse s/n */ ++ if(context->key_y > 0 && rel_y > 0) ++ { /* mouse s */ ++ buf[0] = 0x68; ++ buf[1] = 0x82; ++ buf[2] = 0x91; ++ } ++ else if(context->key_y < 0 && rel_y < 0) ++ { /* mouse n */ ++ buf[0] = 0x69; ++ buf[1] = 0x02; ++ buf[2] = 0x81; ++ } ++ } ++ else ++ { /* mouse e/w*/ ++ if(context->key_x > 0 && rel_x > 0 ) ++ { /* mouse e */ ++ buf[0] = 0x68; ++ buf[1] = 0x8A; ++ buf[2] = 0x81; ++ } ++ else if(context->key_x < 0 && rel_x < 0 ) ++ { /* mouse w */ ++ buf[0] = 0x6A; ++ buf[1] = 0x82; ++ buf[2] = 0x81; ++ } ++ } ++ } ++ else ++ { ++ context->key_x += rel_x; ++ context->key_y += rel_y; ++ ++ return; /* discard those key codes */ ++ } ++ } ++ /* a key was pressed, reset count */ ++ context->key_x = 0; ++ context->key_y = 0; ++ context->last_count = 0; ++ } ++ + lirc_buffer_write_1(context->plugin->rbuf, buf); + wake_up(&context->plugin->rbuf->wait_poll); + return; +diff -ruN lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c.rej lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c.rej +--- lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c.rej 1970-01-01 01:00:00.000000000 +0100 ++++ lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c.rej 2008-04-28 22:16:02.941653915 +0200 +@@ -0,0 +1,26 @@ ++*************** ++*** 271,280 **** ++ ++ MODULE_AUTHOR(MOD_AUTHOR); ++ MODULE_DESCRIPTION(MOD_DESC); ++ MODULE_LICENSE("GPL"); ++ MODULE_DEVICE_TABLE(usb, imon_usb_id_table); ++ module_param(debug, int, 0); ++ MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)"); ++ ++ static inline void delete_context(struct imon_context *context) ++ { ++--- 279,291 ---- ++ ++ MODULE_AUTHOR(MOD_AUTHOR); ++ MODULE_DESCRIPTION(MOD_DESC); +++ MODULE_VERSION(MOD_VERSION); /* MBr: was missing */ ++ MODULE_LICENSE("GPL"); ++ MODULE_DEVICE_TABLE(usb, imon_usb_id_table); ++ module_param(debug, int, 0); ++ MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)"); +++ module_param (pad2keys_active, int, 0); +++ MODULE_PARM_DESC (pad2keys_active, "pad2keys patch active: 0=no, 1=yes (default: no)"); ++ ++ static inline void delete_context(struct imon_context *context) ++ { +diff -ruN lirc-0.8.3pre3-orig/remotes/imon/lircd.conf.imon-pad2keys lirc-0.8.3pre3/remotes/imon/lircd.conf.imon-pad2keys +--- lirc-0.8.3pre3-orig/remotes/imon/lircd.conf.imon-pad2keys 1970-01-01 01:00:00.000000000 +0100 ++++ lirc-0.8.3pre3/remotes/imon/lircd.conf.imon-pad2keys 2008-04-28 22:16:02.941653915 +0200 +@@ -0,0 +1,88 @@ ++# Please make this file available to others
++# by sending it to <lirc@bartelmus.de>
++#
++# this config file was generated
++# using lirc-0.8.3pre1 (imon w/pad2keys patch)
++#
++# contributed by M.Brakemeier
++#
++# brand: SoundGraph
++# model no. of remote control: iMON-PAD
++# devices being controlled by this remote:
++#
++
++begin remote
++
++ name iMON-PAD
++ bits 32
++ eps 30
++ aeps 100
++
++ one 0 0
++ zero 0 0
++ gap 235965
++ min_repeat 1
++ toggle_bit 0
++
++ begin codes
++ AppExit 0x288195B7
++ Power 0x289115B7
++ Record 0x298115B7
++ Play 0x2A8115B7
++ Open 0x29B1D5B7
++ Rewind 0x2A8195B7
++ Pause 0x2A9115B7
++ FastForward 0x2B8115B7
++ PrevChapter 0x2B9115B7
++ Stop 0x2B9715B7
++ NextChapter 0x298195B7
++ Esc 0x2BB715B7
++ Eject 0x299395B7
++ AppLauncher 0x29B715B7
++ MultiMon 0x2AB195B7
++ TaskSwitcher 0x2A9395B7
++ Mute 0x2B9595B7
++ Vol+ 0x28A395B7
++ Vol- 0x28A595B7
++ Ch+ 0x289395B7
++ Ch- 0x288795B7
++ Timer 0x2B8395B7
++ 1 0x28B595B7
++ 2 0x2BB195B7
++ 3 0x28B195B7
++ 4 0x2A8595B7
++ 5 0x299595B7
++ 6 0x2AA595B7
++ 7 0x2B9395B7
++ 8 0x2A8515B7
++ 9 0x2AA115B7
++ 0 0x2BA595B7
++ ShiftTab 0x28B515B7
++ Tab 0x29A115B7
++ Red 0x2B8515B7 # MyMovie
++ Green 0x299195B7 # MyMusic
++ Blue 0x2BA115B7 # MyPhoto
++ Yellow 0x28A515B7 # MyTV
++ Bookmark 0x288515B7
++ Thumbnail 0x2AB715B7
++ AspectRatio 0x29A595B7
++ FullScreen 0x2AA395B7
++ Purple 0x29A395B7 # MyDVD
++ Menu 0x2BA395B7
++ Caption 0x298595B7
++ Language 0x2B8595B7
++ MouseKeyboard 0x299115B7
++ SelectSpace 0x2A9315B7
++ MouseMenu 0x28B715B7
++ MouseRightClick 0x688481B7
++ Enter 0x28A195B7
++ MouseLeftClick 0x688301B7
++ WindowsKey 0x2B8195B7
++ Backspace 0x28A115B7
++ Mouse_N 0x690281B7
++ Mouse_S 0x688291B7
++ Mouse_W 0x6A8281B7
++ Mouse_E 0x688A81B7
++ end codes
++
++end remote
diff --git a/app-misc/lirc/files/lirc-0.8.3-kernel-2.6.26.diff b/app-misc/lirc/files/lirc-0.8.3-kernel-2.6.26.diff new file mode 100644 index 0000000..130b6cb --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.3-kernel-2.6.26.diff @@ -0,0 +1,107 @@ +--- a/drivers/kcompat.h 2008-01-13 11:26:28.000000000 +0100 ++++ b/drivers/kcompat.h 2008-05-14 18:37:49.000000000 +0200 +@@ -36,10 +36,10 @@ + class_simple_destroy(cls); + } + +-#define lirc_class_device_create(cs, parent, dev, device, fmt, args...) \ +- class_simple_device_add(cs, dev, device, fmt, ## args) ++#define lirc_device_create(cs, parent, dev, fmt, args...) \ ++ class_simple_device_add(cs, dev, parent, fmt, ## args) + +-static inline void class_device_destroy(lirc_class_t *cls, dev_t devt) ++static inline void lirc_device_destroy(lirc_class_t *cls, dev_t devt) + { + class_simple_device_remove(devt); + } +@@ -48,20 +48,40 @@ + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 15) + +-#define lirc_class_device_create(cs, parent, dev, device, fmt, args...) \ +- class_device_create(cs, dev, device, fmt, ## args) ++#define lirc_device_create(cs, parent, dev, fmt, args...) \ ++ class_device_create(cs, dev, parent, fmt, ## args) + + #else /* >= 2.6.15 */ + +-#define lirc_class_device_create class_device_create ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) ++ ++#define lirc_device_create(cs, parent, dev, fmt, args...) \ ++ class_device_create(cs, NULL, dev, parent, fmt, ## args) ++ ++#else /* >= 2.6.26 */ ++ ++#define lirc_device_create device_create ++ ++#endif /* >= 2.6.26 */ ++ + #define LIRC_DEVFS_PREFIX + +-#endif ++#endif /* >= 2.6.15 */ + + typedef struct class lirc_class_t; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) ++ ++#define lirc_device_destroy class_device_destroy ++ ++#else ++ ++#define lirc_device_destroy device_destroy ++ + #endif + ++#endif /* >= 2.6.13 */ ++ + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) + #define LIRC_HAVE_DEVFS + #define LIRC_HAVE_DEVFS_24 +@@ -133,8 +153,8 @@ + #ifndef LIRC_HAVE_SYSFS + #define class_destroy(x) do { } while (0) + #define class_create(x, y) NULL +-#define class_device_destroy(x, y) do { } while (0) +-#define lirc_class_device_create(x, y, z, xx, yy, zz) 0 ++#define lirc_class_destroy(x, y) do { } while (0) ++#define lirc_class_create(x, y, z, xx, yy, zz) 0 + #define IS_ERR(x) 0 + typedef struct class_simple + { +--- a/drivers/lirc_dev/lirc_dev.c 2008-01-13 11:45:02.000000000 +0100 ++++ b/drivers/lirc_dev/lirc_dev.c 2008-05-14 18:37:49.000000000 +0200 +@@ -145,7 +145,8 @@ + #ifdef LIRC_HAVE_DEVFS_26 + devfs_remove(DEV_LIRC "/%u", ir->p.minor); + #endif +- class_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor)); ++ lirc_device_destroy(lirc_class, ++ MKDEV(IRCTL_DEV_MAJOR, ir->p.minor)); + + if (ir->buf != ir->p.rbuf) { + lirc_buffer_free(ir->buf); +@@ -400,9 +401,9 @@ + S_IFCHR|S_IRUSR|S_IWUSR, + DEV_LIRC "/%u", ir->p.minor); + #endif +- (void) lirc_class_device_create(lirc_class, NULL, +- MKDEV(IRCTL_DEV_MAJOR, ir->p.minor), +- ir->p.dev, "lirc%u", ir->p.minor); ++ (void) lirc_device_create(lirc_class, ir->p.dev, ++ MKDEV(IRCTL_DEV_MAJOR, ir->p.minor), ++ "lirc%u", ir->p.minor); + + if (p->sample_rate || p->get_queue) { + /* try to fire up polling thread */ +@@ -441,7 +442,8 @@ + return minor; + + out_sysfs: +- class_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor)); ++ lirc_device_destroy(lirc_class, ++ MKDEV(IRCTL_DEV_MAJOR, ir->p.minor)); + #ifdef LIRC_HAVE_DEVFS_24 + devfs_unregister(ir->devfs_handle); + #endif diff --git a/app-misc/lirc/files/lirc-0.8.3-kernel-2.6.27.diff b/app-misc/lirc/files/lirc-0.8.3-kernel-2.6.27.diff new file mode 100644 index 0000000..c914973 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.3-kernel-2.6.27.diff @@ -0,0 +1,38 @@ +Index: drivers/lirc_dev/lirc_dev.c +=================================================================== +RCS file: /cvsroot/lirc/lirc/drivers/lirc_dev/lirc_dev.c,v +retrieving revision 1.58 +diff -u -p -u -p -r1.58 lirc_dev.c +--- drivers/lirc_dev/lirc_dev.c 14 May 2008 16:37:49 -0000 1.58 ++++ drivers/lirc_dev/lirc_dev.c 4 Aug 2008 14:54:04 -0000 +@@ -49,7 +49,11 @@ + #include <linux/uaccess.h> + #include <linux/errno.h> + #endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) + #include <asm/semaphore.h> ++#else ++#include <linux/semaphore.h> ++#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + #include <linux/wrapper.h> + #endif +Index: drivers/lirc_i2c/lirc_i2c.c +=================================================================== +RCS file: /cvsroot/lirc/lirc/drivers/lirc_i2c/lirc_i2c.c,v +retrieving revision 1.46 +diff -u -p -u -p -r1.46 lirc_i2c.c +--- drivers/lirc_i2c/lirc_i2c.c 4 May 2008 13:49:53 -0000 1.46 ++++ drivers/lirc_i2c/lirc_i2c.c 4 Aug 2008 14:54:04 -0000 +@@ -54,7 +54,11 @@ + #include <linux/i2c.h> + #include <linux/i2c-algo-bit.h> + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) + #include <asm/semaphore.h> ++#else ++#include <linux/semaphore.h> ++#endif + + #include "drivers/kcompat.h" + #include "drivers/lirc_dev/lirc_dev.h" diff --git a/app-misc/lirc/files/lirc-0.8.3-pa19.patch b/app-misc/lirc/files/lirc-0.8.3-pa19.patch new file mode 100644 index 0000000..31cae2b --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.3-pa19.patch @@ -0,0 +1,68 @@ +--- daemons/hw_audio.c.orig 2008-06-13 22:24:40.000000000 +0200 ++++ daemons/hw_audio.c 2008-06-13 22:17:31.000000000 +0200 +@@ -66,7 +66,7 @@ + } + paTestData; + +-PortAudioStream *stream; ++PaStream *stream; + + + extern struct ir_remote *repeat_remote; +@@ -90,7 +90,9 @@ + + static int recordCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, +- PaTimestamp outTime, void *userData ) ++ PaStreamCallbackTimeInfo outTime, ++ PaStreamCallbackFlags status, ++ void *userData ) + { + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = (SAMPLE*)inputBuffer; +@@ -215,6 +217,7 @@ + int audio_init() + { + ++ PaStreamParameters inputParameters; + PaError err; + int flags; + struct termios t; +@@ -237,22 +240,27 @@ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + ++ inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */ ++ if (inputParameters.device == paNoDevice) { ++ logprintf(LOG_ERR, "No default input device"); ++ goto error; ++ } ++ inputParameters.channelCount = NUM_CHANNELS; /* stereo input */ ++ inputParameters.sampleFormat = PA_SAMPLE_TYPE; ++ inputParameters.suggestedLatency = ++ Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency; ++ inputParameters.hostApiSpecificStreamInfo = NULL; ++ ++ + // Record some audio. -------------------------------------------- + err = Pa_OpenStream + ( + &stream, +- Pa_GetDefaultInputDeviceID(), +- NUM_CHANNELS, // stereo input +- PA_SAMPLE_TYPE, +- NULL, +- paNoDevice, +- 0, +- PA_SAMPLE_TYPE, +- NULL, ++ &inputParameters, ++ NULL, // output parameters + SAMPLE_RATE, + 512, // frames per buffer +- 0, // number of buffers, if zero then use default minimum +- 0, // flags ++ 0, // flags + recordCallback, + &data ); + diff --git a/app-misc/lirc/files/lirc-0.8.3_pre1-imon-pad2keys.patch b/app-misc/lirc/files/lirc-0.8.3_pre1-imon-pad2keys.patch new file mode 100644 index 0000000..59ed4c9 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.3_pre1-imon-pad2keys.patch @@ -0,0 +1,257 @@ +diff -NuBbwr lirc-0.8.3pre1-orig/drivers/lirc_imon/lirc_imon.c lirc-0.8.3pre1/drivers/lirc_imon/lirc_imon.c +--- lirc-0.8.3pre1-orig/drivers/lirc_imon/lirc_imon.c 2007-09-30 11:58:45.000000000 +0200 ++++ lirc-0.8.3pre1/drivers/lirc_imon/lirc_imon.c 2007-10-14 14:20:07.000000000 +0200 +@@ -69,9 +69,9 @@ + + + #define MOD_AUTHOR "Venky Raju <dev@venky.ws>" +-#define MOD_DESC "Driver for Soundgraph iMON MultiMedia IR/VFD" ++#define MOD_DESC "Driver for Soundgraph iMON MultiMedia IR/VFD w/imon pad2keys patch" + #define MOD_NAME "lirc_imon" +-#define MOD_VERSION "0.3" ++#define MOD_VERSION "0.3p2k" + + #define VFD_MINOR_BASE 144 /* Same as LCD */ + #define DEVFS_MODE (S_IFCHR | S_IRUSR | S_IWUSR | \ +@@ -87,6 +87,7 @@ + #define TRUE 1 + #define FALSE 0 + ++#define CURSOR_LIMIT 16 + + /* ------------------------------------------------------------ + * P R O T O T Y P E S +@@ -169,6 +170,10 @@ + atomic_t busy; /* write in progress */ + int status; /* status of tx completion */ + } tx; ++ ++ int key_x; ++ int key_y; ++ int last_count; /* number of times pressed */ + }; + + #define LOCK_CONTEXT down(&context->sem) +@@ -235,6 +240,9 @@ + + static int debug; + ++/* pad2keys module parameter. pad2keys patch active? */ ++static int pad2keys_active = 0; ++ + #if !defined(KERNEL_2_5) + + #define MAX_DEVICES 4 /* In case there's more than one iMON device */ +@@ -258,10 +266,13 @@ + + MODULE_AUTHOR(MOD_AUTHOR); + MODULE_DESCRIPTION(MOD_DESC); ++MODULE_VERSION(MOD_VERSION); /* MBr: was missing */ + MODULE_LICENSE("GPL"); + MODULE_DEVICE_TABLE(usb, imon_usb_id_table); + module_param(debug, int, 0); + MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)"); ++module_param (pad2keys_active, int, 0); ++MODULE_PARM_DESC (pad2keys_active, "pad2keys patch active: 0=no, 1=yes (default: no)"); + + static inline void delete_context(struct imon_context *context) + { +@@ -684,6 +695,11 @@ + context->rx.initial_space = 1; + context->rx.prev_bit = 0; + ++ /* init pad context for pad2keys */ ++ context ->key_x = 0; ++ context ->key_y = 0; ++ context ->last_count = 0; ++ + usb_fill_int_urb(context->rx_urb, context->dev, + usb_rcvintpipe(context->dev, + context->rx_endpoint->bEndpointAddress), +@@ -834,6 +850,94 @@ + + if (context->ir_onboard_decode) { + /* The signals have been decoded onboard the iMON controller */ ++ ++ if (pad2keys_active) ++ { ++ /* imon pad2keys patch ++ * ++ * make PAD and mouse buttons available for use with VDR, ++ * based on pad-mouse-emu patch from venky's forum ++ * ++ * last change: M.Brakemeier 2007-10-14 ++ * ++ * generated PAD key codes: ++ * Mouse_N 0x690281B7 ++ * Mouse_S 0x688291B7 ++ * Mouse_W 0x6A8281B7 ++ * Mouse_E 0x688A81B7 ++ * ++ * mouse buttons (non-synthetic): ++ * MouseRightClick 0x688481B7 ++ * MouseLeftClick 0x688301B7 ++ */ ++ if((buf[0] & 0x40) && ++ !(buf[1] & 0x01 || buf[1] >> 2 & 0x01)) ++ { ++ int rel_x = (buf[1] & 0x08) | (buf[1] & 0x10) >> 2 | (buf[1] & 0x20) >> 4 | (buf[1] & 0x40) >> 6; ++ int rel_y = (buf[2] & 0x08) | (buf[2] & 0x10) >> 2 | (buf[2] & 0x20) >> 4 | (buf[2] & 0x40) >> 6; ++ ++ if(buf[0] & 0x02) ++ rel_x |= ~0x10+1; ++ if(buf[0] & 0x01) ++ rel_y |= ~0x10+1; ++ ++ /* keyboard direction key emulation */ ++ if( context->last_count > 32 ) ++ { /* Hopefully eliminate drift*/ ++ context->last_count=0; ++ context->key_y=0; ++ context->key_x=0; ++ } ++ context->last_count++; ++ ++ /* limit decoded events */ ++ if(abs(context->key_x) > CURSOR_LIMIT || abs(context->key_y) > CURSOR_LIMIT ) ++ { ++ if(abs(context->key_y ) > abs(context->key_x)) ++ { /* mouse s/n */ ++ if(context->key_y > 0 && rel_y > 0) ++ { /* mouse s */ ++ buf[0] = 0x68; ++ buf[1] = 0x82; ++ buf[2] = 0x91; ++ } ++ else if(context->key_y < 0 && rel_y < 0) ++ { /* mouse n */ ++ buf[0] = 0x69; ++ buf[1] = 0x02; ++ buf[2] = 0x81; ++ } ++ } ++ else ++ { /* mouse e/w*/ ++ if(context->key_x > 0 && rel_x > 0 ) ++ { /* mouse e */ ++ buf[0] = 0x68; ++ buf[1] = 0x8A; ++ buf[2] = 0x81; ++ } ++ else if(context->key_x < 0 && rel_x < 0 ) ++ { /* mouse w */ ++ buf[0] = 0x6A; ++ buf[1] = 0x82; ++ buf[2] = 0x81; ++ } ++ } ++ } ++ else ++ { ++ context->key_x += rel_x; ++ context->key_y += rel_y; ++ ++ return; /* discard those key codes */ ++ } ++ } ++ /* a key was pressed, reset count */ ++ context->key_x = 0; ++ context->key_y = 0; ++ context->last_count = 0; ++ } ++ + lirc_buffer_write_1(context->plugin->rbuf, buf); + wake_up(&context->plugin->rbuf->wait_poll); + return; +diff -NuBbwr lirc-0.8.3pre1-orig/remotes/imon/lircd.conf.imon-pad2keys lirc-0.8.3pre1/remotes/imon/lircd.conf.imon-pad2keys +--- lirc-0.8.3pre1-orig/remotes/imon/lircd.conf.imon-pad2keys 1970-01-01 01:00:00.000000000 +0100 ++++ lirc-0.8.3pre1/remotes/imon/lircd.conf.imon-pad2keys 2007-10-14 14:13:01.000000000 +0200 +@@ -0,0 +1,88 @@ ++# Please make this file available to others
++# by sending it to <lirc@bartelmus.de>
++#
++# this config file was generated
++# using lirc-0.8.3pre1 (imon w/pad2keys patch)
++#
++# contributed by M.Brakemeier
++#
++# brand: SoundGraph
++# model no. of remote control: iMON-PAD
++# devices being controlled by this remote:
++#
++
++begin remote
++
++ name iMON-PAD
++ bits 32
++ eps 30
++ aeps 100
++
++ one 0 0
++ zero 0 0
++ gap 235965
++ min_repeat 1
++ toggle_bit 0
++
++ begin codes
++ AppExit 0x288195B7
++ Power 0x289115B7
++ Record 0x298115B7
++ Play 0x2A8115B7
++ Open 0x29B1D5B7
++ Rewind 0x2A8195B7
++ Pause 0x2A9115B7
++ FastForward 0x2B8115B7
++ PrevChapter 0x2B9115B7
++ Stop 0x2B9715B7
++ NextChapter 0x298195B7
++ Esc 0x2BB715B7
++ Eject 0x299395B7
++ AppLauncher 0x29B715B7
++ MultiMon 0x2AB195B7
++ TaskSwitcher 0x2A9395B7
++ Mute 0x2B9595B7
++ Vol+ 0x28A395B7
++ Vol- 0x28A595B7
++ Ch+ 0x289395B7
++ Ch- 0x288795B7
++ Timer 0x2B8395B7
++ 1 0x28B595B7
++ 2 0x2BB195B7
++ 3 0x28B195B7
++ 4 0x2A8595B7
++ 5 0x299595B7
++ 6 0x2AA595B7
++ 7 0x2B9395B7
++ 8 0x2A8515B7
++ 9 0x2AA115B7
++ 0 0x2BA595B7
++ ShiftTab 0x28B515B7
++ Tab 0x29A115B7
++ Red 0x2B8515B7 # MyMovie
++ Green 0x299195B7 # MyMusic
++ Blue 0x2BA115B7 # MyPhoto
++ Yellow 0x28A515B7 # MyTV
++ Bookmark 0x288515B7
++ Thumbnail 0x2AB715B7
++ AspectRatio 0x29A595B7
++ FullScreen 0x2AA395B7
++ Purple 0x29A295B7 # MyDVD
++ Menu 0x2BA385B7
++ Caption 0x298595B7
++ Language 0x2B8595B7
++ MouseKeyboard 0x299115B7
++ SelectSpace 0x2A9315B7
++ MouseMenu 0x28B715B7
++ MouseRightClick 0x688481B7
++ Enter 0x28A195B7
++ MouseLeftClick 0x688301B7
++ WindowsKey 0x2B8195B7
++ Backspace 0x28A115B7
++ Mouse_N 0x690281B7
++ Mouse_S 0x688291B7
++ Mouse_W 0x6A8281B7
++ Mouse_E 0x688A81B7
++ end codes
++
++end remote
diff --git a/app-misc/lirc/files/lirc-0.8.3_pre1-kernel-2.6.24.diff b/app-misc/lirc/files/lirc-0.8.3_pre1-kernel-2.6.24.diff new file mode 100644 index 0000000..7206d04 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.3_pre1-kernel-2.6.24.diff @@ -0,0 +1,110 @@ +#bug 200508 + +--- a/lirc-0.8.3pre1/drivers/lirc_dev/lirc_dev.c 2007-09-27 15:47:20.000000000 -0400 ++++ b/lirc-0.8.3pre1/drivers/lirc_dev/lirc_dev.c 2007-11-27 11:06:41.000000000 -0500 +@@ -41,6 +41,7 @@ + #include <linux/fs.h> + #include <linux/poll.h> + #include <linux/smp_lock.h> ++#include <linux/completion.h> + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) + #include <linux/uaccess.h> + #include <linux/errno.h> +@@ -86,8 +87,8 @@ + struct lirc_buffer *buf; + + int tpid; +- struct semaphore *t_notify; +- struct semaphore *t_notify2; ++ struct completion *t_notify; ++ struct completion *t_notify2; + int shutdown; + long jiffies_to_wait; + +@@ -193,7 +194,7 @@ + daemonize("lirc_dev"); + + if (ir->t_notify != NULL) +- up(ir->t_notify); ++ complete(ir->t_notify); + + dprintk(LOGHEAD "poll thread started\n", ir->p.name, ir->p.minor); + +@@ -218,11 +219,11 @@ + } while (!ir->shutdown); + + if (ir->t_notify2 != NULL) +- down(ir->t_notify2); ++ wait_for_completion(ir->t_notify2); + + ir->tpid = -1; + if (ir->t_notify != NULL) +- up(ir->t_notify); ++ complete(ir->t_notify); + + dprintk(LOGHEAD "poll thread ended\n", ir->p.name, ir->p.minor); + +@@ -238,7 +239,7 @@ + #ifdef LIRC_HAVE_DEVFS_24 + char name[16]; + #endif +- DECLARE_MUTEX_LOCKED(tn); ++ DECLARE_COMPLETION(tn); + + if (!p) { + printk(KERN_ERR "lirc_dev: lirc_register_plugin: " +@@ -389,7 +390,7 @@ + err = -ECHILD; + goto out_sysfs; + } +- down(&tn); ++ wait_for_completion(&tn); + ir->t_notify = NULL; + } + ir->attached = 1; +@@ -425,8 +426,8 @@ + int lirc_unregister_plugin(int minor) + { + struct irctl *ir; +- DECLARE_MUTEX_LOCKED(tn); +- DECLARE_MUTEX_LOCKED(tn2); ++ DECLARE_COMPLETION(tn); ++ DECLARE_COMPLETION(tn2); + + if (minor < 0 || minor >= MAX_IRCTL_DEVICES) { + printk(KERN_ERR "lirc_dev: lirc_unregister_plugin: " +@@ -462,8 +463,8 @@ + /* 2.2.x does not export wake_up_process() */ + wake_up_interruptible(ir->p.get_queue(ir->p.data)); + #endif +- up(&tn2); +- down(&tn); ++ complete(&tn2); ++ wait_for_completion(&tn); + ir->t_notify = NULL; + ir->t_notify2 = NULL; + } +diff -Naur lirc-0.8.3pre1.orig/drivers/lirc_serial/lirc_serial.c lirc-0.8.3pre1/drivers/lirc_serial/lirc_serial.c +--- lirc-0.8.3pre1.orig/drivers/lirc_serial/lirc_serial.c 2007-12-27 01:27:36.143803257 +0100 ++++ lirc-0.8.3pre1/drivers/lirc_serial/lirc_serial.c 2007-12-27 01:29:38.149303268 +0100 +@@ -961,7 +961,7 @@ + do_gettimeofday(&lasttv); + + result = request_irq(irq, irq_handler, +- SA_INTERRUPT | (share_irq ? SA_SHIRQ:0), ++ IRQF_DISABLED | (share_irq ? IRQF_SHARED:0), + LIRC_DRIVER_NAME, (void *)&hardware); + + switch (result) { +diff -Naur lirc-0.8.3pre1.orig/drivers/lirc_sir/lirc_sir.c lirc-0.8.3pre1/drivers/lirc_sir/lirc_sir.c +--- lirc-0.8.3pre1.orig/drivers/lirc_sir/lirc_sir.c 2007-12-28 15:11:48.142285437 +0100 ++++ lirc-0.8.3pre1/drivers/lirc_sir/lirc_sir.c 2007-12-28 15:13:05.561290741 +0100 +@@ -1025,7 +1025,7 @@ + return -EBUSY; + } + #endif +- retval = request_irq(irq, sir_interrupt, SA_INTERRUPT, ++ retval = request_irq(irq, sir_interrupt, IRQF_DISABLED, + LIRC_DRIVER_NAME, NULL); + if (retval < 0) { + # ifndef LIRC_ON_SA1100 diff --git a/app-misc/lirc/files/lirc-0.8.3_pre1-remotewonderplus.patch b/app-misc/lirc/files/lirc-0.8.3_pre1-remotewonderplus.patch new file mode 100644 index 0000000..66527bc --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.3_pre1-remotewonderplus.patch @@ -0,0 +1,26 @@ +--- lirc-0.8.0/drivers/lirc_atiusb/lirc_atiusb.c.orig 2005-10-29 08:18:53.000000000 -0600 ++++ lirc-0.8.0/drivers/lirc_atiusb/lirc_atiusb.c 2006-04-01 14:31:05.000000000 -0700 +@@ -147,8 +147,9 @@ + /* init strings */ + #define USB_OUTLEN 7 + +-static char init1[] = {0x01, 0x00, 0x20, 0x14}; +-static char init2[] = {0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20}; ++static char init1[] = {0x80, 0x05, 0x1b, 0x15, 0x14, 0x20, 0x24, 0x15}; ++static char init2[] = {0x83, 0x03}; ++static char init3[] = {0x84, 0xd7, 0x020}; + + struct in_endpt { + /* inner link in list of endpoints for the remote specified by ir */ +@@ -1034,8 +1034,9 @@ + usb_sndintpipe(ir->usbdev, oep->ep->bEndpointAddress), oep->buf, + USB_OUTLEN, usb_remote_send, oep, oep->ep->bInterval); + +- send_packet(oep, 0x8004, init1); +- send_packet(oep, 0x8007, init2); ++ send_packet(oep, 0x8007, init1); ++ send_packet(oep, 0x8002, init2); ++ send_packet(oep, 0x8003, init3); + } + } + diff --git a/app-misc/lirc/files/lirc-0.8.3_pre3-imon-pad2keys.patch b/app-misc/lirc/files/lirc-0.8.3_pre3-imon-pad2keys.patch new file mode 100644 index 0000000..828c4ee --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.3_pre3-imon-pad2keys.patch @@ -0,0 +1,291 @@ +diff -ruN lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c +--- lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c 2008-04-28 22:15:54.281654857 +0200 ++++ lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c 2008-04-28 22:16:51.381649620 +0200 +@@ -73,9 +73,9 @@ + + + #define MOD_AUTHOR "Venky Raju <dev@venky.ws>" +-#define MOD_DESC "Driver for Soundgraph iMON MultiMedia IR/VFD" ++#define MOD_DESC "Driver for Soundgraph iMON MultiMedia IR/VFD w/imon pad2keys patch" + #define MOD_NAME "lirc_imon" +-#define MOD_VERSION "0.3" ++#define MOD_VERSION "0.3p2k" + + #define VFD_MINOR_BASE 144 /* Same as LCD */ + #define DEVFS_MODE (S_IFCHR | S_IRUSR | S_IWUSR | \ +@@ -91,6 +91,7 @@ + #define TRUE 1 + #define FALSE 0 + ++#define CURSOR_LIMIT 16 + + /* ------------------------------------------------------------ + * P R O T O T Y P E S +@@ -177,6 +178,10 @@ + atomic_t busy; /* write in progress */ + int status; /* status of tx completion */ + } tx; ++ ++ int key_x; ++ int key_y; ++ int last_count; /* number of times pressed */ + }; + + #define LOCK_CONTEXT down(&context->sem) +@@ -248,6 +253,9 @@ + static int is_lcd; /* If LIRC_IMON_LCD not defined, default to non-LCD */ + #endif + ++/* pad2keys module parameter. pad2keys patch active? */ ++static int pad2keys_active = 0; ++ + #if !defined(KERNEL_2_5) + + #define MAX_DEVICES 4 /* In case there's more than one iMON device */ +@@ -271,6 +279,7 @@ + + MODULE_AUTHOR(MOD_AUTHOR); + MODULE_DESCRIPTION(MOD_DESC); ++MODULE_VERSION(MOD_VERSION); /* MBr: was missing */ + MODULE_LICENSE("GPL"); + MODULE_DEVICE_TABLE(usb, imon_usb_id_table); + +@@ -287,6 +296,9 @@ + "1=yes (default:no)"); + #endif + ++module_param (pad2keys_active, int, 0); ++MODULE_PARM_DESC (pad2keys_active, "pad2keys patch active: 0=no, 1=yes (default: no)"); ++ + static inline void delete_context(struct imon_context *context) + { + if (context->vfd_supported) +@@ -766,6 +778,11 @@ + context->rx.initial_space = 1; + context->rx.prev_bit = 0; + ++ /* init pad context for pad2keys */ ++ context ->key_x = 0; ++ context ->key_y = 0; ++ context ->last_count = 0; ++ + usb_fill_int_urb(context->rx_urb, context->dev, + usb_rcvintpipe(context->dev, + context->rx_endpoint->bEndpointAddress), +@@ -915,6 +932,94 @@ + + if (context->ir_onboard_decode) { + /* The signals have been decoded onboard the iMON controller */ ++ ++ if (pad2keys_active) ++ { ++ /* imon pad2keys patch ++ * ++ * make PAD and mouse buttons available for use with VDR, ++ * based on pad-mouse-emu patch from venky's forum ++ * ++ * last change: M.Brakemeier 2007-10-14 ++ * ++ * generated PAD key codes: ++ * Mouse_N 0x690281B7 ++ * Mouse_S 0x688291B7 ++ * Mouse_W 0x6A8281B7 ++ * Mouse_E 0x688A81B7 ++ * ++ * mouse buttons (non-synthetic): ++ * MouseRightClick 0x688481B7 ++ * MouseLeftClick 0x688301B7 ++ */ ++ if((buf[0] & 0x40) && ++ !(buf[1] & 0x01 || buf[1] >> 2 & 0x01)) ++ { ++ int rel_x = (buf[1] & 0x08) | (buf[1] & 0x10) >> 2 | (buf[1] & 0x20) >> 4 | (buf[1] & 0x40) >> 6; ++ int rel_y = (buf[2] & 0x08) | (buf[2] & 0x10) >> 2 | (buf[2] & 0x20) >> 4 | (buf[2] & 0x40) >> 6; ++ ++ if(buf[0] & 0x02) ++ rel_x |= ~0x10+1; ++ if(buf[0] & 0x01) ++ rel_y |= ~0x10+1; ++ ++ /* keyboard direction key emulation */ ++ if( context->last_count > 32 ) ++ { /* Hopefully eliminate drift*/ ++ context->last_count=0; ++ context->key_y=0; ++ context->key_x=0; ++ } ++ context->last_count++; ++ ++ /* limit decoded events */ ++ if(abs(context->key_x) > CURSOR_LIMIT || abs(context->key_y) > CURSOR_LIMIT ) ++ { ++ if(abs(context->key_y ) > abs(context->key_x)) ++ { /* mouse s/n */ ++ if(context->key_y > 0 && rel_y > 0) ++ { /* mouse s */ ++ buf[0] = 0x68; ++ buf[1] = 0x82; ++ buf[2] = 0x91; ++ } ++ else if(context->key_y < 0 && rel_y < 0) ++ { /* mouse n */ ++ buf[0] = 0x69; ++ buf[1] = 0x02; ++ buf[2] = 0x81; ++ } ++ } ++ else ++ { /* mouse e/w*/ ++ if(context->key_x > 0 && rel_x > 0 ) ++ { /* mouse e */ ++ buf[0] = 0x68; ++ buf[1] = 0x8A; ++ buf[2] = 0x81; ++ } ++ else if(context->key_x < 0 && rel_x < 0 ) ++ { /* mouse w */ ++ buf[0] = 0x6A; ++ buf[1] = 0x82; ++ buf[2] = 0x81; ++ } ++ } ++ } ++ else ++ { ++ context->key_x += rel_x; ++ context->key_y += rel_y; ++ ++ return; /* discard those key codes */ ++ } ++ } ++ /* a key was pressed, reset count */ ++ context->key_x = 0; ++ context->key_y = 0; ++ context->last_count = 0; ++ } ++ + lirc_buffer_write_1(context->plugin->rbuf, buf); + wake_up(&context->plugin->rbuf->wait_poll); + return; +diff -ruN lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c.rej lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c.rej +--- lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c.rej 1970-01-01 01:00:00.000000000 +0100 ++++ lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c.rej 2008-04-28 22:16:02.941653915 +0200 +@@ -0,0 +1,26 @@ ++*************** ++*** 271,280 **** ++ ++ MODULE_AUTHOR(MOD_AUTHOR); ++ MODULE_DESCRIPTION(MOD_DESC); ++ MODULE_LICENSE("GPL"); ++ MODULE_DEVICE_TABLE(usb, imon_usb_id_table); ++ module_param(debug, int, 0); ++ MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)"); ++ ++ static inline void delete_context(struct imon_context *context) ++ { ++--- 279,291 ---- ++ ++ MODULE_AUTHOR(MOD_AUTHOR); ++ MODULE_DESCRIPTION(MOD_DESC); +++ MODULE_VERSION(MOD_VERSION); /* MBr: was missing */ ++ MODULE_LICENSE("GPL"); ++ MODULE_DEVICE_TABLE(usb, imon_usb_id_table); ++ module_param(debug, int, 0); ++ MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)"); +++ module_param (pad2keys_active, int, 0); +++ MODULE_PARM_DESC (pad2keys_active, "pad2keys patch active: 0=no, 1=yes (default: no)"); ++ ++ static inline void delete_context(struct imon_context *context) ++ { +diff -ruN lirc-0.8.3pre3-orig/remotes/imon/lircd.conf.imon-pad2keys lirc-0.8.3pre3/remotes/imon/lircd.conf.imon-pad2keys +--- lirc-0.8.3pre3-orig/remotes/imon/lircd.conf.imon-pad2keys 1970-01-01 01:00:00.000000000 +0100 ++++ lirc-0.8.3pre3/remotes/imon/lircd.conf.imon-pad2keys 2008-04-28 22:16:02.941653915 +0200 +@@ -0,0 +1,88 @@ ++# Please make this file available to others
++# by sending it to <lirc@bartelmus.de>
++#
++# this config file was generated
++# using lirc-0.8.3pre1 (imon w/pad2keys patch)
++#
++# contributed by M.Brakemeier
++#
++# brand: SoundGraph
++# model no. of remote control: iMON-PAD
++# devices being controlled by this remote:
++#
++
++begin remote
++
++ name iMON-PAD
++ bits 32
++ eps 30
++ aeps 100
++
++ one 0 0
++ zero 0 0
++ gap 235965
++ min_repeat 1
++ toggle_bit 0
++
++ begin codes
++ AppExit 0x288195B7
++ Power 0x289115B7
++ Record 0x298115B7
++ Play 0x2A8115B7
++ Open 0x29B1D5B7
++ Rewind 0x2A8195B7
++ Pause 0x2A9115B7
++ FastForward 0x2B8115B7
++ PrevChapter 0x2B9115B7
++ Stop 0x2B9715B7
++ NextChapter 0x298195B7
++ Esc 0x2BB715B7
++ Eject 0x299395B7
++ AppLauncher 0x29B715B7
++ MultiMon 0x2AB195B7
++ TaskSwitcher 0x2A9395B7
++ Mute 0x2B9595B7
++ Vol+ 0x28A395B7
++ Vol- 0x28A595B7
++ Ch+ 0x289395B7
++ Ch- 0x288795B7
++ Timer 0x2B8395B7
++ 1 0x28B595B7
++ 2 0x2BB195B7
++ 3 0x28B195B7
++ 4 0x2A8595B7
++ 5 0x299595B7
++ 6 0x2AA595B7
++ 7 0x2B9395B7
++ 8 0x2A8515B7
++ 9 0x2AA115B7
++ 0 0x2BA595B7
++ ShiftTab 0x28B515B7
++ Tab 0x29A115B7
++ Red 0x2B8515B7 # MyMovie
++ Green 0x299195B7 # MyMusic
++ Blue 0x2BA115B7 # MyPhoto
++ Yellow 0x28A515B7 # MyTV
++ Bookmark 0x288515B7
++ Thumbnail 0x2AB715B7
++ AspectRatio 0x29A595B7
++ FullScreen 0x2AA395B7
++ Purple 0x29A295B7 # MyDVD
++ Menu 0x2BA385B7
++ Caption 0x298595B7
++ Language 0x2B8595B7
++ MouseKeyboard 0x299115B7
++ SelectSpace 0x2A9315B7
++ MouseMenu 0x28B715B7
++ MouseRightClick 0x688481B7
++ Enter 0x28A195B7
++ MouseLeftClick 0x688301B7
++ WindowsKey 0x2B8195B7
++ Backspace 0x28A115B7
++ Mouse_N 0x690281B7
++ Mouse_S 0x688291B7
++ Mouse_W 0x6A8281B7
++ Mouse_E 0x688A81B7
++ end codes
++
++end remote
diff --git a/app-misc/lirc/files/lirc-0.8.4-portaudio_check.patch b/app-misc/lirc/files/lirc-0.8.4-portaudio_check.patch new file mode 100644 index 0000000..36f5f36 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.4-portaudio_check.patch @@ -0,0 +1,18 @@ +Portaudio is only needed for LIRC_DEVICES=audio, so not checking for Portaudio when the device is disabled will prevent automagic dependencies. +--- configure.ac.orig 2009-03-13 10:02:50.000000000 +0100 ++++ configure.ac 2009-03-13 10:04:00.000000000 +0100 +@@ -336,14 +336,6 @@ + AC_DEFINE(HAVE_LIBIRMAN_SW) + possible_drivers="${possible_drivers} (irman_sw)" + ) +-dnl audio driver requires PortAudio library installed and some linker flags +-AC_CHECK_HEADERS(portaudio.h,[ +- AC_CHECK_LIB(portaudio, Pa_Initialize,[ +- AC_DEFINE(HAVE_LIBPORTAUDIO) +- possible_drivers="${possible_drivers} (audio)" +- ],,${portaudio_lib_other} +- )] +-) + dnl audio_alsa driver requires ALSA library installed and some linker flags + have_alsa=no + AC_CHECK_HEADERS(alsa/asoundlib.h,[ diff --git a/app-misc/lirc/files/lirc-0.8.6-i2c.patch b/app-misc/lirc/files/lirc-0.8.6-i2c.patch new file mode 100644 index 0000000..bf4017e --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.6-i2c.patch @@ -0,0 +1,71 @@ +--- drivers/lirc_i2c/lirc_i2c.c 2009/08/30 16:59:53 1.70 ++++ drivers/lirc_i2c/lirc_i2c.c 2009/12/28 15:29:03 1.72 +@@ -399,8 +399,8 @@ + .name = "i2c ir driver", + }, + #endif +- .id = I2C_DRIVERID_EXP3, /* FIXME */ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) ++ .id = I2C_DRIVERID_EXP3, /* FIXME */ + .attach_adapter = ir_probe, + .detach_client = ir_remove, + #else +@@ -492,20 +492,23 @@ + ir->l.add_to_buf = add_to_buf_pv951; + break; + case 0x71: +-#ifdef I2C_HW_B_CX2341X +- if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848) || +- adap->id == (I2C_ALGO_BIT | I2C_HW_B_CX2341X)) { +-#else +- if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848)) { ++ ++ ++ ++#ifdef I2C_HW_B_CX2388x ++ /* Leadtek Winfast PVR2000 or Hauppauge HVR-1300 */ ++ if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_CX2388x)) ++ strlcpy(ir->c.name, "Hauppauge HVR1300", I2C_NAME_SIZE); ++ else + #endif ++ { + /* + * The PVR150 IR receiver uses the same protocol as + * other Hauppauge cards, but the data flow is + * different, so we need to deal with it by its own. + */ + strlcpy(ir->c.name, "Hauppauge PVR150", I2C_NAME_SIZE); +- } else /* I2C_HW_B_CX2388x */ +- strlcpy(ir->c.name, "Hauppauge HVR1300", I2C_NAME_SIZE); ++ } + ir->l.code_length = 13; + ir->l.add_to_buf = add_to_buf_haup_pvr150; + break; +@@ -516,19 +519,18 @@ + break; + case 0x18: + case 0x1a: +-#ifdef I2C_HW_B_CX2341X +- if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848) || +- adap->id == (I2C_ALGO_BIT | I2C_HW_B_CX2341X)) { ++#ifdef I2C_HW_B_CX2388x ++ if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_CX2388x)) { ++ strlcpy(ir->c.name, "Leadtek IR", I2C_NAME_SIZE); ++ ir->l.code_length = 8; ++ ir->l.add_to_buf = add_to_buf_pvr2000; ++ } else { + #else +- if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848)) { ++ { + #endif + strlcpy(ir->c.name, "Hauppauge IR", I2C_NAME_SIZE); + ir->l.code_length = 13; + ir->l.add_to_buf = add_to_buf_haup; +- } else { /* I2C_HW_B_CX2388x */ +- strlcpy(ir->c.name, "Leadtek IR", I2C_NAME_SIZE); +- ir->l.code_length = 8; +- ir->l.add_to_buf = add_to_buf_pvr2000; + } + break; + case 0x30: + diff --git a/app-misc/lirc/files/lirc-0.8.6-send-evsyn.diff b/app-misc/lirc/files/lirc-0.8.6-send-evsyn.diff new file mode 100644 index 0000000..a7583ac --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.6-send-evsyn.diff @@ -0,0 +1,20 @@ +--- daemons/lircd.c.old 2009-12-30 14:37:13.000000000 -0600 ++++ daemons/lircd.c 2009-12-30 14:39:42.000000000 -0600 +@@ -1909,6 +1909,17 @@ + logprintf(LOG_ERR, "writing to uinput failed"); + logperror(LOG_ERR, NULL); + } ++ ++ /* Need to write sync event */ ++ memset(&event, 0, sizeof(event)); ++ event.type = EV_SYN; ++ event.code = SYN_REPORT; ++ event.value = 0; ++ if(write(uinputfd, &event, sizeof(event)) != sizeof(event)) ++ { ++ logprintf(LOG_ERR, "writing EV_SYN to uinput failed"); ++ logperror(LOG_ERR, NULL); ++ } + } + } + #endif diff --git a/app-misc/lirc/files/lirc-nct677x-lirc0.8.6.patch b/app-misc/lirc/files/lirc-nct677x-lirc0.8.6.patch new file mode 100755 index 0000000..6cbf7d0 --- /dev/null +++ b/app-misc/lirc/files/lirc-nct677x-lirc0.8.6.patch @@ -0,0 +1,7 @@ +--- lirc.hwdb 2009-12-17 12:31:07.539760680 +0100 ++++ lirc.hwdb.new 2009-12-18 09:18:02.584041023 +0100 +@@ -147,3 +147,4 @@ + VLSystem MPlay Blast;mplay;none;hw_mplay;vlsystem/lircd.conf.mplay; + VLSystem MPlay Mini;mplay;none;hw_mplay;vlsystem/lircd.conf.mplay; + Windows Media Center Transceivers/Remotes (all);mceusb;lirc_dev lirc_mceusb;hw_default;mceusb/lircd.conf.mceusb; ++Nuvoton Transceivers/Remotes;lirc_wb677;lirc_dev lirc_wb677;hw_default;lirc_wb677/lircd.conf.wb677; diff --git a/app-misc/lirc/files/lirc_wb677.h b/app-misc/lirc/files/lirc_wb677.h new file mode 100755 index 0000000..67ae549 --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677.h @@ -0,0 +1,683 @@ +/* +* LIRC driver for Nuvoton w83667hg/w83677hg-i +* +* Copyright (C) 2009 Nuvoton PS Team +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of the +* License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +* USA +*/ + +#include <linux/module.h> +#include <linux/init.h> +#include <linux/fs.h> +#include <linux/poll.h> +#include <linux/version.h> +#include <linux/delay.h> +#include <linux/input.h> +#include <linux/platform_device.h> +#include <linux/pnp.h> + +/*//#include <asm/semaphore.h>*/ +#include <linux/semaphore.h> + +#include <linux/device.h> +#include <asm-generic/ioctl.h> + +#include <linux/ioport.h> +#include <linux/interrupt.h> +#include <linux/io.h> + + + +#include "lirc_wb677_common_extern.h" + + + +/* CIR settings */ + +/* total length of CIR and CIR WAKE */ +#define CIR_IOREG_LENGTH 0x0f + +/* RX limit length, 8 high bits for SLCH, 8 low bits for SLCL + * 0x7d0 = 2000 */ +#define CIR_RX_LIMIT_COUNT 0x7d0 + +/* CIR Regs */ +#define CIR_IRCON 0x00 +#define CIR_IRSTS 0x01 +#define CIR_IREN 0x02 +#define CIR_RXFCONT 0x03 +#define CIR_CP 0x04 +#define CIR_CC 0x05 +#define CIR_SLCH 0x06 +#define CIR_SLCL 0x07 +#define CIR_FIFOCON 0x08 +#define CIR_IRFIFOSTS 0x09 +#define CIR_SRXFIFO 0x0A +#define CIR_TXFCONT 0x0B +#define CIR_STXFIFO 0x0C +#define CIR_FCCH 0x0D +#define CIR_FCCL 0x0E +#define CIR_IRFSM 0x0F + +/* CIR IRCON settings */ +#define CIR_IRCON_RECV 0x80 +#define CIR_IRCON_WIREN 0x40 +#define CIR_IRCON_TXEN 0x20 +#define CIR_IRCON_RXEN 0x10 +#define CIR_IRCON_WRXINV 0x08 +#define CIR_IRCON_RXINV 0x04 + +#define CIR_IRCON_SAMPLE_PERIOD_SEL_1 0x00 +#define CIR_IRCON_SAMPLE_PERIOD_SEL_25 0x01 +#define CIR_IRCON_SAMPLE_PERIOD_SEL_50 0x02 +#define CIR_IRCON_SAMPLE_PERIOD_SEL_100 0x03 + +/* select sample period as 50us */ +#define CIR_IRCON_SAMPLE_PERIOD_SEL CIR_IRCON_SAMPLE_PERIOD_SEL_50 + +/* CIR IRSTS settings */ +#define CIR_IRSTS_RDR 0x80 +#define CIR_IRSTS_RTR 0x40 +#define CIR_IRSTS_PE 0x20 +#define CIR_IRSTS_RFO 0x10 +#define CIR_IRSTS_TE 0x08 +#define CIR_IRSTS_TTR 0x04 +#define CIR_IRSTS_TFU 0x02 +#define CIR_IRSTS_GH 0x01 + +/* CIR IREN settings */ +#define CIR_IREN_RDR 0x80 +#define CIR_IREN_RTR 0x40 +#define CIR_IREN_PE 0x20 +#define CIR_IREN_RFO 0x10 +#define CIR_IREN_TE 0x08 +#define CIR_IREN_TTR 0x04 +#define CIR_IREN_TFU 0x02 +#define CIR_IREN_GH 0x01 + +/* CIR FIFOCON settings */ +#define CIR_FIFOCON_TXFIFOCLR 0x80 + +#define CIR_FIFOCON_TX_TRIGGER_LEV_31 0x00 +#define CIR_FIFOCON_TX_TRIGGER_LEV_24 0x10 +#define CIR_FIFOCON_TX_TRIGGER_LEV_16 0x20 +#define CIR_FIFOCON_TX_TRIGGER_LEV_8 0x30 + +/* select TX trigger level as 16 */ +#define CIR_FIFOCON_TX_TRIGGER_LEV CIR_FIFOCON_TX_TRIGGER_LEV_16 + +#define CIR_FIFOCON_RXFIFOCLR 0x08 + +#define CIR_FIFOCON_RX_TRIGGER_LEV_1 0x00 +#define CIR_FIFOCON_RX_TRIGGER_LEV_8 0x01 +#define CIR_FIFOCON_RX_TRIGGER_LEV_16 0x02 +#define CIR_FIFOCON_RX_TRIGGER_LEV_24 0x03 + +/* select RX trigger level as 1 */ +#define CIR_FIFOCON_RX_TRIGGER_LEV CIR_FIFOCON_RX_TRIGGER_LEV_1 + +/* CIR IRFIFOSTS settings */ +#define CIR_IRFIFOSTS_IR_PENDING 0x80 +#define CIR_IRFIFOSTS_RX_GS 0x40 +#define CIR_IRFIFOSTS_RX_FTA 0x20 +#define CIR_IRFIFOSTS_RX_EMPTY 0x10 +#define CIR_IRFIFOSTS_RX_FULL 0x08 +#define CIR_IRFIFOSTS_TX_FTA 0x04 +#define CIR_IRFIFOSTS_TX_EMPTY 0x02 +#define CIR_IRFIFOSTS_TX_FULL 0x01 + + +/* CIR WAKE UP Regs */ +#define CIR_WAKE_IRCON 0x00 +#define CIR_WAKE_IRSTS 0x01 +#define CIR_WAKE_IREN 0x02 +#define CIR_WAKE_FIFO_CMP_DEEP 0x03 +#define CIR_WAKE_FIFO_CMP_TOL 0x04 +#define CIR_WAKE_FIFO_COUNT 0x05 +#define CIR_WAKE_SLCH 0x06 +#define CIR_WAKE_SLCL 0x07 +#define CIR_WAKE_FIFOCON 0x08 +#define CIR_WAKE_SRXFSTS 0x09 +#define CIR_WAKE_SAMPLE_RX_FIFO 0x0A +#define CIR_WAKE_WR_FIFO_DATA 0x0B +#define CIR_WAKE_RD_FIFO_ONLY 0x0C +#define CIR_WAKE_RD_FIFO_ONLY_IDX 0x0D +#define CIR_WAKE_FIFO_IGNORE 0x0E +#define CIR_WAKE_IRFSM 0x0F + +/* CIR WAKE UP IRCON settings */ +#define CIR_WAKE_IRCON_DEC_RST 0x80 +#define CIR_WAKE_IRCON_MODE1 0x40 +#define CIR_WAKE_IRCON_MODE0 0x20 +#define CIR_WAKE_IRCON_RXEN 0x10 +#define CIR_WAKE_IRCON_R 0x08 +#define CIR_WAKE_IRCON_RXINV 0x04 + +/* select a same sample period like cir register */ +#define CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL CIR_IRCON_SAMPLE_PERIOD_SEL_50 + +/* CIR WAKE UP IRSTS settings */ +#define CIR_WAKE_IRSTS_RDR 0x80 +#define CIR_WAKE_IRSTS_RTR 0x40 +#define CIR_WAKE_IRSTS_PE 0x20 +#define CIR_WAKE_IRSTS_RFO 0x10 +#define CIR_WAKE_IRSTS_GH 0x08 +#define CIR_WAKE_IRSTS_IR_PENDING 0x01 + +/* CIR WAKE UP IREN settings */ +#define CIR_WAKE_IREN_RDR 0x80 +#define CIR_WAKE_IREN_RTR 0x40 +#define CIR_WAKE_IREN_PE 0x20 +#define CIR_WAKE_IREN_RFO 0x10 +#define CIR_WAKE_IREN_TE 0x08 +#define CIR_WAKE_IREN_TTR 0x04 +#define CIR_WAKE_IREN_TFU 0x02 +#define CIR_WAKE_IREN_GH 0x01 + +/* CIR WAKE FIFOCON settings */ +#define CIR_WAKE_FIFOCON_RXFIFOCLR 0x08 + +#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_67 0x00 +#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_66 0x01 +#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_65 0x02 +#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_64 0x03 + +/* select WAKE UP RX trigger level as 67 */ +#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_67 + +/* CIR WAKE SRXFSTS settings */ +#define CIR_WAKE_IRFIFOSTS_RX_GS 0x80 +#define CIR_WAKE_IRFIFOSTS_RX_FTA 0x40 +#define CIR_WAKE_IRFIFOSTS_RX_EMPTY 0x20 +#define CIR_WAKE_IRFIFOSTS_RX_FULL 0x10 + + + + +/* Config Regs */ + +/* Chip Control Regs */ +#define cr_cfg_idx 0x2e +#define cr_cfg_dat 0x2f + +#define cr_cfg_idx2 0x4e +#define cr_cfg_dat2 0x4f + +static u8 CFG_idx = cr_cfg_idx; +static u8 CFG_dat = cr_cfg_dat; + +#define CHIP_ID_HIGH_ADDR 0x20 +#define CHIP_ID_LOW_ADDR 0x21 + +#define CHIP_ID_HIGH 0xB4 +#define CHIP_ID_LOW 0x73 + +#define ACTIVE_LOG_DEV 0x01 +#define DEACTIVE_LOG_DEV 0x0 + +#define CIR_LOG_DEV 0x06 + +#define ACPI_LOG_DEV 0x0A + +#define ENABLE_CIR_WAKE 0x08 +#define DISABLE_CIR_WAKE 0xF7 + +#define ENABLE_CIR_INTR_OF_MOUSE_IRQ 0x80 +#define DISABLE_CIR_INTR_OF_MOUSE_IRQ 0x7F + +#define ENABLE_PME_INTR_OF_CIR_PASS 0x08 +#define DISABLE_PME_INTR_OF_CIR_PASS 0xF7 + +#define CIR_WAKE_LOG_DEV 0x0E + + +/* read/update registers functions */ + +/* enter extended function mode */ +static inline void cr_enter_ext(void); + +/* exit extended function mode */ +static inline void cr_exit_ext(void); + +/* select logical device */ +static inline void cr_select_log_dev(int cr); + +static inline void cr_update(int dat, int cr); + +static inline u8 cr_read(int cr); + +/* update cr register without change other bits */ +static inline void cr_safe_update(u8 dat, int cr); + +/* clear cr register without change other bits */ +static inline void cr_safe_clear(u8 dat, int cr); + + + +/* read/write cir registers */ + +static inline void cir_update(u8 dat, int cir); + +static u8 cir_read(int cir); + +/* read/write cir wake registers */ + +static inline void cir_wake_update(u8 dat, int cir); + +static u8 cir_wake_read(int cir); + + +/* dump current cir registers */ +static void cir_dump_reg(void); + +/* dump current cir wake up registers */ +static void cir_wake_dump_reg(void); + + + + + +/* driver module load/unload functions */ + +/* Config Registers init */ +/* + * initialize cr, cir, apci, cir wake logical devices + * open these devices and irq + */ +static int w83667hg_cr_init(void); + +/* Config Registers uninit */ +/* + * close cir and cir wake logical devices + */ +static void w83667hg_cr_uninit(void); + + +/* register input device (keyboard and mouse) + * + */ + +/* Define it for decoding keyboard and mouse in driver */ +#define DECODE_KEYBOARD_MOUSE + +/* this is the keycode table of US-EN layout keyboard + * modify it to support other layout keyboard + */ +unsigned int 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 +}; + +/* input device name, locate in /sys/input/inputNUM/name */ +static char *INPUTNAME = "MCE Remote Keyboard"; + +static struct input_id w83667hg_input_id = { + .bustype = BUS_HOST, /* comunicate 667 by HOST, or I2C ? */ + .vendor = 0x1050, /* Winbond PCI VENDOR ID */ + .product = 1, /* for basic devices, like keyboard & mouse */ + .version = 0, /* ignore it */ +}; + + +static int w83667hg_input_open(struct input_dev *cur_input_dev); + +static void w83667hg_input_close(struct input_dev *cur_input_dev); + +static struct input_dev *w83667hg_input_init(void); + +static void w83667hg_input_uninit(struct input_dev *cur_input_dev); + +/* internal call for register lirc */ +static int lirc_set_use_inc(void *data); + +static void lirc_set_use_dec(void *data); + + + +static struct ir_recv_t { + spinlock_t lock; + u8 buf[IRCTL_BUF_LIMIT]; + unsigned int buf_count; + wait_queue_head_t queue; + /* for wake */ +#define ST_WAKE_NONE 0x0 +#define ST_WAKE_START 0x01 +#define ST_WAKE_FINISH 0x02 + u8 wake_state; + /* for recv */ +#define ST_RECV_WAIT_7F 0x01 +#define ST_RECV_WAIT_HEAD 0x02 +#define ST_RECV_WAIT_SILENT_END 0x04 + u8 recv_state; +} w83667hg_ir_recv; + +static struct ir_send_t { + spinlock_t lock; + u8 buf[IRCTL_BUF_LIMIT]; + unsigned int buf_count; + unsigned int cur_buf_num; + wait_queue_head_t queue; + /* for send */ +#define ST_SEND_NONE 0x0 +#define ST_SEND_REQUEST 0x02 +#define ST_SEND_REPLY 0x04 + u8 send_state; +} w83667hg_ir_send; + +/* We initialise it at lirc_wb667_init() becuase of lirc group does not allow to initialise static varialbe to null.*/ +static struct input_dev *w83667hg_input_dev; + +/* We initialise it at lirc_wb667_init() becuase of lirc group does not allow to initialise static varialbe to null.*/ +static struct lirc_driver *w83667hg_lirc_plugin; + +#define LIRCBUF_SIZE 256 + +/* We initialise it at lirc_wb667_init() becuase of lirc group does not allow to initialise static varialbe to null.*/ +static struct lirc_buffer *w83667hg_lirc_buffer; + +static void w83667hg_ir_recv_init(struct ir_recv_t *ir_recv); + +static void w83667hg_ir_send_init(struct ir_send_t *ir_send); + +static int w83667hg_irctl_init(struct irctl *ir); + +static void w83667hg_irctl_uninit(struct irctl *ir); + + + + +/* MCE CIR signal length, related on sample period */ + +/* MCE CIR controller signal length: about 43ms + * 43ms / 50us (sample period) * 0.85 (inaccuracy) + */ +#define CONTROLLER_BUF_LEN_MIN 830 + +/* MCE CIR keyboard signal length: about 26ms + * 26ms / 50us (sample period) * 0.85 (inaccuracy) + */ +#define KEYBOARD_BUF_LEN_MAX 650 +#define KEYBOARD_BUF_LEN_MIN 610 + +/* MCE CIR mouse signal length: about 24ms + * 24ms / 50us (sample period) * 0.85 (inaccuracy) + */ +#define MOUSE_BUF_LEN_MIN 565 + + +#define CIR_SAMPLE_PERIOD 50 +#define CIR_SAMPLE_LOW_INACCURACY 0.85 + + +/* MAX silence time that driver will sent to lirc */ +#define MAX_SILENCE_TIME 60000 + + +/* fops */ +/* set carrier frequency by ioctl IR_IOSETCARRIER + * + * that value can be get by ioctl value IR_IOGETCARRIER + * on 667, set carrier on 2 registers: CP & CC + * always set CP as 0x81 + * set CC by SPEC, CC = 3MHz/carrier - 1 + */ +static int w83667hg_set_carrier(unsigned int *carrier); + +static int lirc_ioctl(struct inode *node, struct file *filep, unsigned int cmd, + unsigned long arg); + +/* lirc_write + * + * 1) clean TX fifo first (handled by AP) + * 2) copy data from user space + * 3) open TX interrupt: TTR & TFU + * 4) send 9 pulses to open TTR + * in interrupt_handler: + * 5) send all data out + * go back to write(): + * 6) close TX interrupt + * + * The key problem of this function is user space data may larger than + * driver's data buf length. So lirc_wirte() only copy IRCTL_BUF_LIMIT data to + * buf. And keep current copied data buf num in cur_buf_num. But driver's buf + * number may larger than TXFCONT (0xFF). So in interrupt_handler, it has to + * set TXFCONT as 0xff, until buf_count less than 0xff. + * The confustion is cur_buf_num in decode, study and send is designed on + * different meaning. + * + */ +static ssize_t lirc_write(struct file *file, const char *buf, size_t n, loff_t * ppos); + + + +/* 1) clean lircdata and buf_count in irctl struct + * 2) clean RX and TX fifo + */ +static void w83667hg_clean_data(struct ir_recv_t *ir_recv, struct irctl *ir); + + + + +/* send 1 recorded controller signal to lirc */ +static void w83667hg_send_packet_to_lirc_1(struct irctl *ir, lirc_t *val); + +/* this value copy from lirc_mod_mce */ +#if CIR_IRCON_SAMPLE_PERIOD_SEL == CIR_IRCON_SAMPLE_PERIOD_SEL_100 + #define MCE_TIME_UNIT 100 +#elif CIR_IRCON_SAMPLE_PERIOD_SEL == CIR_IRCON_SAMPLE_PERIOD_SEL_50 + #define MCE_TIME_UNIT 50 +#elif CIR_IRCON_SAMPLE_PERIOD_SEL == CIR_IRCON_SAMPLE_PERIOD_SEL_25 + #define MCE_TIME_UNIT 25 +#else + #define MCE_TIME_UNIT 1 +#endif + +/* recode mce controller signal and send to lirc + * + * recode steps: + * 1) high pulse, +128 + * 2) low pulse, do nothing + * 3) keycode = pulse * 50 + * 4) sync head: PULSE_MASK (0xFF FFFF) + * 5) 1, |PULSE_BIT (0x100 0000) + * 0, +keycode + * + * function steps: + * 0) clean lircdata[] + * 1) jump head, put PULSE_BIT in lircdata[0] + * 2) normal decode, "10"=>1 |PULSE_BIT + * save in lircdata[] + * 3) send lircdata[] to lirc + */ +static void w83667hg_submit_controller(struct irctl *ir); + + +/* copy data from hardware fifo to driver buf + * + * 1. initial state is WAIT_7F + * 2. if data is not 0x7f, copy data from hardware fifo to struct ir_recv buf + * 3. if data is 0x7f, set recv_state as WAIT_HEAD, copy data from ir_recv to irctl + * 4. depend on received buf length to select submit_ function + * 5. set irctl buf len as 0 + * 5. receive data until data is not 0x7f, drop received 0x7f data, set recv_state as WAIT_7F again + * + * in normal, there are 3 parts in one infrared signal: + * 1. not silent pulse (ST_WAIT_7F) + * 2. 0x7f silent pulse (ST_WAIT_HEAD) + * 3. silent pulse shorter than 0x7f (ST_WAIT_HEAD) + * + * so this function copy signal part 1 and a 0x7f (for decode) to submit_() functions. + * when receive 0x7f, this function copy data from ir_recv to irctl, and wait for next high pulse. + */ +static void w83667hg_recv(struct ir_recv_t *ir_recv, struct irctl *ir); + + +/* as VISTA MCE definition, valid carrier value */ +#define MAX_CARRIER 60000 +#define MIN_CARRIER 30000 + +/* receive function for STUDY + * + * 0. not receive 0x80, copy received data to ir_recv buf + * when get 0x80, it means user released controller, and only need process received data + * 1. get carrier + * 2. get pulse + */ +static void w83667hg_study_recv(struct ir_recv_t *ir_recv, struct irctl *ir); + +static irqreturn_t w83667hg_wake_interrupt_handler(int irq, void *dev); + +static irqreturn_t w83667hg_interrupt_handler(int irq, void *dev); + + +/* pnp device */ +#ifdef CONFIG_PNP + + +/* CIR and CIR WAKE */ +static const struct pnp_device_id pnp_dev_table[] = { + { "WEC0530", 0 }, /* CIR */ + { "NTN0530", 0 }, /* CIR for new chip's pnp id*/ + { "", 0 }, +}; + + +MODULE_DEVICE_TABLE(pnp, pnp_dev_table); + +static int __devinit lirc_wb667_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id); + +static void __devexit lirc_wb667_pnp_remove(struct pnp_dev *dev); + +/* before suspend + * 1. set all states as NONE + * 2. close CIR and WAKE interrupt + * 3. close CIR and WAKE cr + * 4. close input + */ +static int lirc_wb667_pnp_suspend(struct pnp_dev *dev, pm_message_t state); + +/* resume all register and input device + */ +static int lirc_wb667_pnp_resume(struct pnp_dev *dev); + +/* We initialise it as lirc_wb667_init because lirc group does not allow us to initialise static vaiable as 0 here. */ +static unsigned int nopnp; + +#else + +/* We initialise it as lirc_lirc_wb667_init because lirc group does not allow us to initialise static vaiable as 0 here. */ +static unsigned int nopnp; + +#endif + + +/* create io region for cir and cir wake + * create irq handler + * create dev and data struct + */ +static int w83667hg_cir_probe(void); + +/* uninit cir, cir wake, dev and data struct, release irq and io port */ +static void w83667hg_cir_remove(void); + + +static int lirc_wb667_init(void); + +void lirc_wb667_uninit(void); + + +/* + * 1. init cr + * 2. init input + * 3. init lirc buffer, register, irctl + * 4. init 667 cir dev, req_region, req_irq + */ +/*int init_module(void); +void cleanup_module(void);*/ +int init_module_wb667(void); +void cleanup_module_wb667(void); + +MODULE_DESCRIPTION("LIRC driver for Nuvoton W83667HG-A & W83677HG CIR"); +MODULE_AUTHOR("Nuvoton PS Team"); +MODULE_LICENSE("GPL"); + +/* device file name, locate in /dev/ directory */ +/*//static char *DRVNAME = "w83667hg_ir";*/ +/* FIXME, stable name*/ +char *DRVNAME = "lirc_wb677"; +module_param(DRVNAME, charp, S_IRUGO); +MODULE_PARM_DESC(DRVNAME, "Device file name in /dev/ and /sys/class/."); + +/* platform driver name to register */ +#define PLATNAME "lirc_wb677_cir" +#define PLATNAME_W "lirc_wb667_wake" + +/* device file major number */ +#define CIR_MAJOR 229 + +/* cir device base address */ +static u16 CIR_BASE = 0x240; +module_param(CIR_BASE, ushort, S_IRUGO); +MODULE_PARM_DESC(CIR_BASE, "Base IO port address of 667/677 CIR device."); + +/* cir base i/o address */ +static unsigned int cir_address; + +/* cir irq */ +static ushort CIR_IRQ_NUM = 5; +module_param(CIR_IRQ_NUM, ushort, S_IRUGO); +MODULE_PARM_DESC(CIR_IRQ_NUM, "IRQ number for 667/677 CIR device."); + +/* handle cir wake up request in driver or not */ +#define ENABLE_CIR_WAKE_IRQ + +/* cir wake up device base address */ +static u16 CIR_WAKE_BASE = 0x250; +module_param(CIR_WAKE_BASE, ushort, S_IRUGO); +MODULE_PARM_DESC(CIR_WAKE_BASE, "Base IO port address of 667/677 CIR WAKE device."); + +/* cir wake up base i/o address */ +static unsigned int cir_wake_address; + +/* cir wake up irq */ +static ushort CIR_WAKE_IRQ_NUM = 5; +module_param(CIR_WAKE_IRQ_NUM, ushort, S_IRUGO); +MODULE_PARM_DESC(CIR_WAKE_IRQ_NUM, "IRQ number for 667/677 CIR WAKE device."); + +/* nopnp option */ +#ifdef CONFIG_PNP +module_param(nopnp, uint, S_IRUGO); +MODULE_PARM_DESC(nopnp, "Scan for device instead of relying on PNP. (default 0)"); +#endif + +/*//EXPORT_NO_SYMBOLS;*/ + + + diff --git a/app-misc/lirc/files/lirc_wb677.ko b/app-misc/lirc/files/lirc_wb677.ko Binary files differnew file mode 100644 index 0000000..40b4400 --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677.ko diff --git a/app-misc/lirc/files/lirc_wb677.mod.c b/app-misc/lirc/files/lirc_wb677.mod.c new file mode 100644 index 0000000..4c436ad --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677.mod.c @@ -0,0 +1,25 @@ +#include <linux/module.h> +#include <linux/vermagic.h> +#include <linux/compiler.h> + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +struct module __this_module +__attribute__((section(".gnu.linkonce.this_module"))) = { + .name = KBUILD_MODNAME, + .init = init_module, +#ifdef CONFIG_MODULE_UNLOAD + .exit = cleanup_module, +#endif + .arch = MODULE_ARCH_INIT, +}; + +static const char __module_depends[] +__used +__attribute__((section(".modinfo"))) = +"depends="; + +MODULE_ALIAS("pnp:dWEC0530*"); +MODULE_ALIAS("acpi*:WEC0530:*"); +MODULE_ALIAS("pnp:dNTN0530*"); +MODULE_ALIAS("acpi*:NTN0530:*"); diff --git a/app-misc/lirc/files/lirc_wb677.mod.o b/app-misc/lirc/files/lirc_wb677.mod.o Binary files differnew file mode 100644 index 0000000..66b610b --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677.mod.o diff --git a/app-misc/lirc/files/lirc_wb677.o b/app-misc/lirc/files/lirc_wb677.o Binary files differnew file mode 100644 index 0000000..06208c3 --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677.o diff --git a/app-misc/lirc/files/lirc_wb677_common_extern.h b/app-misc/lirc/files/lirc_wb677_common_extern.h new file mode 100755 index 0000000..158f844 --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677_common_extern.h @@ -0,0 +1,119 @@ +#ifndef __LIRC_WB677_COMMON_EXTERN_HEADER__ +#define __LIRC_WB677_COMMON_EXTERN_HEADER__ + +#include <linux/semaphore.h> + +#include "/usr/src/lirc-0.8.6/drivers/lirc.h" +#include "/usr/src/lirc-0.8.6/drivers/kcompat.h" +#include "/usr/src/lirc-0.8.6/drivers/lirc_dev/lirc_dev.h" + +extern char *DRVNAME; + +/* chip id string, at most 7 characters */ +extern char *chip_id; + + + + +/* allow show debug messages + * without additional debug setting, only show current IRQ number, I/O port and final decode output */ +/*//#define IR_667_DEBUG*/ + +/* show debug message while decode mce keyboard and mouse signals */ +#ifdef IR_667_DEBUG +/*//#define ALLOW_DEBUG_DECODE*/ +#endif + +/* show incoming interrupt signals + * may block machine, mask it if sure interrupt signal is good */ +#ifdef IR_667_DEBUG +/*//#define ALLOW_DEBUG_INTERRUPT*/ +#endif + +/* show received infrared pulse and cancel decode functions, mask it in stable version + * it will stop decode MCE controller, keyboard and mouse + * mask it if want to decode incoming signals + */ +#ifdef IR_667_DEBUG +/*//#define ALLOW_DEBUG_PRINT_PULSE*/ +#endif + +/* show debug message while set WAKE UP key + * it will print cir_wake buf message while setting wake up key + * mask it in stable version + */ +#ifdef IR_667_DEBUG +#define ALLOW_DEBUG_WAKE +#endif + +/* show STUDY debug messages */ +#ifdef IR_667_DEBUG +#define ALLOW_DEBUG_STUDY +#endif + +/* show ioctl debug messages */ +#ifdef IR_667_DEBUG +#define ALLOW_DEBUG_IOCTL +#endif + +/* step debug */ +#ifdef IR_667_DEBUG +#define ALLOW_DEBUG_STEP +#endif + +#ifdef ALLOW_DEBUG_STEP +#define STEP_DBG \ + do { \ + printk("w83667hg_ir step debug: %s, %d\n", __FILE__, __LINE__); \ + } while (0); +#else +#define STEP_DBG +#endif + +#ifdef ALLOW_DEBUG_PRINT_PULSE +/* print current received ir pulse + * it will output all data, clean CIR_IRSTS so make all following irq_handler ignore + */ +void debug_print_pulse(void); + +void debug_print_wake_pulse(void); +#endif + + + + +/* register lirc device & buffer */ + +/* mininum value 76, recommend 256 */ +#define IRCTL_BUF_LIMIT 2048 + + +struct irctl { + struct input_dev *input_dev; /* allocate by input_init */ + struct lirc_buffer *lirc_buffer; + struct lirc_driver *lirc_plugin; + spinlock_t lock; + /* for controller */ + lirc_t lircdata; + u8 ctrl_fix_head; /* fix controller not sync problem*/ + /* for keyboard */ + u8 pressed_keycode; /* initialize as 0*/ + u8 pressed_shiftmask; /* initialize as 0*/ + /* for decode */ + u8 buf[IRCTL_BUF_LIMIT]; + unsigned int buf_count; /* init as 0, reset 0 after decode*/ + unsigned int cur_buf_num; /* init as 0, set as 0 while clean*/ + /* for study */ +#define ST_STUDY_NONE 0x0 +#define ST_STUDY_START 0x01 +#define ST_STUDY_CARRIER 0x02 +#define ST_STUDY_ALL_RECV 0x04 + u8 study_state; + /* carrier period = 1 / frequency */ + unsigned int carrier; + wait_queue_head_t queue; +}; + +extern unsigned int usb_kbd_keycode[256]; + +#endif diff --git a/app-misc/lirc/files/lirc_wb677_main.c b/app-misc/lirc/files/lirc_wb677_main.c new file mode 100755 index 0000000..946f852 --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677_main.c @@ -0,0 +1,1717 @@ +#define _GNU_SOURCE +#include "lirc_wb677.h" +#include "lirc_wb677_mouse_kbd.h" +#include "wb83677hg_ir.h" + +struct irctl w83667hg_irctl; + +/* chip id string, at most 7 characters */ +char *chip_id = "w677hga"; + + + + +/* enter extended function mode */ +static inline void cr_enter_ext(void) +{ + outb(0x87, CFG_idx); + outb(0x87, CFG_idx); + + if (0xff == cr_read(0x20)) { + CFG_idx = cr_cfg_idx2; + CFG_dat = cr_cfg_dat2; + outb(0x87, CFG_idx); + outb(0x87, CFG_idx); + } +} + + +/* exit extended function mode */ +static inline void cr_exit_ext(void) +{ + outb(0xaa, CFG_idx); +} + +/* select logical device */ +static inline void cr_select_log_dev(int cr) +{ + outb(0x07, CFG_idx); + outb(cr, CFG_dat); +} + +static inline void cr_update(int dat, int cr) +{ + outb(cr, CFG_idx); + outb(dat, CFG_dat); +} + +static inline u8 cr_read(int cr) +{ + outb(cr, CFG_idx); + return inb(CFG_dat); +} + +static inline void cr_safe_update(u8 dat, int cr) +{ + cr_update(cr_read(cr) | dat, cr); +} + +static inline void cr_safe_clear(u8 dat, int cr) +{ + cr_update(cr_read(cr) & dat, cr); +} + + +/* read/write cir registers */ + +static inline void cir_update(u8 dat, int cir) +{ + outb(dat, cir_address + (cir & 0xff)); +} + +static u8 cir_read(int cir) +{ + u8 val; + + val = inb(cir_address + (cir & 0xff)); + + return val; +} + +static inline void cir_wake_update(u8 dat, int cir) +{ + + outb(dat, cir_wake_address + (cir & 0xff)); + +} + +static u8 cir_wake_read(int cir) +{ + u8 val; + + val = inb(cir_wake_address + (cir & 0xff)); + + return val; +} + +static void cir_dump_reg(void) +{ + cr_enter_ext(); + printk("Dump CIR CR logical device:\n"); + cr_select_log_dev(CIR_LOG_DEV); + printk("CR CIR ACTIVE : 0x%x\n", cr_read(0x30)); + printk("CR CIR BASE ADDR: 0x%x\n", (cr_read(0x61) << 8)|cr_read(0x60)); + printk("CR CIR IRQ NUM: 0x%x\n", cr_read(0x70)); + cr_exit_ext(); + + printk("Dump CIR Registers\n"); + printk("CIR IRCON: 0x%x\n", cir_read(CIR_IRCON)); + printk("CIR IRSTS: 0x%x\n", cir_read(CIR_IRSTS)); + printk("CIR IREN: 0x%x\n", cir_read(CIR_IREN)); + printk("CIR RXFCONT: 0x%x\n", cir_read(CIR_RXFCONT)); + printk("CIR CP: 0x%x\n", cir_read(CIR_CP)); + printk("CIR CC: 0x%x\n", cir_read(CIR_CC)); + printk("CIR SLCH: 0x%x\n", cir_read(CIR_SLCH)); + printk("CIR SLCL: 0x%x\n", cir_read(CIR_SLCL)); + printk("CIR FIFOCON: 0x%x\n", cir_read(CIR_FIFOCON)); + printk("CIR IRFIFOSTS: 0x%x\n", cir_read(CIR_IRFIFOSTS)); + printk("CIR SRXFIFO: 0x%x\n", cir_read(CIR_SRXFIFO)); + printk("CIR TXFCONT: 0x%x\n", cir_read(CIR_TXFCONT)); + printk("CIR STXFIFO: 0x%x\n", cir_read(CIR_STXFIFO)); + printk("CIR FCCH: 0x%x\n", cir_read(CIR_FCCH)); + printk("CIR FCCL: 0x%x\n", cir_read(CIR_FCCL)); + printk("CIR IRFSM: 0x%x\n", cir_read(CIR_IRFSM)); + +} + +static void cir_wake_dump_reg(void) +{ + u8 i = 0; + + cr_enter_ext(); + printk("Dump CIR WKAE CR logical device:\n"); + cr_select_log_dev(CIR_WAKE_LOG_DEV); + printk("CR CIR WAKE ACTIVE : 0x%x \n", cr_read(0x30)); + printk("CR CIR WAKE BASE ADDR: 0x%x\n", (cr_read(0x61) << 8)|cr_read(0x60)); + printk("CR CIR WAKE IRQ NUM: 0x%x\n", cr_read(0x70)); + cr_exit_ext(); + + printk("Dump CIR WAKE Registers\n"); + printk("CIR WAKE IRCON: 0x%x\n", cir_wake_read(CIR_WAKE_IRCON)); + printk("CIR IRSTS: 0x%x\n", cir_wake_read(CIR_WAKE_IRSTS)); + printk("CIR IREN: 0x%x\n", cir_wake_read(CIR_WAKE_IREN)); + printk("CIR WAKE FIFO CMP DEEP: 0x%x\n", cir_wake_read(CIR_WAKE_FIFO_CMP_DEEP)); + printk("CIR WAKE FIFO CMP TOL: 0x%x\n", cir_wake_read(CIR_WAKE_FIFO_CMP_TOL)); + printk("CIR WAKE FIFO COUNT: 0x%x\n", cir_wake_read(CIR_WAKE_FIFO_COUNT)); + printk("CIR WAKE SLCH: 0x%x\n", cir_wake_read(CIR_WAKE_SLCH)); + printk("CIR WAKE SLCL: 0x%x\n", cir_wake_read(CIR_WAKE_SLCL)); + printk("CIR WAKE FIFOCON: 0x%x\n", cir_wake_read(CIR_WAKE_FIFOCON)); + printk("CIR WAKE SRXFSTS: 0x%x\n", cir_wake_read(CIR_WAKE_SRXFSTS)); + printk("CIR WAKE SAMPLE RX FIFO: 0x%x\n", cir_wake_read(CIR_WAKE_SAMPLE_RX_FIFO)); + printk("CIR WAKE WR FIFO DATA: 0x%x\n", cir_wake_read(CIR_WAKE_WR_FIFO_DATA)); + printk("CIR WAKE RD FIFO ONLY: 0x%x\n", cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); + printk("CIR WAKE RD FIFO ONLY IDX: 0x%x\n", cir_wake_read(CIR_WAKE_RD_FIFO_ONLY_IDX)); + printk("CIR WAKE FIFO IGNORE: 0x%x\n", cir_wake_read(CIR_WAKE_FIFO_IGNORE)); + printk("CIR WAKE IRFSM: 0x%x\n", cir_wake_read(CIR_WAKE_IRFSM)); + + printk("Dump CIR WAKE keys\n"); + printk("%s FIFO count len = %d\n", DRVNAME, cir_wake_read(CIR_WAKE_FIFO_COUNT)); + i = 0; + for (; i < 67; i++) { + printk("%s FIFO = 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); + } + +} + + +/* 1. */ +/* 677HG Config Registers init */ +static int w83667hg_cr_init(void) +{ + int val = 0; + + cr_enter_ext(); + + /* Check 677 CHIP ID first */ + val = cr_read(CHIP_ID_HIGH_ADDR); + if (val != CHIP_ID_HIGH) { + printk("%s %s: chip id high: 0x%x expect:0x%x\n", DRVNAME, chip_id, val, CHIP_ID_HIGH); + /*// cr_exit_ext(); + // return -ENODEV;*/ + } + else{ + printk("%s %s: chip id high: 0x%x\n", DRVNAME, chip_id, val); + } + + /* now check chip id, LSB */ + val = cr_read(CHIP_ID_LOW_ADDR); + if (CHIP_ID_LOW == (val & CHIP_ID_LOW)) { + printk("%s %s: chip id low: 0x%x expect:0x%x\n", DRVNAME, chip_id, val, CHIP_ID_LOW); + /*// cr_exit_ext(); + // return -ENODEV;*/ + } else{ + printk("%s %s: chip id low: 0x%x\n", DRVNAME, chip_id, val); + } + + /* for multi-function pin selection */ + val = cr_read(0x27); + val = (val&0xbc) | 0x41; + cr_update(val, 0x27); /*For W83677, CIR TX,RX, CIRWB pin selection*/ + + + + /* FIXME*/ + /* set Logical Dev 1: LPT */ + /* not sure really need it or not, find it in 667 wake up windows driver */ + cr_select_log_dev(0x01); + cr_update(DEACTIVE_LOG_DEV, 0x30); + cr_update(0, 0x70); + + /* Then set Logical Dev 6: CIR */ + cr_select_log_dev(CIR_LOG_DEV); + cr_update(ACTIVE_LOG_DEV, 0x30); + + cir_address = CIR_BASE; + cr_update(((CIR_BASE & 0xff00) >> 8), 0x60); + cr_update((CIR_BASE & 0xff), 0x61); +#ifdef IR_667_DEBUG + printk("%s base io port address: 0x%x\n", DRVNAME, cir_address); +#endif + + cr_update(CIR_IRQ_NUM, 0x70); +#ifdef IR_667_DEBUG + printk("%s irq number: %d\n", DRVNAME, CIR_IRQ_NUM); +#endif + + + /* Then set Logical Dev A: ACPI */ + cr_select_log_dev(ACPI_LOG_DEV); + + cr_update(ACTIVE_LOG_DEV, 0x30); + + /* enable cir wake up via PSOUT# (pin 60) */ + cr_safe_update(ENABLE_CIR_WAKE, 0xe0); + + /* enable cir interrupt of mouse IRQ event */ + /*//cr_safe_update(ENABLE_CIR_INTR_OF_MOUSE_IRQ, 0xf6);*/ + + /* enable pme interrupt of cir password event */ + /*//cr_safe_update(ENABLE_PME_INTR_OF_CIR_PASS, 0xf7);*/ + + + /* Then set Logical Dev E: CIR WAKE */ + cr_select_log_dev(CIR_WAKE_LOG_DEV); + cr_update(ACTIVE_LOG_DEV, 0x30); + + cir_wake_address = CIR_WAKE_BASE; + cr_update(((CIR_WAKE_BASE & 0xff00) >> 8), 0x60); + cr_update((CIR_WAKE_BASE & 0xff), 0x61); +#ifdef IR_667_DEBUG + printk("%s cir wake up base io port address: 0x%x\n", DRVNAME, cir_wake_address); +#endif + +#ifdef ENABLE_CIR_WAKE_IRQ + cr_update(CIR_WAKE_IRQ_NUM, 0x70); +#ifdef IR_667_DEBUG + printk("%s cir wake up irq number: %d\n", DRVNAME, CIR_WAKE_IRQ_NUM); +#endif +#endif + + cr_exit_ext(); + + return 0; +} + +static void w83667hg_cr_uninit(void) +{ + cr_enter_ext(); + + /* close CIR */ + /* Don't close CIR Wake. When wake-up at power-on, it needs the function. 20091224 + cr_select_log_dev(CIR_WAKE_LOG_DEV); + cr_update(DEACTIVE_LOG_DEV, 0x30); + */ + + + /* Close Logical Dev A: ACPI */ + /*//cr_select_log_dev(ACPI_LOG_DEV);*/ + + /* enable cir wake up via PSOUT# (pin 60) */ + /*//cr_safe_clear(DISABLE_CIR_WAKE, 0xe0);*/ + + /* enable cir interrupt of mouse IRQ event */ + /*//cr_safe_clear(DISABLE_CIR_INTR_OF_MOUSE_IRQ, 0xf6);*/ + + /* enable pme interrupt of cir password event */ + /*//cr_safe_clear(DISABLE_PME_INTR_OF_CIR_PASS, 0xf7);*/ + + + /* close CIR wake up XXX */ + /*//cr_select_log_dev(CIR_WAKE_LOG_DEV); + //cr_update(DEACTIVE_LOG_DEV, 0x30);*/ + + cr_exit_ext(); +} + +static int w83667hg_input_open(struct input_dev *cur_input_dev) +{ + return 0; +} + +static void w83667hg_input_close(struct input_dev *cur_input_dev) +{ +} + +/* 2. */ +/* init linux input structure */ +static struct input_dev *w83667hg_input_init(void) +{ + int i; + struct input_dev *cur_input_dev = NULL; + + cur_input_dev = input_allocate_device(); + if (NULL == cur_input_dev) { + printk("alloc input device error\n"); + return NULL; + } + + cur_input_dev->name = INPUTNAME; + cur_input_dev->phys = DRVNAME; + memcpy(&cur_input_dev->id, &w83667hg_input_id, sizeof(struct input_id)); + + cur_input_dev->open = w83667hg_input_open; + cur_input_dev->close = w83667hg_input_close; + + /*//cur_input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); + //cur_input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);*/ + cur_input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + cur_input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); + for (i = 0; i < 256; i++) { + set_bit(usb_kbd_keycode[i], cur_input_dev->keybit); + } + clear_bit(0, cur_input_dev->keybit); +/*// cur_input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);*/ + cur_input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT); + + + if (input_register_device(cur_input_dev)) { + printk("register input device error\n"); + return NULL; + } + + return cur_input_dev; +} + +static void w83667hg_input_uninit(struct input_dev *cur_input_dev) +{ + input_get_device(cur_input_dev); + input_unregister_device(cur_input_dev); + input_free_device(cur_input_dev); + cur_input_dev = NULL; +} + + +/* internal call for register lirc */ +static int lirc_set_use_inc(void *data) +{ + struct irctl *ir = data; + + if (!ir) { + printk("%s: set_use_inc called with no context\n", DRVNAME); + return -EIO; + } +#ifdef IR_667_DEBUG + printk("%s : set use inc\n", DRVNAME); +#endif + spin_lock(&ir->lock); + ir->ctrl_fix_head = 1; + spin_unlock(&ir->lock); + + + MOD_INC_USE_COUNT; + + return 0; +} + +static void lirc_set_use_dec(void *data) +{ + struct irctl *ir = data; + + if (!ir) { + printk("%s: set_use_dec called with no context\n", DRVNAME); + return; + } +#ifdef IR_667_DEBUG + printk("%s : set use dec\n", DRVNAME); +#endif + + MOD_DEC_USE_COUNT; +} + + +static int lirc_ioctl(struct inode *node, struct file *filep, unsigned int cmd, unsigned long arg) +{ + int ret = 0; + void __user *uptr = (void __user *)arg; + + int mode = 0; + struct irctl *ir = &w83667hg_irctl; + struct ir_recv_t *ir_recv = &w83667hg_ir_recv; + +#ifdef ALLOW_DEBUG_IOCTL + printk("%s: IO Ctrl Code:%d\n", DRVNAME, cmd); +#endif + + switch (cmd) { + /* lirc ioctl commands */ + case LIRC_GET_FEATURES: + ret = put_user(w83667hg_lirc_plugin->features, (unsigned long *)arg); + break; + case LIRC_GET_SEND_MODE: + if (!(w83667hg_lirc_plugin->features & LIRC_CAN_REC_MASK)) + return -ENOSYS; + + ret = put_user(LIRC_REC2MODE + (w83667hg_lirc_plugin->features & LIRC_CAN_REC_MASK), + (unsigned long *)arg); + if (ret) + return ret; + break; + case LIRC_SET_SEND_MODE: + ret = get_user(mode, (unsigned long *)arg); + if (ret) + return ret; + if (mode != (LIRC_MODE_PULSE&LIRC_CAN_SEND_MASK)) + return -EINVAL; + break; + case LIRC_GET_LENGTH: + ret = put_user((unsigned long)w83667hg_lirc_plugin->code_length, + (unsigned long *)arg); + break; + + /* ioctl commands for lirc_wb667 */ + case IR_DUMPCIRREG: + cir_dump_reg(); + break; + case IR_DUMPWAKEREG: + cir_wake_dump_reg(); + break; + case IR_IOLEARNWAKE: + spin_lock(&ir_recv->lock); + if (ir_recv->wake_state) { + spin_unlock(&ir_recv->lock); + ret = -EFAULT; + break; + } + ir_recv->wake_state = ST_WAKE_START; + spin_unlock(&ir_recv->lock); + + /* close cir first */ + cr_enter_ext(); + cr_select_log_dev(CIR_LOG_DEV); + cr_update(DEACTIVE_LOG_DEV, 0x30); + cr_exit_ext(); + /*//cir_update(0, CIR_IREN);*/ + cir_update(0xff, CIR_IRSTS); + + /* set cir wake */ + cir_wake_update(CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); + cir_wake_update(0xff, CIR_WAKE_IRSTS); + cir_wake_update(0xff, CIR_WAKE_FIFOCON); + cir_wake_update(0, CIR_WAKE_FIFOCON); +#ifdef ALLOW_DEBUG_WAKE + printk("%s FIFO count len = %d\n", DRVNAME, cir_wake_read(CIR_WAKE_FIFO_COUNT)); +#endif + cir_wake_update(CIR_WAKE_IREN_PE, CIR_WAKE_IREN); + + wait_event(ir_recv->queue, ir_recv->wake_state == ST_WAKE_FINISH); + while ((cir_wake_read(CIR_WAKE_RD_FIFO_ONLY_IDX)) != 0) { +#ifdef ALLOW_DEBUG_WAKE + printk("%s setting wake up key: 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); +#else + cir_wake_read(CIR_WAKE_RD_FIFO_ONLY); +#endif + } + + /* learn wake up complete */ + spin_lock(&ir_recv->lock); + ir_recv->wake_state = ST_WAKE_NONE; + spin_unlock(&ir_recv->lock); + +#ifdef ALLOW_DEBUG_WAKE + ret = 0; + for (; ret < 67; ret++) { + printk("%s FIFO count = 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); + } + printk("%s FIFO count len = %d\n", DRVNAME, cir_wake_read(CIR_WAKE_FIFO_COUNT)); +#endif + + /* cir wake interrupt stop, resume cir */ + cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); + cir_wake_update(0xff, CIR_WAKE_IRSTS); + cir_wake_update(0, CIR_WAKE_IREN); + cr_enter_ext(); + cr_select_log_dev(CIR_LOG_DEV); + cr_update(ACTIVE_LOG_DEV, 0x30); + cr_exit_ext(); + ret = 0; + + break; + case IR_IOUNSETWAKE: + cir_wake_update(0, CIR_WAKE_IRCON); + cir_wake_update(0, CIR_WAKE_IREN); + cir_wake_update(0xFF, CIR_WAKE_IRSTS); + cir_wake_update(0, CIR_WAKE_IRSTS); + cr_enter_ext(); + cr_select_log_dev(CIR_WAKE_LOG_DEV); + cr_update(DEACTIVE_LOG_DEV, 0x30); + cr_exit_ext(); + /*//cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON);*/ + break; + case IR_IOSETWAKE: + cr_enter_ext(); + cr_select_log_dev(CIR_WAKE_LOG_DEV); + cr_update(ACTIVE_LOG_DEV, 0x30); + cr_exit_ext(); + cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); + cir_wake_update(0xFF, CIR_WAKE_IRSTS); + cir_wake_update(0, CIR_WAKE_IRSTS); + cir_wake_update(0, CIR_WAKE_IREN); + break; + case IR_IOCLEANDATA: + w83667hg_clean_data(&w83667hg_ir_recv, &w83667hg_irctl); + break; + case IR_IOSTARTSTUDY: + spin_lock(&ir->lock); + ir->study_state = ST_STUDY_START; + spin_unlock(&ir->lock); + /*//cir_update(cir_read(CIR_IRCON) | CIR_IRCON_WIREN, CIR_IRCON);*/ + cir_update(CIR_IRCON_WIREN | CIR_IRCON_RXEN | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); + +/* for WRX RTR + cir_update(CIR_FIFOCON_RX_TRIGGER_LEV_8, CIR_FIFOCON); + //cir_update(CIR_IREN_RTR, CIR_IREN); + cir_update(0, CIR_IREN); +*/ + break; + case IR_IOSTOPSTUDY: + cir_update(CIR_IRCON_TXEN | CIR_IRCON_RXEN | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); + spin_lock(&ir->lock); + ir->study_state = ST_STUDY_NONE; + ir->buf_count = 0; + ir->cur_buf_num = 0; + wake_up(&ir->queue); + spin_unlock(&ir->lock); + break; + case IR_IOGETCARRIER: + spin_lock(&ir->lock); + if (!(ir->study_state > ST_STUDY_NONE)) { + ret = -EFAULT; + spin_unlock(&ir->lock); + break; + } + /*//w83667hg_record_study_carrier(ir);*/ +#ifdef ALLOW_DEBUG_IOCTL + printk("%s: current get carrier: %d\n", DRVNAME, ir->carrier); +#endif + if (copy_to_user(uptr, &ir->carrier, sizeof(unsigned int))) { + ret = -EFAULT; + } + spin_unlock(&ir->lock); + break; + case IR_IOSETCARRIER: + spin_lock(&ir->lock); + /* you can set carrier at any time */ + /* + if (~(ir->send_state)) { + ret = -EFAULT; + up(&ir->lock); + break; + } + */ + if (copy_from_user(&ir->carrier, uptr, sizeof(unsigned int))) { + ret = -EFAULT; + spin_unlock(&ir->lock); + break; + } +#ifdef ALLOW_DEBUG_IOCTL + printk("%s: current set carrier: %x\n", DRVNAME, ir->carrier); +#endif + w83667hg_set_carrier(&ir->carrier); + spin_unlock(&ir->lock); + break; + case IR_IOSTUDYLEN: + spin_lock(&ir->lock); + if (ir->study_state == ST_STUDY_NONE) { + spin_unlock(&ir->lock); +#ifdef ALLOW_DEBUG_IOCTL + printk("%s: open STUDY first\n", DRVNAME); +#endif + ret = -EFAULT; + break; + } + ir->study_state = ST_STUDY_START; + spin_unlock(&ir->lock); + wait_event(ir->queue, ir->study_state == ST_STUDY_ALL_RECV); + spin_lock(&ir->lock); + + /* in STUDY, copy data buf len to user space for read() */ + ir->cur_buf_num = 0; + if (ir->buf_count == 0) { + ret = -EFAULT; + } else if (copy_to_user(uptr, &ir->buf_count, sizeof(unsigned int))) { + ret = -EFAULT; + } + /* copy data to lirc plugin buffer, ready copy to user space */ + spin_unlock(&ir->lock); + break; + case IR_IOSTUDYBUF: + spin_lock(&ir->lock); + if (ir->study_state != ST_STUDY_ALL_RECV) { + spin_unlock(&ir->lock); + ret = -EFAULT; + break; + } + if (copy_to_user(uptr, &ir->buf[ir->cur_buf_num], sizeof(unsigned char))) { + spin_unlock(&ir->lock); + ret = -EFAULT; + break; + } + if (ir->cur_buf_num < ir->buf_count) { + ir->cur_buf_num++; + } + spin_unlock(&ir->lock); + break; + case IR_IORESTUDYBUF: + spin_lock(&ir->lock); + ir->cur_buf_num = 0; + spin_unlock(&ir->lock); + break; + case IR_CHECKCHIP: + if (copy_to_user(uptr, chip_id, sizeof(unsigned long long))) { + ret = -EFAULT; + } + break; + default: + return -ENOIOCTLCMD; + } + + return ret; +} + +static int w83667hg_set_carrier(unsigned int *carrier) +{ + u16 val; + + cir_update(1, CIR_CP); + val = 3000000 / (*carrier) - 1; + cir_update(val & 0xff, CIR_CC); + +#ifdef ALLOW_DEBUG_STUDY + printk("cp: 0x%x cc: 0x%x\n", cir_read(CIR_CP), cir_read(CIR_CC)); +#endif + return 0; +} + +static ssize_t lirc_write(struct file *file, const char *buf, size_t n, loff_t * ppos) +{ + size_t cur_count; + struct ir_send_t *ir_send = &w83667hg_ir_send; + unsigned int i; + ssize_t ret; + + spin_lock(&ir_send->lock); + + if (n >= IRCTL_BUF_LIMIT) { + ir_send->buf_count = cur_count = IRCTL_BUF_LIMIT; + ret = IRCTL_BUF_LIMIT; + } else { + ir_send->buf_count = cur_count = n; + ret = n; + } + + /* the first copy from user and open interrupt for TX */ + if (copy_from_user(ir_send->buf, buf, ir_send->buf_count)) { + ir_send->buf_count = 0; + spin_unlock(&ir_send->lock); + return -EFAULT; + } + + ir_send->cur_buf_num = 0; + + /* for safety, close RX while TX */ + cir_update(CIR_IREN_TFU | CIR_IREN_TTR, CIR_IREN); + + ir_send->send_state = ST_SEND_REPLY; + + cir_update(CIR_FIFOCON_TX_TRIGGER_LEV_8 | CIR_FIFOCON_RXFIFOCLR, CIR_FIFOCON); + /* turn on TTR interrupt, it's ugly */ + i = 0; + for (; i < 9; i++) { + cir_update(0x01, CIR_STXFIFO); + } + spin_unlock(&ir_send->lock); + + wait_event(ir_send->queue, ir_send->send_state == ST_SEND_REQUEST); + + spin_lock(&ir_send->lock); + ir_send->send_state = ST_SEND_NONE; + spin_unlock(&ir_send->lock); + + cir_update(CIR_IREN_RDR | CIR_IREN_PE, CIR_IREN); + + return ret; +} + +static void w83667hg_clean_data(struct ir_recv_t *ir_recv, struct irctl *ir) +{ + spin_lock(&ir_recv->lock); + ir_recv->buf_count = 0; + /*//ir_recv->wake_state = ST_WAKE_NONE;*/ + wake_up(&ir_recv->queue); + spin_unlock(&ir_recv->lock); + + spin_lock(&ir->lock); + ir->lircdata = 0; + /* + for (i = 0; i < IRCTL_BUF_LIMIT; i++) { + ir->buf = 0; + } + */ + ir->pressed_keycode = 0; + ir->pressed_shiftmask = 0; + ir->buf_count = 0; + ir->cur_buf_num = 0; + /* + ir->study_state = ST_STUDY_NONE; + ir->send_state = ST_SEND_NONE; + */ + wake_up(&ir->queue); + spin_unlock(&ir->lock); + + cir_update(cir_read(CIR_FIFOCON) | 0x88, CIR_FIFOCON); + cir_wake_update(cir_wake_read(CIR_WAKE_FIFOCON) | 0x8, CIR_WAKE_FIFOCON); + +} + +/* 3. */ +static void w83667hg_ir_recv_init(struct ir_recv_t *ir_recv) +{ + ir_recv->buf_count = 0; + spin_lock_init(&ir_recv->lock); + ir_recv->wake_state = ST_WAKE_NONE; + init_waitqueue_head(&ir_recv->queue); + ir_recv->recv_state = ST_RECV_WAIT_7F; +} + +static void w83667hg_ir_send_init(struct ir_send_t *ir_send) +{ + ir_send->buf_count = 0; + spin_lock_init(&ir_send->lock); + ir_send->send_state = ST_SEND_NONE; + init_waitqueue_head(&ir_send->queue); +} + + +/* lirc_fops + * + * 1) it's LIRC's fops, so NOT allow add owner in it + * 2) define lirc functions at here will replace the lirc original fops functions, so lirc_write() in lirc_dev will not work + * 3) lirc has its own ioctl, lirc_ioctl() in current file not register in lirc_fops, so it only work for lirc_wb667 + * lirc_ioctl() in current file register in w83667hg_irctl_init() as lirc_plugin's ioctl while initial driver, and it does not effect on lirc_dev + */ +static struct file_operations lirc_fops = { + write: lirc_write, + ioctl : lirc_ioctl, +}; + + +/* init lirc buffer, register, irctl */ +static int w83667hg_irctl_init(struct irctl *ir) +{ + int err = 0, minor = -1; + + w83667hg_lirc_buffer = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL); + if (!w83667hg_lirc_buffer) { + err = -ENOMEM; + goto out_lirc_buffer; + } + memset(w83667hg_lirc_buffer, 0, sizeof(struct lirc_buffer)); + + if (lirc_buffer_init(w83667hg_lirc_buffer, sizeof(lirc_t), LIRCBUF_SIZE)) { + err = -ENOMEM; + goto out_lirc_buffer; + } + + w83667hg_lirc_plugin = kmalloc(sizeof(struct lirc_driver), GFP_KERNEL); + if (!w83667hg_lirc_plugin) { + err = -ENOMEM; + goto out_lirc_plugin; + } + memset(w83667hg_lirc_plugin, 0, sizeof(struct lirc_driver)); + + ir->lirc_plugin = w83667hg_lirc_plugin; + + strcpy(w83667hg_lirc_plugin->name, DRVNAME); + w83667hg_lirc_plugin->minor = -1; + w83667hg_lirc_plugin->features = LIRC_CAN_SEND_PULSE | + LIRC_CAN_SET_TRANSMITTER_MASK | + LIRC_CAN_REC_MODE2; + /*// LIRC_CAN_SET_SEND_DUTY_CYCLE | + // LIRC_CAN_SET_SEND_CARRIER;*/ + w83667hg_lirc_plugin->data = &w83667hg_irctl; + w83667hg_lirc_plugin->rbuf = w83667hg_lirc_buffer; + w83667hg_lirc_plugin->set_use_inc = &lirc_set_use_inc; + w83667hg_lirc_plugin->set_use_dec = &lirc_set_use_dec; + w83667hg_lirc_plugin->code_length = sizeof(lirc_t) * 8; +/*// w83667hg_lirc_plugin->ioctl = lirc_ioctl;*/ + w83667hg_lirc_plugin->fops = &lirc_fops; + w83667hg_lirc_plugin->dev = NULL; + w83667hg_lirc_plugin->owner = THIS_MODULE; + + minor = lirc_register_driver(w83667hg_lirc_plugin); + if (minor < 0) { + err = -ENOMEM; + goto out_lirc_plugin_register; + } +#ifdef IR_667_DEBUG + printk("%s register lirc minor: %d\n", DRVNAME, minor); +#endif + + w83667hg_lirc_plugin->minor = minor; + ir->lirc_plugin = w83667hg_lirc_plugin; + + /* init irctl */ + ir->pressed_keycode = 0; + ir->pressed_shiftmask = 0; + ir->buf_count = 0; + ir->ctrl_fix_head = 1; + spin_lock_init(&ir->lock); + ir->study_state = ST_STUDY_NONE; + init_waitqueue_head(&ir->queue); + + goto out; + + out_lirc_plugin_register: + kfree(w83667hg_lirc_plugin); + out_lirc_plugin: + lirc_buffer_free(w83667hg_lirc_buffer); + out_lirc_buffer: + kfree(w83667hg_lirc_buffer); + out: + return err; +} + +static void w83667hg_irctl_uninit(struct irctl *ir) +{ + /*//lirc_unregister_plugin(w83667hg_lirc_plugin->minor);*/ + lirc_unregister_driver(w83667hg_lirc_plugin->minor); + kfree(w83667hg_lirc_plugin); + ir->lirc_plugin = NULL; + lirc_buffer_free(w83667hg_lirc_buffer); + kfree(w83667hg_lirc_buffer); + ir->lirc_buffer = NULL; +} + +#ifdef ALLOW_DEBUG_PRINT_PULSE +void debug_print_pulse(void) +{ + u8 count, i; + + count = cir_read(CIR_RXFCONT); + for (i = 0; i < count; i++) { + printk("%s current cir pluse: 0x%x\n", DRVNAME, cir_read(CIR_SRXFIFO)); + } +} + +void debug_print_wake_pulse(void) +{ + u8 count, i; + + count = cir_wake_read(CIR_WAKE_FIFO_COUNT); + for (i = 0; i < count; i++) { + printk("%s current cir wake pluse: 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_SRXFSTS)); + } +} +#endif + +static void w83667hg_study_recv(struct ir_recv_t *ir_recv, struct irctl *ir) +{ + unsigned int i = 0; + unsigned int packet_on_dur = 0; + + spin_lock(&ir_recv->lock); + ir_recv->buf[ir_recv->buf_count] = cir_read(CIR_SRXFIFO); + if (ir_recv->buf[ir_recv->buf_count] == 0x80) { + /* close interrupt now */ + /*//cir_wake_update(0, CIR_WAKE_IREN);*/ + + spin_lock(&ir->lock); + + /* 1. get carrier */ + ir->carrier = cir_read(CIR_FCCL); + ir->carrier |= cir_read(CIR_FCCH) << 8; + + if (ir->carrier == 0) { + printk("%s: get carrier error!\n", DRVNAME); + } + + i = 0; + for (; i < ir_recv->buf_count; i++) { + if (ir_recv->buf[i] & BIT_PULSE_MASK) { + packet_on_dur += ir_recv->buf[i] & BIT_LEN; + } + } + packet_on_dur *= MCE_TIME_UNIT; + +#ifdef ALLOW_DEBUG_STUDY + printk("%s: carrier count: 0x%x\n", DRVNAME, ir->carrier); + printk("%s: packet on duration: %u\n", DRVNAME, packet_on_dur); +#endif + ir->carrier *= 1000000; + ir->carrier /= packet_on_dur; +#ifdef ALLOW_DEBUG_STUDY + printk("%s: final carrier frequency: %u\n", DRVNAME, ir->carrier); +#endif + if ((ir->carrier > MAX_CARRIER) || (ir->carrier < MIN_CARRIER)) { + /* carrier is too large or too small */ +#ifdef ALLOW_DEBUG_STUDY + printk("%s: current received carrier is too large or too small\n", DRVNAME); +#endif + ir_recv->buf_count = 0; + spin_unlock(&ir_recv->lock); + + ir->buf_count = 0; + ir->study_state = ST_STUDY_ALL_RECV; + wake_up(&ir->queue); + spin_unlock(&ir->lock); + return; + } + + /* 2. get pulse */ + i = 0; + /* 1) find sync head */ + while (!((ir_recv->buf[i] & BIT_PULSE_MASK) & 0x80)) { + i++; + } + /* 2) find 0x7f */ + /* FIXME, the silent part of infrared signal may change by protocol or sample period. but current value fits MCE RC-6*/ + while ((ir_recv->buf[i] != 0x7f) || + (ir_recv->buf[i + 1] != 0x7f) || + (ir_recv->buf[i + 2] != 0x7f)) { + i++; + } + /* 3) find next head */ + while (!((ir_recv->buf[i] & BIT_PULSE_MASK) & 0x80)) { + i++; + } + /*//ir->buf_count = --i;*/ + /* now buf_count direct to next pulse sync head */ + ir->buf_count = i; + /* 4) copy pluse from recv to ir */ + i = 0; + for (; i <= ir->buf_count; i++) { + ir->buf[i] = ir_recv->buf[i]; + } + + + ir_recv->buf_count = 0; + spin_unlock(&ir_recv->lock); + + ir->study_state = ST_STUDY_ALL_RECV; + wake_up(&ir->queue); + spin_unlock(&ir->lock); + } else { + ir_recv->buf_count++; + spin_unlock(&ir_recv->lock); + } +} + + +static void w83667hg_recv(struct ir_recv_t *ir_recv, struct irctl *ir) +{ + u8 buf; + unsigned int i = 0, rlc = 0; + + spin_lock(&ir_recv->lock); + + ir_recv->buf[ir_recv->buf_count] = cir_read(CIR_SRXFIFO); + if (ir_recv->buf[ir_recv->buf_count] == 0x7f) { + if (ir_recv->recv_state & ST_RECV_WAIT_7F) { + ir_recv->recv_state = ST_RECV_WAIT_HEAD; + ir_recv->buf_count++; + { /* decode begin*/ + spin_lock(&ir->lock); + + ir->buf_count = ir_recv->buf_count; + for (; i < ir->buf_count; i++) { + ir->buf[i] = ir_recv->buf[i]; + } + ir->cur_buf_num = 0; + + /*//ir_recv->buf_count++;*/ + spin_unlock(&ir_recv->lock); + + i = 0; + while (i < ir->buf_count) { + rlc += ir->buf[i] & BIT_LEN; + i++; + } +#ifdef ALLOW_DEBUG_DECODE + printk("\n%s cur rlc len: %d\n", DRVNAME, rlc); +#endif + +#ifdef DECODE_KEYBOARD_MOUSE + if (rlc >= CONTROLLER_BUF_LEN_MIN) { +#endif + /* lirc controller*/ + w83667hg_submit_controller(ir); + +#ifdef DECODE_KEYBOARD_MOUSE + } else if ((rlc >= KEYBOARD_BUF_LEN_MIN) && + (rlc < KEYBOARD_BUF_LEN_MAX)) { + w83667hg_submit_key(ir); + input_sync(ir->input_dev); + } else if ((rlc >= MOUSE_BUF_LEN_MIN) && + (rlc < KEYBOARD_BUF_LEN_MIN)) { + w83667hg_submit_mouse(ir); + input_sync(ir->input_dev); + } +#endif + + ir->buf_count = 0; + spin_unlock(&ir->lock); + } /* decode end*/ + } else { + ir_recv->buf_count++; + spin_unlock(&ir_recv->lock); + } + } else { /* normal recv*/ + if (ir_recv->recv_state & ST_RECV_WAIT_HEAD) { + if (ir_recv->buf[ir_recv->buf_count] & BIT_PULSE_MASK) { + ir_recv->recv_state = ST_RECV_WAIT_7F; + buf = ir_recv->buf[ir_recv->buf_count]; + ir_recv->buf_count = 0; + ir_recv->buf[0] = buf; + } + } + ir_recv->buf_count++; + spin_unlock(&ir_recv->lock); + } +} + + + +static void w83667hg_send_packet_to_lirc_1(struct irctl *ir, lirc_t *val) +{ +#ifdef ALLOW_DEBUG_DECODE + printk("%s: send data to lirc : 0x%x\n", DRVNAME, (*val)); +#endif +/*// lirc_buffer_write_1(ir->lirc_plugin->rbuf, (char *)val);*/ + lirc_buffer_write(ir->lirc_plugin->rbuf, (char *)val); + wake_up(&ir->lirc_plugin->rbuf->wait_poll); +} + + +static void w83667hg_submit_controller(struct irctl *ir) +{ + unsigned int buf_num; + u8 bit; + + static struct timeval last_time; + static bool is_not_initialed_yet = true; /* lirc group does not allow to initialize static variable to false(0) */ + struct timeval curr_time; + long duration; + + /* silence time */ + + ir->lircdata = 0; + + if (is_not_initialed_yet == true) { + duration = MAX_SILENCE_TIME; + is_not_initialed_yet = false; + } else{ + do_gettimeofday(&curr_time); + duration = (curr_time.tv_usec - last_time.tv_usec) + + (curr_time.tv_sec - last_time.tv_sec) * 1000000; + } + + if (duration >= MAX_SILENCE_TIME) { + ir->lircdata = MAX_SILENCE_TIME; + } else{ + ir->lircdata = duration; + } + w83667hg_send_packet_to_lirc_1(ir, &ir->lircdata); + + + /* fix controller head not sync problem */ + /* lirc doesn't response DK MCE controller signal until press several times, not find same problem on M$ MCE controller keyboard */ + /* for lirc group's suggestion, we need not add these code to prevent from this problem. + Just make it as comment. If we do not get any problem report from our customer, we will remove it at next some version. + if (ir->ctrl_fix_head) { + ir->lircdata = 50000; + w83667hg_send_packet_to_lirc_1(ir, &ir->lircdata); + ir->ctrl_fix_head = 0; + } + */ + + + buf_num = 0; + bit = BIT_PULSE_MASK; + ir->lircdata = 0; + for (; buf_num < ir->buf_count; buf_num++) { + if (bit == (ir->buf[buf_num] & BIT_PULSE_MASK)) { + ir->lircdata += (ir->buf[buf_num] & BIT_LEN) * MCE_TIME_UNIT; + } else { + if (bit) { + ir->lircdata |= PULSE_BIT; + } + w83667hg_send_packet_to_lirc_1(ir, &ir->lircdata); + bit = ir->buf[buf_num] & BIT_PULSE_MASK; + ir->lircdata = (ir->buf[buf_num] & BIT_LEN) * MCE_TIME_UNIT; + } + } + + /* update last_time for measure silence time*/ + do_gettimeofday(&last_time); + + /* for final silent pulse */ + /*ir->lircdata = 50000; + w83667hg_send_packet_to_lirc_1(ir, &ir->lircdata);*/ + +#ifdef ALLOW_DEBUG_DECODE + printk("\n"); +#endif +} + +static irqreturn_t w83667hg_interrupt_handler(int irq, void *dev) +{ + u8 tmp = 0; + struct irctl *ir = (struct irctl *)dev; + struct ir_send_t *ir_send = &w83667hg_ir_send; + + + /*Because interrupt is shared, check IREN first. */ + tmp = cir_read(CIR_IREN); + if (!tmp) { + return IRQ_RETVAL(IRQ_NONE); + } + tmp = cir_read(CIR_IRSTS); + cir_update(0xff, CIR_IRSTS); + if (!tmp) { + return IRQ_NONE; + } + if (tmp & CIR_IRSTS_RDR) { + + +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_IRSTS_RDR\n"); +#endif +#ifdef ALLOW_DEBUG_PRINT_PULSE + debug_print_pulse(); +#else + spin_lock(&ir_send->lock); + if (ir_send->send_state == ST_SEND_NONE) { + spin_unlock(&ir_send->lock); + if (ir->study_state & ST_STUDY_START) { + w83667hg_study_recv(&w83667hg_ir_recv, &w83667hg_irctl); + } else { + w83667hg_recv(&w83667hg_ir_recv, &w83667hg_irctl); + } + } else { + spin_unlock(&ir_send->lock); + } +#endif + } + if (tmp & CIR_IRSTS_RTR) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_IRSTS_RTR\n"); +#endif + } + if (tmp & CIR_IRSTS_PE) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_IRSTS_PE\n"); +#endif +#ifdef ALLOW_DEBUG_PRINT_PULSE + printk("\n now get interrupt PE\n\n"); + debug_print_pulse(); +#else + if (ir->study_state == ST_STUDY_NONE) { + w83667hg_clean_data(&w83667hg_ir_recv, &w83667hg_irctl); + } +#endif + } + if (tmp & CIR_IRSTS_RFO) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_IRSTS_RFO\n"); +#endif + } + if (tmp & CIR_IRSTS_TE) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_IRSTS_TE\n"); +#endif + } + if (tmp & CIR_IRSTS_TTR) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_IRSTS_TTR\n"); +#endif + + spin_lock(&ir_send->lock); + if (ir_send->cur_buf_num < ir_send->buf_count) { + cir_update(ir_send->buf[ir_send->cur_buf_num++], CIR_STXFIFO); + } else { + cir_update(cir_read(CIR_IREN) & (~CIR_IREN_TTR), CIR_IREN); + } + spin_unlock(&ir_send->lock); + + } + if (tmp & CIR_IRSTS_TFU) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_IRSTS_TFU\n"); +#endif + spin_lock(&ir_send->lock); + if (ST_SEND_REPLY == ir_send->send_state) { + ir_send->send_state = ST_SEND_REQUEST; + wake_up(&ir_send->queue); + } + spin_unlock(&ir_send->lock); + } + if (tmp & CIR_IRSTS_GH) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_IRSTS_GH\n"); +#endif + } + + return IRQ_HANDLED; +} + +static irqreturn_t w83667hg_wake_interrupt_handler(int irq, void *dev) +{ + u8 tmp; + struct ir_recv_t *ir_recv = (struct ir_recv_t *)dev; + + + /*Because interrupt is shared, check IREN first. */ + tmp = cir_wake_read(CIR_WAKE_IREN); + if (!tmp) { + return IRQ_RETVAL(IRQ_NONE); + } + + tmp = cir_wake_read(CIR_WAKE_IRSTS); + if (!tmp) { + return IRQ_NONE; + } + cir_wake_update(0xff, CIR_WAKE_IRSTS); + + if (tmp & CIR_WAKE_IRSTS_RDR) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_WAKE_IRSTS_RDR\n"); +#endif +#ifdef ALLOW_DEBUG_PRINT_PULSE + debug_print_wake_pulse(); +#endif + } + if (tmp & CIR_WAKE_IRSTS_RTR) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_WAKE_IRSTS_RTR\n"); +#endif + } + if ((tmp & CIR_WAKE_IRSTS_PE) && + (ST_WAKE_START == ir_recv->wake_state)) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_WAKE_IRSTS_PE\n"); +#endif +#ifdef ALLOW_DEBUG_PRINT_PULSE + printk("\n now get interrupt PE\n\n"); + debug_print_wake_pulse(); +#else + while ((cir_wake_read(CIR_WAKE_RD_FIFO_ONLY_IDX)) != 0) { +#ifdef ALLOW_DEBUG_WAKE + printk("%s setting wake up key: 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); +#else + cir_wake_read(CIR_WAKE_RD_FIFO_ONLY); +#endif + } + + cir_wake_update(0, CIR_WAKE_IREN); + spin_lock(&ir_recv->lock); + ir_recv->wake_state = ST_WAKE_FINISH; + wake_up(&ir_recv->queue); + spin_unlock(&ir_recv->lock); +#endif + } + if (tmp & CIR_WAKE_IRSTS_RFO) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_WAKE_IRSTS_RFO\n"); +#endif + } + if (tmp & CIR_WAKE_IRSTS_GH) { +#ifdef ALLOW_DEBUG_INTERRUPT + printk("get CIR_WAKE_IRSTS_GH\n"); +#endif + } + + return IRQ_HANDLED; +} + +/* 4. */ +/* init 667 cir dev, req_region, req_irq */ +static int w83667hg_cir_probe(void) +{ + int err = 0; + + if (!request_region(cir_address, CIR_IOREG_LENGTH, DRVNAME)) { + err = -EBUSY; +#ifdef IR_667_DEBUG + printk("%s request 667 cir io port error! \n", DRVNAME); +#endif + goto exit; + } + + cir_update(CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); + cir_update(0xFF, CIR_IRSTS); + cir_update(CIR_RX_LIMIT_COUNT >> 8, CIR_SLCH); + cir_update(CIR_RX_LIMIT_COUNT & 0xff, CIR_SLCL); + cir_update(CIR_FIFOCON_TXFIFOCLR | CIR_FIFOCON_TX_TRIGGER_LEV_24 | CIR_FIFOCON_RXFIFOCLR, CIR_FIFOCON); + cir_update(CIR_IRCON_RECV | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); + cir_update(CIR_IRCON_TXEN | CIR_IRCON_RXEN | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); + + if (0 != request_irq(CIR_IRQ_NUM, w83667hg_interrupt_handler, IRQF_SHARED, + DRVNAME, &w83667hg_irctl)) { + err = -EINTR; +#ifdef IR_667_DEBUG + printk("%s : request cir irq error\n", DRVNAME); +#endif + goto rel_irq_exit; + } + /* open interrupt */ + cir_update(CIR_IREN_RDR | CIR_IREN_PE, CIR_IREN); + + if (!request_region(cir_wake_address, CIR_IOREG_LENGTH, DRVNAME)) { + err = -EBUSY; +#ifdef IR_667_DEBUG + printk("%s request 667 cir wake io port error! \n", DRVNAME); +#endif + goto rel_wake_exit; + } + + cir_wake_update(0xff, CIR_WAKE_IRSTS); + /* Modify it as more safe values: CIR_WAKE_FIFO_CMP_DEEP reg:0x41, + CIR_WAKE_FIFO_CMP_TOL reg: 0x05. 20091224 + */ + cir_wake_update(0x41, CIR_WAKE_FIFO_CMP_DEEP); /* 0x41 = 65 */ + cir_wake_update(0x05, CIR_WAKE_FIFO_CMP_TOL); + cir_wake_update(CIR_RX_LIMIT_COUNT >> 8, CIR_WAKE_SLCH); + cir_wake_update(CIR_RX_LIMIT_COUNT & 0xff, CIR_WAKE_SLCL); + cir_wake_update(0xff, CIR_WAKE_FIFOCON); + cir_wake_update(0, CIR_WAKE_FIFOCON); + cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); + + /* cir wake has irq_handler, open interrupt after received ioctl IR_IOLEARNWAKE */ + if (0 != request_irq(CIR_WAKE_IRQ_NUM, w83667hg_wake_interrupt_handler, IRQF_SHARED, + DRVNAME, &w83667hg_ir_recv)) { + err = -EINTR; +#ifdef IR_667_DEBUG + printk("%s : request cir wake irq error\n", DRVNAME); +#endif + goto rel_wake_irq_exit; + } + +#ifdef IR_667_DEBUG + printk("%s : init cir success\n", DRVNAME); +#endif + goto exit; + + /* error exit */ + rel_wake_irq_exit: + release_region(cir_wake_address, CIR_IOREG_LENGTH); + rel_wake_exit: + cir_update(0, CIR_IREN); + free_irq(CIR_IRQ_NUM, &w83667hg_irctl); + rel_irq_exit: + release_region(cir_address, CIR_IOREG_LENGTH); + + /* final exit */ + exit: + return err; +} + +static void w83667hg_cir_remove(void) +{ + /* Don't clean CIR_WAKE_IRCON. When wake-up at power-on, it needs the function. 20091224 + cir_wake_update(0, CIR_WAKE_IRCON); + */ + free_irq(CIR_WAKE_IRQ_NUM, &w83667hg_ir_recv); + release_region(cir_wake_address, CIR_IOREG_LENGTH); + cir_update(0, CIR_IRCON); + free_irq(CIR_IRQ_NUM, &w83667hg_irctl); + release_region(cir_address, CIR_IOREG_LENGTH); +} + +static int lirc_wb667_init(void) +{ + int err = 0; + + /* Initialise global static variables here instead of at declaration becuase of + lirc group does not allow it.*/ +#ifdef CONFIG_PNP + nopnp = 0; +#else + nopnp = 1; +#endif + w83667hg_input_dev = NULL; + w83667hg_lirc_plugin = NULL; + w83667hg_lirc_buffer = NULL; + + /* 1. init cr */ + if (w83667hg_cr_init()) { + printk("%s: Unable to init device.\n", DRVNAME); + err = -ENODEV; + goto out; + } + + /* 2. init input */ + w83667hg_input_dev = w83667hg_input_init(); + if (!w83667hg_input_dev) { + printk("%s: Unable to register input device.\n", DRVNAME); + err = -ENODEV; + goto out_input; + } + w83667hg_irctl.input_dev = w83667hg_input_dev; + + /* 3. init lirc buffer, register, irctl */ + w83667hg_ir_recv_init(&w83667hg_ir_recv); + w83667hg_ir_send_init(&w83667hg_ir_send); + err = w83667hg_irctl_init(&w83667hg_irctl); + if (err) { + printk("%s: Unable to register lirc.\n", DRVNAME); + goto out_irctl; + } + + + /* 4. init 667 cir dev, req_region, req_irq */ + err = w83667hg_cir_probe(); + if (err) { + printk("%s: Unable to probe cir device.\n", DRVNAME); + goto out_cir_probe; + } + + goto out; + + /* error exit */ + out_cir_probe: + w83667hg_irctl_uninit(&w83667hg_irctl); + w83667hg_irctl.input_dev = NULL; + out_irctl: + w83667hg_input_uninit(w83667hg_input_dev); + out_input: + w83667hg_cr_uninit(); + + /* final exit */ + out: + return err; +} + +void lirc_wb667_uninit(void) +{ + w83667hg_cir_remove(); + w83667hg_irctl_uninit(&w83667hg_irctl); + w83667hg_irctl.input_dev = NULL; + w83667hg_input_uninit(w83667hg_input_dev); + w83667hg_cr_uninit(); + +} + + + +/* For resume function use only. 20100119*/ +static void w83667hg_irctl_resume_reset(struct irctl *ir) +{ + /* init irctl */ + ir->pressed_keycode = 0; + ir->pressed_shiftmask = 0; + ir->buf_count = 0; + ir->ctrl_fix_head = 1; + spin_lock_init(&ir->lock); + ir->study_state = ST_STUDY_NONE; + init_waitqueue_head(&ir->queue); +} + + +/* For resume function use only. 20100119*/ +static int w83667hg_cir_resume_reset(void) +{ + int err = 0; + + cir_update(CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); + cir_update(0xFF, CIR_IRSTS); + cir_update(CIR_RX_LIMIT_COUNT >> 8, CIR_SLCH); + cir_update(CIR_RX_LIMIT_COUNT & 0xff, CIR_SLCL); + cir_update(CIR_FIFOCON_TXFIFOCLR | CIR_FIFOCON_TX_TRIGGER_LEV_24 | CIR_FIFOCON_RXFIFOCLR, CIR_FIFOCON); + cir_update(CIR_IRCON_RECV | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); + cir_update(CIR_IRCON_TXEN | CIR_IRCON_RXEN | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); + + /* open interrupt */ + cir_update(CIR_IREN_RDR | CIR_IREN_PE, CIR_IREN); + + + cir_wake_update(0xff, CIR_WAKE_IRSTS); + + cir_wake_update(0x41, CIR_WAKE_FIFO_CMP_DEEP); /* 0x41 = 65 */ + cir_wake_update(0x05, CIR_WAKE_FIFO_CMP_TOL); + cir_wake_update(CIR_RX_LIMIT_COUNT >> 8, CIR_WAKE_SLCH); + cir_wake_update(CIR_RX_LIMIT_COUNT & 0xff, CIR_WAKE_SLCL); + cir_wake_update(0xff, CIR_WAKE_FIFOCON); + cir_wake_update(0, CIR_WAKE_FIFOCON); + cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); + + +#ifdef IR_667_DEBUG + printk("%s : cir_resume_reset finish\n", DRVNAME); +#endif + + return err; +} + + +/* For resume function use only. 20100119*/ +static int lirc_wb667_resume_init(void) +{ + int err = 0; + + /* init lirc buffer */ + w83667hg_ir_recv_init(&w83667hg_ir_recv); + w83667hg_ir_send_init(&w83667hg_ir_send); + + /* reset variables in irctl, but no re-locate and no re-register 20100119*/ + w83667hg_irctl_resume_reset(&w83667hg_irctl); + + + /* init 667 cir dev */ + + w83667hg_cir_resume_reset(); + + + return err; +} + + + +#ifdef CONFIG_PNP + +/* CIR and CIR WAKE */ + +static struct pnp_driver lirc_wb667_pnp_driver = { + .name = PLATNAME, + .id_table = pnp_dev_table, + .probe = lirc_wb667_pnp_probe, + .remove = __devexit_p(lirc_wb667_pnp_remove), + .suspend = lirc_wb667_pnp_suspend, + .resume = lirc_wb667_pnp_resume, +}; + +static int __devinit lirc_wb667_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) +{ + /* CIR */ + + #ifdef IR_667_DEBUG + printk("%s receive probe\n", DRVNAME); + #endif + + if (!pnp_port_valid(dev, 0)) + return -ENODEV; + + + CIR_BASE = (unsigned int)pnp_port_start(dev, 0); + CIR_IRQ_NUM = (unsigned short)pnp_irq(dev, 0); + + + /* CIR WAKE*/ + if (!pnp_port_valid(dev, 1)) + return -ENODEV; + CIR_WAKE_BASE = (unsigned int)pnp_port_start(dev, 1); + CIR_WAKE_IRQ_NUM = (unsigned short)pnp_irq(dev, 0); /* share the same irq with CIR device.*/ + + return 0; +} + +static void __devexit lirc_wb667_pnp_remove(struct pnp_dev *dev) +{ +} + + + +static int lirc_wb667_pnp_suspend(struct pnp_dev *dev, pm_message_t state) +{ + struct irctl *ir = &w83667hg_irctl; + struct ir_recv_t *ir_recv = &w83667hg_ir_recv; + struct ir_send_t *ir_send = &w83667hg_ir_send; + +#ifdef IR_667_DEBUG + printk("%s receive suspend\n", DRVNAME); +#endif + + /* 1. */ + spin_lock(&ir->lock); + ir->study_state = ST_STUDY_NONE; + spin_unlock(&ir->lock); + + spin_lock(&ir_recv->lock); + ir_recv->wake_state = ST_WAKE_NONE; + spin_unlock(&ir_recv->lock); + + spin_lock(&ir_send->lock); + ir_send->send_state = ST_SEND_NONE; + spin_unlock(&ir_send->lock); + + /* 2. */ + cir_update(0, CIR_IREN); + cir_wake_update(0, CIR_WAKE_IREN); + + + /* 3. */ + cr_enter_ext(); + cr_select_log_dev(CIR_LOG_DEV); + cr_update(DEACTIVE_LOG_DEV, 0x30); + + /*Don't close CIR Wake. When wake-up at power-on, it needs the function. 20091224 + cr_select_log_dev(CIR_WAKE_LOG_DEV); + cr_update(DEACTIVE_LOG_DEV, 0x30); + */ + + cr_exit_ext(); + + + return 0; +} + +static int lirc_wb667_pnp_resume(struct pnp_dev *dev) +{ + int ret = 0; + +#ifdef IR_667_DEBUG + printk("%s receive resume\n", DRVNAME); +#endif + + + /* open interrupt */ + cir_update(CIR_IREN_RDR | CIR_IREN_PE, CIR_IREN); + + + /* Enable CIR logical device */ + cr_enter_ext(); + cr_select_log_dev(CIR_LOG_DEV); + cr_update(ACTIVE_LOG_DEV, 0x30); + + + /*Don't close CIR Wake. When wake-up at power-on, it needs the function. 20091224 + cr_select_log_dev(CIR_WAKE_LOG_DEV); + cr_update(ACTIVE_LOG_DEV, 0x30); + */ + cr_exit_ext(); + + /* special uninit function for resume only. 20100119 */ + lirc_wb667_resume_init(); + + return ret; +} + + + + + + +#endif + + +/*//int init_module(void)*/ +int init_module_wb667(void) +{ + int ret; + + if (nopnp) { + printk("%s does not support Non-PNP kernel now.\n", DRVNAME); + } + +#ifdef CONFIG_PNP + if (!nopnp) { + + ret = pnp_register_driver(&lirc_wb667_pnp_driver); + if (ret < 0) + return ret; + + + + } +#endif /* CONFIG_PNP */ + + + + + ret = lirc_wb667_init(); + if (ret) { + return ret; + } + + return 0; +} + +/*//void cleanup_module(void)*/ +void cleanup_module_wb667(void) +{ + +#ifdef CONFIG_PNP + if (!nopnp) { + pnp_unregister_driver(&lirc_wb667_pnp_driver); + + } +#endif /* CONFIG_PNP */ + + + lirc_wb667_uninit(); +} + +module_init(init_module_wb667); +module_exit(cleanup_module_wb667); + + diff --git a/app-misc/lirc/files/lirc_wb677_main.o b/app-misc/lirc/files/lirc_wb677_main.o Binary files differnew file mode 100644 index 0000000..705f886 --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677_main.o diff --git a/app-misc/lirc/files/lirc_wb677_mouse_kbd.c b/app-misc/lirc/files/lirc_wb677_mouse_kbd.c new file mode 100755 index 0000000..bb1bef6 --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677_mouse_kbd.c @@ -0,0 +1,881 @@ +/* Notice: + Do NOT merge this file with other file. + According to lirc group's suggestion, they hope that + we should put keyboard/mouse decoding into a separate file if we want to preserve it. +*/ + +#include <linux/input.h> +#include "lirc_wb677_common_extern.h" +#include "lirc_wb677_mouse_kbd.h" + + +void w83667hg_set_key(u8 *set_frame, u8 val, u8 *keycode, u8 *shiftmask) +{ +#ifdef ALLOW_DEBUG_DECODE + printk("%s set key: %d\n", DRVNAME, val); +#endif + + if (*set_frame <= KEY_SUBMIT_KEYCODE_FRAME_NUM + 1) { + *keycode <<= 1; + *keycode |= val; +#ifdef ALLOW_DEBUG_DECODE + printk("%s set key keycode:0x%x\n", DRVNAME, *keycode); + printk("set frame: %d\n", *set_frame); +#endif + } else { + *shiftmask <<= 1; + *shiftmask |= val; +#ifdef ALLOW_DEBUG_DECODE + printk("%s set key mask:0x%x\n", DRVNAME, *shiftmask); + printk("set frame: %d\n", *set_frame); +#endif + } + (*set_frame)++; +} + + +int w83667hg_jump_frame(struct irctl *ir, u8 frame_num, unsigned int *buf_num, u8 *out_bit, u8 *decode_status) +{ + unsigned int rlc = 0, cur_buf_num = *buf_num; + u8 bit = *out_bit, buf; + u8 cur_decode_status = *decode_status; + u8 cur_frame_num; + + cur_frame_num = 1; + for (; cur_frame_num <= frame_num; cur_buf_num++) { + buf = ir->buf[cur_buf_num]; + if (cur_buf_num > ir->buf_count) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s: jump frame error\n", DRVNAME); + printk("current buf num: %d\n", cur_buf_num); + printk("current jumped frame: %d\n", cur_frame_num); + printk("current frame length: %d\n", rlc); + printk("total cir signal:\n"); + for (cur_buf_num = 0; cur_buf_num < ir->buf_count; cur_buf_num++) { + printk("0x%x ", ir->buf[cur_buf_num]); + if (cur_buf_num % 6 == 5) { + printk("\n"); + } + } +#endif + return -1; + } + if (bit == (buf & BIT_PULSE_MASK)) { + rlc += buf & BIT_LEN; + } else { + + /* decode*/ + switch (cur_decode_status) { + case ST_DECODE_NEW: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + cur_decode_status = ST_DECODE_ONE; + } else { + cur_decode_status = ST_DECODE_ZERO; + } + } else if ((rlc > TWO_PULSE_LEN_LOW) && + (rlc < TWO_PULSE_LEN_HIGH)) { + /* error occur, just ignore */ + cur_decode_status = ST_DECODE_NEW; + cur_frame_num++; + } + break; + case ST_DECODE_ZERO: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "01" => 0 */ + cur_decode_status = ST_DECODE_NEW; + cur_frame_num++; + } else { + /* error */ + cur_decode_status = ST_DECODE_NEW; + cur_frame_num++; + } + } else if ((rlc > TWO_PULSE_LEN_LOW) && + (rlc < TWO_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "01" => 0 */ + cur_decode_status = ST_DECODE_ONE; + cur_frame_num++; + } else { + /* error */ + cur_decode_status = ST_DECODE_ZERO; + cur_frame_num++; + } + } + break; + case ST_DECODE_ONE: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "11" => error */ + cur_decode_status = ST_DECODE_NEW; + cur_frame_num++; + } else { + /* "10" => 1 */ + cur_decode_status = ST_DECODE_NEW; + cur_frame_num++; + } + } else if (rlc > TWO_PULSE_LEN_LOW) { + if (bit & BIT_PULSE_MASK) { + /* "11" => error */ + cur_decode_status = ST_DECODE_ONE; + cur_frame_num++; + } else { + /* "10" => 1 */ + cur_decode_status = ST_DECODE_ZERO; + cur_frame_num++; + } + } + break; + } /* switch*/ + + bit = buf & BIT_PULSE_MASK; + rlc = buf & BIT_LEN; + } + } /* for decode*/ + +/* + bit = ir->buf[cur_buf_num] & BIT_PULSE_MASK; + if (cur_decode_status & ST_DECODE_NEW) { + if (bit) { + *decode_status = ST_DECODE_ONE; + } else { + *decode_status = ST_DECODE_ZERO; + } + } else { + *decode_status = ST_DECODE_NEW; + } + *out_bit = bit; +*/ + + /* Fix problem 1 */ + if ((ir->buf[cur_buf_num] & BIT_LEN) > TWO_PULSE_LEN_LOW) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s: fix problem 1 in jump_frame()\n", DRVNAME); +#endif +#ifdef ALLOW_DEBUG_DECODE + if (cur_frame_num > frame_num + 1) { + printk("%s error: jump_frame() get a too long frame\n", DRVNAME); + } +#endif + cur_buf_num--; + } + + /* copy from jump_iden */ + if (cur_decode_status & ST_DECODE_NEW) { +#ifdef ALLOW_DEBUG_DECODE + printk("hey man, it's NEW in jump_frame\n"); +printk("cur buf: 0x%x\n", ir->buf[cur_buf_num]); +printk("cur state: 0x%x\n", cur_decode_status); +#endif + *buf_num = --cur_buf_num; + /*//cur_buf_num--;*/ + *out_bit = ir->buf[cur_buf_num] & BIT_PULSE_MASK; + if (*out_bit) { + *decode_status = ST_DECODE_ONE; + } else { + *decode_status = ST_DECODE_ZERO; + } + } else { +#ifdef ALLOW_DEBUG_DECODE +printk("cur buf: 0x%x\n", ir->buf[cur_buf_num]); +printk("cur state: 0x%x\n", cur_decode_status); +#endif + *buf_num = cur_buf_num; + *out_bit = ir->buf[cur_buf_num] & BIT_PULSE_MASK; + *decode_status = ST_DECODE_NEW; +/* + if (*out_bit) { + *decode_status = ST_DECODE_ONE; + } else { + *decode_status = ST_DECODE_ZERO; + } +*/ + } + + return 0; +} + +int w83667hg_jump_head(struct irctl *ir, unsigned int *buf_num) +{ + unsigned int i, rlc = 0, max_buf_count = ir->buf_count; + u8 bit = BIT_PULSE_MASK, buf; + + for (i = 0; i < max_buf_count; i++) { + buf = ir->buf[i]; + if (bit == (buf & BIT_PULSE_MASK)) { + rlc += buf & BIT_LEN; + } else { + if ((rlc > HEAD_SYNC_LEN_LOW) && + (rlc < HEAD_SYNC_LEN_HIGH) && + (bit & BIT_PULSE_MASK)) { + break; + } + bit = buf & BIT_PULSE_MASK; + rlc = buf & BIT_LEN; + } + } /* for decode*/ + + if (i >= max_buf_count) { +/*//#ifdef ALLOW_DEBUG_DECODE*/ +#if 0 + printk("%s jump pulse error\n", DRVNAME); + printk("current buf num: %d\n", *buf_num); + printk("current jumped pulse: %d\n", i); + printk("current pulse length: %d\n", rlc); + printk("total cir signal:\n"); + for (i = 0; i < max_buf_count; i++) { + printk("0x%x ", ir->buf[i]); + if (i % 6 == 5) { + printk("\n"); + } + } +#endif + return -1; + } + + *buf_num = i; + + return 0; +} + + +int w83667hg_check_identification(u8 val, u8 identification, u8 *cur_iden) +{ + *cur_iden <<= 1; + *cur_iden |= val ; +#ifdef ALLOW_DEBUG_DECODE + printk("%s current check iden recv: %d\n", DRVNAME, val); + printk("%s current iden value: 0x%x\n", DRVNAME, *cur_iden); +#endif + + if (identification == (*cur_iden & IDENTIFICATION_CHECK_BIT)) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s find identification\n\n", DRVNAME); +#endif + return 0; + } else { + return -1; + } +} + +int w83667hg_jump_identification(struct irctl *ir, u8 identification, unsigned int *buf_num, u8 *out_bit, u8 *decode_status) +{ + unsigned int rlc = 0, i = 1; + u8 bit = *out_bit, buf; + u8 cur_iden = 0; + u8 cur_decode_status = *decode_status; + + bit = BIT_PULSE_MASK; + cur_decode_status = ST_DECODE_NEW; + + for (; i < ir->buf_count; i++) { + buf = ir->buf[i]; +#ifdef ALLOW_DEBUG_DECODE +printk("buf: 0x%x\n", buf); +#endif + if (bit == (buf & BIT_PULSE_MASK)) { + rlc += buf & BIT_LEN; + } else { + /* decode*/ + switch (cur_decode_status) { + case ST_DECODE_NEW: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + cur_decode_status = ST_DECODE_ONE; + } else { + cur_decode_status = ST_DECODE_ZERO; + } + } else if ((rlc > TWO_PULSE_LEN_LOW) && + (rlc < TWO_PULSE_LEN_HIGH)) { + /* error occur, just ignore */ + cur_decode_status = ST_DECODE_NEW; + if (!w83667hg_check_identification(0, identification, &cur_iden)) { + goto find_iden; + } + } + break; + case ST_DECODE_ZERO: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "01" => 0 */ + cur_decode_status = ST_DECODE_NEW; + if (!w83667hg_check_identification(0, identification, &cur_iden)) { + goto find_iden; + } + } else { + /* error */ + cur_decode_status = ST_DECODE_NEW; + if (!w83667hg_check_identification(0, identification, &cur_iden)) { + goto find_iden; + } + } + } else if ((rlc > TWO_PULSE_LEN_LOW) && + (rlc < TWO_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "01" => 0 */ + cur_decode_status = ST_DECODE_ONE; + if (!w83667hg_check_identification(0, identification, &cur_iden)) { + goto find_iden; + } + } else { + /* error */ + cur_decode_status = ST_DECODE_ZERO; + if (!w83667hg_check_identification(0, identification, &cur_iden)) { + goto find_iden; + } + } + } + break; + case ST_DECODE_ONE: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "11" => error */ + cur_decode_status = ST_DECODE_NEW; + if (!w83667hg_check_identification(0, identification, &cur_iden)) { + goto find_iden; + } + } else { + /* "10" => 1 */ + cur_decode_status = ST_DECODE_NEW; + if (!w83667hg_check_identification(1, identification, &cur_iden)) { + goto find_iden; + } + } + } else if (rlc > TWO_PULSE_LEN_LOW) { + if (bit & BIT_PULSE_MASK) { + /* "11" => error */ + cur_decode_status = ST_DECODE_ONE; + if (!w83667hg_check_identification(0, identification, &cur_iden)) { + goto find_iden; + } + } else { + /* "10" => 1 */ + cur_decode_status = ST_DECODE_ZERO; + if (!w83667hg_check_identification(1, identification, &cur_iden)) { + goto find_iden; + } + } + } + break; + } /* switch*/ + bit = buf & BIT_PULSE_MASK; + rlc = buf & BIT_LEN; + } + } + + if (i >= ir->buf_count) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s jump iden error\n", DRVNAME); + printk("current buf num: %d\n", i); + printk("current pulse length: %d\n", rlc); + printk("total cir signal:\n"); + for (i = 0; i < ir->buf_count; i++) { + printk("0x%x ", ir->buf[i]); + if (i % 6 == 5) { + printk("\n"); + } + } +#endif + return -1; + } + + find_iden: +#ifdef ALLOW_DEBUG_DECODE + printk("current buf num after iden: %d\n", i); + printk("current pulse length: %d\n", rlc); +#endif + /* try fix problem 1 */ + if ((rlc & BIT_LEN) >= TWO_PULSE_LEN_LOW) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s fix problem 1 in jump iden\n", DRVNAME); + printk("cur pulse len: %d\n", ir->buf[i] & BIT_LEN); +#endif + *buf_num = i + 1; + *out_bit = ir->buf[i] & BIT_PULSE_MASK; + if (*out_bit) { + *decode_status = ST_DECODE_ZERO; + } else { + *decode_status = ST_DECODE_ONE; + } + + return 0; + } + + /* now find identification successful! */ + { + *buf_num = i; + i--; + *out_bit = ir->buf[i] & BIT_PULSE_MASK; + if (bit) { + *decode_status = ST_DECODE_ONE; + } else { + *decode_status = ST_DECODE_ZERO; + } + } +#ifdef ALLOW_DEBUG_DECODE + printk("total cir signal:\n"); + for (i = 0; i < ir->buf_count; i++) { + printk("0x%x ", ir->buf[i]); + if (i % 7 == 6) { + printk("\n"); + } + } + printk("\n"); +#endif + + return 0; +} + +void w83667hg_submit_key(struct irctl *ir) +{ + unsigned int rlc = 0, buf_num = 0, i; + /* current usb keyboard key code setting, usb_kbd_keycode[keycode] */ + unsigned int input_code; + u8 bit, buf; + /* keycode and shiftmask parts in mce keyboard protocol*/ + u8 keycode = 0, shiftmask = 0; + u8 decode_status; + u8 frame_num, set_frame; + + /* 1) jump head */ + if (w83667hg_jump_head(ir, &buf_num)) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s: decode key jump head error\n", DRVNAME); +#endif + return; + } +#ifdef ALLOW_DEBUG_DECODE + printk("%s buf_num after jump head: %d\n", DRVNAME, buf_num); +#endif + + /* 2) jump identification */ + if (w83667hg_jump_identification(ir, KEY_IDENTIFICATION, &buf_num, &bit, &decode_status)) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s: decode key jump identification error\n", DRVNAME); +#endif + return; + } + +#ifdef ALLOW_DEBUG_DECODE + printk("%s jump iden success\n\n", DRVNAME); + printk("%s buf_num after jump iden: %d\n", DRVNAME, buf_num); + printk("decode status: 0x%x, bit: 0x%x\n", decode_status, bit); +#endif + + /* 3) jump "unknown", "C" and "CodeSet" parts in mce keyboard signal */ + if (w83667hg_jump_frame(ir, KEY_KEYCODE_FRAME_AFTER_I_START, &buf_num, &bit, &decode_status)) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s: decode key jump pulse error\n", DRVNAME); +#endif + return; + } + +#ifdef ALLOW_DEBUG_DECODE + printk("%s buf_num after jump pulse: %d\n", DRVNAME, buf_num); + printk("decode status: 0x%x, bit: 0x%x\n", decode_status, bit); + frame_num = buf_num; + for (; frame_num < ir->buf_count; frame_num++) { + printk("0x%x\t", ir->buf[frame_num]); + if (frame_num % 7 == 6) { + printk("\n"); + } + } + printk("\n"); +#endif +#ifdef ALLOW_DEBUG_DECODE + printk("%s: decode status before check key: %x\n", DRVNAME, decode_status); +#endif + + + /* 4) deocde "KeyCode" and "ShiftMask" parts in mce key signal */ + frame_num = 1, set_frame = 1; + for (; frame_num < KEY_FRAME_AFTER_JUMP + 2; buf_num++) { + if (bit != (ir->buf[buf_num] & BIT_PULSE_MASK)) { + /* decode*/ + if (rlc > PULSE_SILENT_LEN_LOW) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s error: cir signal end before received all key pulses\n", DRVNAME); + printk("bit: %d ", bit); + printk("rlc: %d\n", rlc); + printk("current pulse number: %d\n", frame_num); +#endif + if (decode_status == ST_DECODE_ONE) { + /* must set the last one */ + w83667hg_set_key(&set_frame, 1, &keycode, &shiftmask); + } + break; + } + switch (decode_status) { + case ST_DECODE_NEW: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + decode_status = ST_DECODE_ONE; + } else { + decode_status = ST_DECODE_ZERO; + } + } else if ((rlc > TWO_PULSE_LEN_LOW) && + (rlc < TWO_PULSE_LEN_HIGH)) { + /* error occur, just ignore */ + decode_status = ST_DECODE_NEW; + w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); + frame_num += 1; + } +#ifdef ALLOW_DEBUG_DECODE + printk("%s cur state: %x\n", DRVNAME, decode_status); +#endif + break; + case ST_DECODE_ZERO: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "01" => 0 */ + decode_status = ST_DECODE_NEW; + w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); + frame_num += 1; + } else { + /* error */ + decode_status = ST_DECODE_NEW; + w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); + } + } else if ((rlc > TWO_PULSE_LEN_LOW) && + (rlc < TWO_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "01" => 0 */ + decode_status = ST_DECODE_ONE; + w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); + frame_num += 1; + } else { + /* error */ + decode_status = ST_DECODE_ZERO; + w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); + } + } +#ifdef ALLOW_DEBUG_DECODE + printk("%s cur state: %x\n", DRVNAME, decode_status); +#endif + break; + case ST_DECODE_ONE: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "11" => error */ + decode_status = ST_DECODE_NEW; + w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); + } else { + /* "10" => 1 */ + decode_status = ST_DECODE_NEW; + w83667hg_set_key(&set_frame, 1, &keycode, &shiftmask); + frame_num += 1; + } + } else if (rlc > TWO_PULSE_LEN_LOW) { + if (bit & BIT_PULSE_MASK) { + /* "11" => error */ + decode_status = ST_DECODE_ONE; + w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); + } else { + /* "10" => 1 */ + decode_status = ST_DECODE_ZERO; + w83667hg_set_key(&set_frame, 1, &keycode, &shiftmask); + frame_num += 1; + } + } +#ifdef ALLOW_DEBUG_DECODE + printk("%s cur state %x\n", DRVNAME, decode_status); +#endif + break; + } /* switch*/ + bit = ir->buf[buf_num] & BIT_PULSE_MASK; + rlc = ir->buf[buf_num] & BIT_LEN; +#ifdef ALLOW_DEBUG_DECODE + printk("%s: decode keyboard buf: 0x%x\n", DRVNAME, ir->buf[buf_num]); +#endif + + } else { + /* continue last pulse*/ + rlc += ir->buf[buf_num] & BIT_LEN; + } + + } /* for*/ + +#ifdef ALLOW_DEBUG_DECODE + printk("%s: after decode keyboard:\n", DRVNAME); + printk("keycode: 0x%x ", keycode); + printk("shiftmask: 0x%x\n\n", shiftmask); +#endif + + /* 5) submit keycode to input */ + if (keycode != ir->pressed_keycode) { + if (ir->pressed_keycode) { + input_code = (unsigned int)usb_kbd_keycode[ir->pressed_keycode]; + input_report_key(ir->input_dev, input_code, 0); + } + ir->pressed_keycode = keycode; + if (keycode) { + input_code = (unsigned int)usb_kbd_keycode[keycode]; + input_report_key(ir->input_dev, input_code, 1); + } + } + + /* 6) submit shiftmask to input */ + + if (shiftmask != ir->pressed_shiftmask) { + for (i = 0; i < 7; i++) { + buf = 1<<i; + if ((buf & ir->pressed_shiftmask) && (!(buf & shiftmask))) { + input_code = (unsigned int)usb_kbd_keycode[0xE0 + i]; + input_report_key(ir->input_dev, input_code, 0); + } else if (!(buf & ir->pressed_shiftmask) && (buf & shiftmask)) { + input_code = (unsigned int)usb_kbd_keycode[0xE0 + i]; + input_report_key(ir->input_dev, input_code, 1); + } + } /* for*/ + ir->pressed_shiftmask = shiftmask; + } +} + +void w83667hg_set_mouse(u8 *set_frame, u8 val, u8 *deltay, u8 *deltax, u8 *clickrl) +{ +#ifdef ALLOW_DEBUG_DECODE + printk("%s set mouse val:%d\n", DRVNAME, val); +#endif + if (*set_frame <= MOUSE_SUBMIT_DELTAY_FRAME_NUM + 1) { + *deltay <<= 1; + *deltay |= val; +#ifdef ALLOW_DEBUG_DECODE + printk("%s set mouse delta y:0x%x\n", DRVNAME, *deltay); +#endif + } else if (*set_frame <= MOUSE_SUBMIT_DELTAX_FRAME_NUM) { + *deltax <<= 1; + *deltax |= val; +#ifdef ALLOW_DEBUG_DECODE + printk("%s set mouse delta x:0x%x\n", DRVNAME, *deltax); +#endif + } else if (*set_frame <= MOUSE_SUBMIT_L_FRAME_NUM) { + /* move right key, then set left key */ + *clickrl <<= 1; + *clickrl |= val; +#ifdef ALLOW_DEBUG_DECODE + printk("%s set mouse l:0x%x\n", DRVNAME, *clickrl); + printk("set pulse: %d\n", *set_frame); +#endif + } + (*set_frame)++; +} + +void w83667hg_submit_mouse(struct irctl *ir) +{ + unsigned int rlc = 0, buf_num = 0; + u8 bit; + /* deltax, deltay and clickrl parts in mce mouse protocol*/ + u8 deltax = 0, deltay = 0, clickrl = 0; + signed char x, y; + u8 decode_status; + u8 frame_num, set_frame; + + /* 1) jump head */ + if (w83667hg_jump_head(ir, &buf_num)) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s: decode mouse jump head error\n", DRVNAME); +#endif + return; + } + + /* 2) jump identification */ + if (w83667hg_jump_identification(ir, MOUSE_IDENTIFICATION, &buf_num, &bit, &decode_status)) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s: decode mouse jump identification error\n", DRVNAME); +#endif + return; + } +#ifdef ALLOW_DEBUG_DECODE + printk("%s: after iden mouse:\n", DRVNAME); + printk("decode status: 0x%x, bit: 0x%x\n", decode_status, bit); + frame_num = buf_num; + for (; frame_num < ir->buf_count; frame_num++) { + printk("0x%x ", ir->buf[frame_num]); + if (frame_num % 7 == 6) { + printk("\n"); + } + } + printk("\n"); +#endif + + /* 3) jump "unknown" part in mce mouse signal */ + if (w83667hg_jump_frame(ir, MOUSE_DELTAY_PULSE_AFTER_I_START, &buf_num, &bit, &decode_status)) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s: decode mouse jump pulse error\n", DRVNAME); +#endif + return; + } +#ifdef ALLOW_DEBUG_DECODE + printk("%s: after jump pulse buf num: %d\n", DRVNAME, buf_num); + printk("decode status: 0x%x, bit: 0x%x\n", decode_status, bit); + frame_num = buf_num; + for (; frame_num < ir->buf_count; frame_num++) { + printk("0x%x ", ir->buf[frame_num]); + if (frame_num % 7 == 6) { + printk("\n"); + } + } + printk("\n"); +#endif + + /* 4) deocde "deltay", "deltax", "r" and "l" parts in mce mouse signal */ + frame_num = 1, set_frame = 1; + for (; frame_num < MOUSE_CHECKSUM_FRAME_AFTER_JUMP + 1; buf_num++) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s: cur buf: 0x%x, pulse num: %d\n", DRVNAME, ir->buf[buf_num], frame_num); + printk("decode status: 0x%x\n", decode_status); +#endif + if (bit != (ir->buf[buf_num] & BIT_PULSE_MASK)) { + /* decode*/ + if (rlc > PULSE_SILENT_LEN_LOW) { +#ifdef ALLOW_DEBUG_DECODE + printk("%s error: cir signal end before received all mouse pulses\n", DRVNAME); + printk("bit: %d ", bit); + printk("rlc: %d\n", rlc); +#endif + break; + } + switch (decode_status) { + case ST_DECODE_NEW: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + decode_status = ST_DECODE_ONE; + } else { + decode_status = ST_DECODE_ZERO; + } + } else + if ((rlc > TWO_PULSE_LEN_LOW) && + (rlc < TWO_PULSE_LEN_HIGH)) { + /* error occur, just ignore */ + decode_status = ST_DECODE_NEW; + w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); + frame_num += 1; + } + break; + case ST_DECODE_ZERO: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "01" => 0 */ + decode_status = ST_DECODE_NEW; + w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); + frame_num += 1; + } else { + /* error */ + decode_status = ST_DECODE_NEW; + w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); + } + } else if ((rlc > TWO_PULSE_LEN_LOW) && + (rlc < TWO_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "01" => 0 */ + decode_status = ST_DECODE_ONE; + w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); + frame_num += 1; + } else { + /* error */ + decode_status = ST_DECODE_ZERO; + w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); + } + } + break; + case ST_DECODE_ONE: + if ((rlc > ONE_PULSE_LEN_LOW) && + (rlc < ONE_PULSE_LEN_HIGH)) { + if (bit & BIT_PULSE_MASK) { + /* "11" => error */ + decode_status = ST_DECODE_NEW; + w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); + } else { + /* "10" => 1 */ + decode_status = ST_DECODE_NEW; + w83667hg_set_mouse(&set_frame, 1, &deltay, &deltax, &clickrl); + frame_num += 1; + } + } else if (rlc > TWO_PULSE_LEN_LOW) { + if (bit & BIT_PULSE_MASK) { + /* "11" => error */ + decode_status = ST_DECODE_ONE; + w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); + frame_num += 1; + } else { + /* "10" => 1 */ + decode_status = ST_DECODE_ZERO; + w83667hg_set_mouse(&set_frame, 1, &deltay, &deltax, &clickrl); + frame_num += 1; + } + } + break; + } /* switch*/ + bit = ir->buf[buf_num] & BIT_PULSE_MASK; + rlc = ir->buf[buf_num] & BIT_LEN; + } else { + /* continue last pulse*/ + rlc += ir->buf[buf_num] & BIT_LEN; + } + + } /* for*/ + +#ifdef ALLOW_DEBUG_DECODE + printk("%s: after decode mouse:\n", DRVNAME); + frame_num = buf_num; + for (; frame_num < ir->buf_count; frame_num++) { + printk("0x%x ", ir->buf[frame_num]); + if (frame_num % 7 == 6) { + printk("\n"); + } + } + printk("\n"); +#endif + + /* fix deltax lost problem */ + if (deltax) { + deltax <<= 1; + deltax |= 1; + } + +#ifdef ALLOW_DEBUG_DECODE + printk("%s: after decode mouse:\n", DRVNAME); + printk("deltay: 0x%x ", deltay); + printk("deltax: 0x%x ", deltax); + printk("click rl: 0x%x \n\n", clickrl); +#endif + if (deltay & 0x40) { + y = -((~deltay & 0x7f) + 1); + } else { + y = deltay; + } + if (deltax & 0x40) { + x = -((~deltax & 0x7f) + 1); + } else { + x = deltax; + } + + /* 5) send to input */ + +#ifdef ALLOW_DEBUG_DECODE + printk("%s: after decode mouse and rebuild:\n", DRVNAME); + printk("y: %d ", y); + printk("x: %d ", x); + printk("click rl: 0x%x \n\n", clickrl); +#endif + + input_report_rel(ir->input_dev, REL_X, x); + input_report_rel(ir->input_dev, REL_Y, y); + + input_report_key(ir->input_dev, BTN_LEFT, clickrl & 1); + input_report_key(ir->input_dev, BTN_RIGHT, (clickrl >> 1) & 1); +} + + diff --git a/app-misc/lirc/files/lirc_wb677_mouse_kbd.h b/app-misc/lirc/files/lirc_wb677_mouse_kbd.h new file mode 100755 index 0000000..43d09ad --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677_mouse_kbd.h @@ -0,0 +1,190 @@ +#ifndef __LIRC_WB677_MOUSE_KBD_HEADER__ +#define __LIRC_WB677_MOUSE_KBD_HEADER__ + + + + +/* jump asked frame number, can use on key, mouse and controller signals + * + * after jump frame_num, current frame number = frame_num + 1 + * record current buf number of irctl buf + * record current pulse's bit and decode_status + * + * problem 1: + * When jump_frame() stops on a two_width_len pulse, the buf_num will be the + * second pulse of the double_width_len pulse. + * So jump_frame() must increase buf_num 1 on problem 1. + * For sample period is 50us, a 444us piulse's minimal sample value is 7, and + * two piulses' minimal sample value is 15. So just increase buf_num 1 works + * fine. If sample period changes, this solution also need change. + * + * one_width_len pulse: + * _ _ + * .| |_| |_. (1010) + * ^ + * | + * stop: jumped frame_num + * + * + * problem 1: double_width_len pulse: + * __ _ + * .| |__| |. (11001) + * ^ + * | + * stop: jumped frame_num + 1, buf_num + 1 + * + * so if cur buf len > TWO_PULSE_LEN_LOW, buf_num -- + * and recheck polar bit and decode_status + * decode_status go back 1 buf, + * NEW -> ONE/ZERO; ONE/ZERO -> NEW + * + * jump out of buf limit, return < 0 + */ +int w83667hg_jump_frame(struct irctl *ir, u8 frame_num, unsigned int *buf_num, u8 *out_bit, u8 *decode_status); + +/* jump MCE head sync signal (1111 11) + * + * after jump signal head, current pulse number = 7 + * record current buf number of irctl buf + * record current pulse's bit and decode_status + * + * jump out of buf limit, return < 0 + */ +int w83667hg_jump_head(struct irctl *ir, unsigned int *buf_num); + +#define KEY_IDENTIFICATION 0x04 +#define MOUSE_IDENTIFICATION 0x01 +#define IDENTIFICATION_CHECK_BIT 0xF + +/* check mce identification + * + * compare identification and cur_iden + * same return 0 + * else return < 0, need continue check + */ +int w83667hg_check_identification(u8 val, u8 identification, u8 *cur_iden); + +/* jump mce identification + * can use on key, mouse and controller signals + * + * jump and search identification parts + * record current buf number of irctl buf + * + * jump all pulse until find identification + * + * + * + * problem 1: + * When jump_identification() stops on a double_width_len pulse, the buf_num will be the + * second pulse of the doule_width_len frame. + * + * one_width_len pulse: + * _ _ + * .| |_| |_. (1010) + * ^ + * | + * stop: jumped frame_num + * + * + * problem 1: double_width_len pulse: + * __ _ + * .| |__| |. (11001) + * ^ + * | + * stop: jumped frame_num + 1, buf_num + 2 + * + * solution: + * Now buf_num is the next double-pulse-width buf. + * Just decrease buf_num by one can fix this problem. + * + * + * After jump iden, output may diff by decode status: + * 1) + * For status ONE and ZERO, all decode work is done. + * Set status as NEW and inverse out_bit + * in fact, bit is not important, for a buf can indicate one frame, whether its + * length is one or two, the bit can be ignored + * + * after jump frame, all status is NEW! reset them as inverse polar bit + * + * + * + * + * can not find identification, return < 0 + */ +int w83667hg_jump_identification(struct irctl *ir, u8 identification, unsigned int *buf_num, u8 *out_bit, u8 *decode_status); + + +/* the frame number between identification and code */ +#define KEY_KEYCODE_FRAME_AFTER_I_START 16 /*//32*/ +#define KEY_FRAME_AFTER_JUMP 16 /*//64*/ +#define KEY_SUBMIT_KEYCODE_FRAME_NUM 8 + + +#define MOUSE_DELTAY_PULSE_AFTER_I_START 8 +#define MOUSE_CHECKSUM_FRAME_AFTER_JUMP 16 +#define MOUSE_SUBMIT_DELTAY_FRAME_NUM 7 +#define MOUSE_SUBMIT_DELTAX_FRAME_NUM 14 +#define MOUSE_SUBMIT_R_FRAME_NUM 15 +#define MOUSE_SUBMIT_L_FRAME_NUM 16 + + +/* FIXME, not sure this value, select a large number*/ +#define PULSE_SILENT_LEN_LOW 90 + + +/* set keycode and shiftmask for keyboard */ +void w83667hg_set_key(u8 *set_frame, u8 val, u8 *keycode, u8 *shiftmask); + +/* decode mce keyboard signal and send data to input + * + * 1) jump mce keyboard signal sync head (1111 11) + * 2) jump identification (0100) + * pulse number before identification is not sure + * 3) jump "unknown", "C" and "CodeSet" parts in mce keyboard signal + * 4) deocde "KeyCode" and "ShiftMask" parts in mce key signal + * 5) send keycode to input by array usb_kbd_keycode + * 6) send shiftmask to input by array usb_kbd_keycode + */ +void w83667hg_submit_key(struct irctl *ir); + +/* set deltax, deltay, x, y for mce mouse */ +void w83667hg_set_mouse(u8 *set_frame, u8 val, u8 *deltay, u8 *deltax, u8 *clickrl); + +/* decode mce mouse signal and send data to input + * + * 1) jump mce mouse signal sync head (1111 11) + * 2) jump identification (0001) + * pulse number before identification is not sure + * 3) jump "unknown" part in mce mouse signal + * 4) deocde "deltay", "deltax", "r" and "l" parts in mce mouse signal + * 5) send these parts to input + */ +void w83667hg_submit_mouse(struct irctl *ir); + + + +#define BIT_PULSE_MASK 0x80 +#define BIT_LEN 0x7f + + + +/* "10"=>1 (+2), "01"=>0 (+2) */ +#define ST_DECODE_NEW 0x01 +#define ST_DECODE_ZERO 0x02 +#define ST_DECODE_ONE 0x04 + +/* RC6 sync head: 1111 11 + * 6 * 444us / 50us (sample period) * 0.85 (inaccuracy) + */ +#define HEAD_SYNC_LEN_LOW 45 +/* 7 pulses long, for inaccuracy */ +#define HEAD_SYNC_LEN_HIGH 71 + +#define ONE_PULSE_LEN_LOW 2 +#define ONE_PULSE_LEN_HIGH 10 +#define TWO_PULSE_LEN_LOW 10 +#define TWO_PULSE_LEN_HIGH 15 + + +#endif diff --git a/app-misc/lirc/files/lirc_wb677_mouse_kbd.o b/app-misc/lirc/files/lirc_wb677_mouse_kbd.o Binary files differnew file mode 100644 index 0000000..2f53a9c --- /dev/null +++ b/app-misc/lirc/files/lirc_wb677_mouse_kbd.o diff --git a/app-misc/lirc/files/lircd b/app-misc/lirc/files/lircd new file mode 100755 index 0000000..370b61a --- /dev/null +++ b/app-misc/lirc/files/lircd @@ -0,0 +1,16 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/lircd,v 1.6 2004/09/26 21:27:07 lanius Exp $ + +start() { + ebegin "Starting lircd" + start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- ${LIRCD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping lircd" + start-stop-daemon --stop --quiet --exec /usr/sbin/lircd + eend $? +} diff --git a/app-misc/lirc/files/lircd-0.8.3 b/app-misc/lirc/files/lircd-0.8.3 new file mode 100644 index 0000000..8cd7a0a --- /dev/null +++ b/app-misc/lirc/files/lircd-0.8.3 @@ -0,0 +1,23 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/lircd-0.8.3,v 1.1 2008/05/05 09:53:19 zzam Exp $ + +PIDFILE=/var/run/${SVCNAME}.pid + +depend() { + provide lirc +} + +start() { + ebegin "Starting lircd" + start-stop-daemon --start --quiet --pidfile "${PIDFILE}" --exec /usr/sbin/lircd -- \ + -P "${PIDFILE}" ${LIRCD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping lircd" + start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" --exec /usr/sbin/lircd + eend $? +} diff --git a/app-misc/lirc/files/lircd-0.8.6 b/app-misc/lirc/files/lircd-0.8.6 new file mode 100644 index 0000000..dbf7a47 --- /dev/null +++ b/app-misc/lirc/files/lircd-0.8.6 @@ -0,0 +1,41 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/lircd-0.8.6,v 1.2 2010/05/21 02:32:36 beandog Exp $ + +PIDFILE=/var/run/lirc/${SVCNAME}.pid +LIRCD_SYMLINKFILE=/dev/lircd +LIRCD_SOCKET=/var/run/lirc/lircd + +depend() { + need localmount + use modules + provide lirc +} + +start() { + local retval + ebegin "Starting lircd" + rm -f ${LIRCD_SOCKET} && ln -s ${LIRCD_SOCKET} ${LIRCD_SYMLINKFILE} + if [ $? -ne 0 ]; then + eend $? "Unable to create symbolic link ${LIRCD_SYMLINKFILE}" + return 1 + fi + + start-stop-daemon --start --quiet --pidfile "${PIDFILE}" --exec /usr/sbin/lircd -- \ + -P "${PIDFILE}" ${LIRCD_OPTS} + retval=$? + + if [ ${retval} -ne 0 ]; then + rm -f ${LIRCD_SOCKET} + fi + + eend ${retval} +} + +stop() { + ebegin "Stopping lircd" + rm -f ${LIRCD_SYMLINKFILE} + start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" --exec /usr/sbin/lircd + eend $? +} diff --git a/app-misc/lirc/files/lircd.conf.2 b/app-misc/lirc/files/lircd.conf.2 new file mode 100644 index 0000000..cfda2b8 --- /dev/null +++ b/app-misc/lirc/files/lircd.conf.2 @@ -0,0 +1,10 @@ +# Options to pass to the lircd process + +# for devices with lirc-kernel-module +#LIRCD_OPTS="-d /dev/lirc0" +#LIRCD_OPTS="-d /dev/lirc" + +# for devices using the input-layer +#LIRCD_OPTS="-H devinput -d /dev/input/by-path/pci-0000:00:0a.0--event-ir" +# This should work, Bug #235107 +#LIRCD_OPTS="-H devinput -d name=*DVB*" diff --git a/app-misc/lirc/files/lircd.conf.wb677 b/app-misc/lirc/files/lircd.conf.wb677 new file mode 100755 index 0000000..d70bd33 --- /dev/null +++ b/app-misc/lirc/files/lircd.conf.wb677 @@ -0,0 +1,329 @@ +# +# brand: HP +# model no. of remote control: TSGH-IR01 +# devices being controlled by this remote: HP Slimline S3100y +# +# RC-6 config file +# +# source: http://home.hccnet.nl/m.majoor/projects_remote_control.htm +# http://home.hccnet.nl/m.majoor/pronto.pdf +# +# used by: Philips +# +######### +# +# Philips Media Center Edition remote control +# For use with the USB MCE ir receiver +# +# Dan Conti dconti|acm.wwu.edu +# +# Updated with codes for MCE 2005 Remote additional buttons +# *, #, Teletext, Red, Green, Yellow & Blue Buttons +# Note: TV power button transmits no code until programmed. +# Updated 12th September 2005 +# Graham Auld - mce|graham.auld.me.uk +# +# Radio, Print, RecTV are only available on the HP Media Center remote control +# +# +# Updated with codes for MCE 2007 Remote additional buttons +# Visualization, Aspect, SlideShow, Eject +# Note: +# Renamed some buttons: DVD->DVDMenu, More->MoreInfo, Star->Asterisk, Hash->Pound +# Note: +# Blue, Yellow, Green, Red, and Teletext buttons do not exist on the HP remote + +begin remote + + name mceusb + bits 16 + flags RC6|CONST_LENGTH + eps 30 + aeps 100 + + header 2667 889 + one 444 444 + zero 444 444 + pre_data_bits 21 + pre_data 0x37FF0 + gap 105000 + toggle_bit 22 + rc6_mask 0x100000000 + + + begin codes + +#unused by HP remote + Blue 0x00007ba1 + Yellow 0x00007ba2 + Green 0x00007ba3 + Red 0x00007ba4 + Teletext 0x00007ba5 + +#ba6 - bae unused + BA6 0x00007ba6 + BA7 0x00007ba7 + BA8 0x00007ba8 + BA9 0x00007ba9 + BAA 0x00007baa + BAB 0x00007bab + BAC 0x00007bac + BAD 0x00007bad + BAE 0x00007bae + + Radio 0x00007baf + Print 0x00007bb1 + +#bb2 - bb4 unused + BB2 0x00007bb2 + BB3 0x00007bb3 + BB4 0x00007bb4 + + Videos 0x00007bb5 + Pictures 0x00007bb6 + RecTV 0x00007bb7 + Music 0x00007bb8 + TV 0x00007bb9 + +#bba - bbf unused + BBA 0x00007bba + BBB 0x00007bbb + BBC 0x00007bbc + BBD 0x00007bbd + BBE 0x00007bbe + BBF 0x00007bbf +#bc1 - bca unused + BC1 0x00007bc1 + BC2 0x00007bc2 + BC3 0x00007bc3 + BC4 0x00007bc4 + BC5 0x00007bc5 + BC6 0x00007bc6 + BC7 0x00007bc7 + BC8 0x00007bc8 + BC9 0x00007bc9 + BCA 0x00007bca + + Eject 0x00007bcb + SlideShow 0x00007bcc + Visualization 0x00007bcd + +#bce - bcf unused + BCE 0x00007bce + BCF 0x00007bcf +#bd1 - bd7 unused + BD1 0x00007bd1 + BD2 0x00007bd2 + BD3 0x00007bd3 + BD4 0x00007bd4 + BD5 0x00007bd5 + BD6 0x00007bd6 + BD7 0x00007bd7 + + Aspect 0x00007bd8 + Guide 0x00007bd9 + LiveTV 0x00007bda + DVD 0x00007bdb +#NoGap + Back 0x00007bdc + OK 0x00007bdd + Right 0x00007bde + Left 0x00007bdf + Down 0x00007be0 + Up 0x00007be1 +#NoGap + Star 0x00007be2 + Hash 0x00007be3 +#NoGap + Replay 0x00007be4 + Skip 0x00007be5 + Stop 0x00007be6 + Pause 0x00007be7 + Record 0x00007be8 + Play 0x00007be9 + Rewind 0x00007bea + Forward 0x00007beb +#NoGap + ChanDown 0x00007bec + ChanUp 0x00007bed + VolDown 0x00007bee + VolUp 0x00007bef +#NoGap + More 0x00007bf0 + Mute 0x00007bf1 + Home 0x00007bf2 + Power 0x00007bf3 +#NoGap + Enter 0x00007bf4 + Clear 0x00007bf5 +#NoGap + Nine 0x00007bf6 + Eight 0x00007bf7 + Seven 0x00007bf8 + Six 0x00007bf9 + Five 0x00007bfa + Four 0x00007bfb + Three 0x00007bfc + Two 0x00007bfd + One 0x00007bfe + Zero 0x00007bff + end codes + +end remote +# +# this config file was automatically generated +# using lirc-0.8.4a(default) on Mon Feb 23 23:55:04 2009 +# +# contributed by +# +# brand: Hauppauge +# model no. of remote control: +# devices being controlled by this remote: PVR-150 Remote (MCE kit) +# SMK dongle 0609:031d +# + +begin remote + + name mceusb_hauppauge + bits 13 + flags RC6|CONST_LENGTH + eps 30 + aeps 100 + + header 2674 870 + one 455 427 + zero 455 427 + pre_data_bits 24 + pre_data 0x1BFF82 + gap 106288 + min_repeat 1 + toggle_bit_mask 0x8000 + rc6_mask 0x100000000 + + begin codes + TV 0x1BB9 + Music 0x1BB8 + Pictures 0x1BB6 + Videos 0x1BB5 + Power 0x1BF3 + Stop 0x1BE6 + Record 0x1BE8 + Pause 0x1BE7 + Play 0x1BE9 + Rewind 0x1BEA + Foward 0x1BEB + Replay 0x1BE4 + Skip 0x1BE5 + Back 0x1BDC + More 0x1BF0 + Up 0x1BE1 + Left 0x1BDF + Right 0x1BDE + OK 0x1BDD + Down 0x1BE0 + VolUp 0x1BEF + VolDown 0x1BEE + Home 0x1BF2 + ChanDown 0x1BED + ChanUp 0x1BEC + Mute 0x1BF1 + RecTV 0x1BB7 + Guide 0x1BD9 + LiveTV 0x1BDA + DVD 0x1BDB + One 0x1BFE + Two 0x1BFD + Three 0x1BFC + Four 0x1BFB + Five 0x1BFA + Six 0x1BF9 + Seven 0x1BF8 + Eight 0x1BF7 + Nine 0x1BF6 + Star 0x1BE2 + Zero 0x1BFF + Hash 0x1BE3 + Clear 0x1BF5 + Enter 0x1BF4 + end codes + +end remote + + +# +# this config file was automatically generated +# using lirc-0.8.4a(default) on Tue Mar 10 19:27:09 2009 +# +# contributed by +# +# brand: SIIG Vista MCE remote +# model no. of remote control: +# devices being controlled by this remote: +# + +begin remote + + name vista_mce + bits 16 + flags RC6 + eps 30 + aeps 100 + + header 2654 889 + one 427 427 + zero 427 427 + pre_data_bits 21 + pre_data 0x37FF0 + gap 69850 + toggle_bit_mask 0x8000 + rc6_mask 0x100000000 + + begin codes + Power 0xEBF3 + Pictures 0x6BB6 + Radio 0xEBAF + Videos 0x6BB5 + Music 0xEBB8 + Rec 0x6BE8 + Pause 0xEBE7 + Stop 0x6BE6 + Skipback 0xEBE4 + Play 0x6BE9 + Skipfwd 0xEBE5 + Rwd 0x6BEA + Fwd 0xEBEB + Start 0x6BF2 + Back 0xEBDC + More 0x6BF0 + Volup 0xEBEF + Voldown 0x6BEE + Chup 0xEBED + Chdown 0x6BEC + Up 0xEBE1 + Down 0x6BE0 + Left 0xEBDF + Right 0x6BDE + Mute 0xEBF1 + Rectv 0x6BB7 + Guide 0xEBD9 + Livetv 0x6BDA + Dvdmenu 0xEBDB + 1 0x6BFE + 2 0xEBFD + 3 0x6BFC + 4 0xEBFB + 5 0x6BFA + 6 0xEBF9 + 7 0x6BF8 + 8 0xEBF7 + 9 0x6BF6 + * 0xEBE2 + 0 0x6BFF + # 0xEBE3 + Clear 0x6BF5 + Enter 0xEBF4 + end codes + +end remote + + diff --git a/app-misc/lirc/files/lircmd b/app-misc/lirc/files/lircmd new file mode 100755 index 0000000..d383778 --- /dev/null +++ b/app-misc/lirc/files/lircmd @@ -0,0 +1,20 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/lircmd,v 1.2 2004/09/28 00:22:15 swegener Exp $ + +depend() { + need lircd +} + +start() { + ebegin "Starting lircmd" + start-stop-daemon --start --quiet --exec /usr/sbin/lircmd + eend $? +} + +stop() { + ebegin "Stopping lircmd" + start-stop-daemon --stop --quiet --exec /usr/sbin/lircmd + eend $? +} diff --git a/app-misc/lirc/files/lircrc_nuvoton b/app-misc/lirc/files/lircrc_nuvoton new file mode 100755 index 0000000..5abf8a3 --- /dev/null +++ b/app-misc/lirc/files/lircrc_nuvoton @@ -0,0 +1,272 @@ +# lirc_wb667 replace start # + +######################################################## +# LC : NOTICE !! +# EDIT THIS FILE in linux environment to avoid bug of lirc_client.c (lirc_readconfig_internal) +# => make sure line ending is '\n' instead of '\r''\n' +######################################################## + +####################### +### for MPlayer #### +####################### + +# This is the config file for lirc to support mplayer. +# Copy this file as ~/lircrc or /etc/lirc/lircic + +begin + button = VolUp + prog = mplayer + config = volume 1 + repeat = 1 +end + +begin + button = VolDown + prog = mplayer + config = volume -1 + repeat = 1 +end + +begin + button = ChanUp + prog = mplayer + config = tv_step_channel 1 + repeat = 1 +end + +begin + button = ChanDown + prog = mplayer + config = tv_step_channel -1 + repeat = 1 +end + +begin + button = OK + prog = mplayer + config = pause +end + +begin + button = Play + prog = mplayer + config = pause +end + +begin + button = Pause + prog = mplayer + config = pause +end + +begin + button = Stop + prog = mplayer + config = seek 0 1\npause +end + +begin + button = Mute + prog = mplayer + config = mute +end + +begin + button = Right + prog = mplayer + config = seek +10 + repeat = 1 +end + +begin + button = Left + prog = mplayer + config = seek -10 + repeat = 1 +end + +begin + button = Down + prog = mplayer + config = seek -60 + repeat = 1 +end + +begin + button = Up + prog = mplayer + config = seek +60 + repeat = 1 +end + +begin + button = Back + prog = mplayer + config = seek -600 + repeat = 1 +end + +begin + button = Rewind + prog = mplayer + config = seek -600 + repeat = 1 +end + +begin + button = Forward + prog = mplayer + config = seek +600 + repeat = 1 +end + + + + +####################### +### for Rhythmbox #### +####################### + + # to see debug info of Rhythmbox : exec "rhythmbox -d 2>&1 | grep lirc" + # + # the following section are copied from rb-lirc-plugin.c found on web. + # + #define RB_IR_COMMAND_PLAY "play" + #define RB_IR_COMMAND_PAUSE "pause" + #define RB_IR_COMMAND_PLAYPAUSE "playpause" + #define RB_IR_COMMAND_STOP "stop" + #define RB_IR_COMMAND_SHUFFLE "shuffle" + #define RB_IR_COMMAND_REPEAT "repeat" + #define RB_IR_COMMAND_NEXT "next" + #define RB_IR_COMMAND_PREVIOUS "previous" + #define RB_IR_COMMAND_SEEK_FORWARD "seek_forward" + #define RB_IR_COMMAND_SEEK_BACKWARD "seek_backward" + #define RB_IR_COMMAND_VOLUME_UP "volume_up" => LC : nothing happens ?? + #define RB_IR_COMMAND_VOLUME_DOWN "volume_down" => LC : nothing happens ?? + #define RB_IR_COMMAND_MUTE "mute" + + begin + prog = Rhythmbox + button = Play + config = play + end + begin + prog = Rhythmbox + button = Pause + config = pause + end + begin + prog = Rhythmbox + button = Stop + config = stop + end + begin + prog = Rhythmbox + button = Forward + config = seek_forward + end + begin + prog = Rhythmbox + button = Rewind + config = seek_backward + end + begin + prog = Rhythmbox + button = Skip + config = next + end + begin + prog = Rhythmbox + button = Replay + config = previous + end + begin + prog = Rhythmbox + button = VolUp + config = volume_up + end + begin + prog = Rhythmbox + button = VolDown + config = volume-down + end + +####################### +### for Totem #### +####################### + + # the following section are copied from totem-lirc.c found on web. + # + #define TOTEM_IR_COMMAND_PLAY "play" + #define TOTEM_IR_COMMAND_PAUSE "pause" + #define TOTEM_IR_COMMAND_NEXT "next" + #define TOTEM_IR_COMMAND_PREVIOUS "previous" + #define TOTEM_IR_COMMAND_SEEK_FORWARD "seek_forward" + #define TOTEM_IR_COMMAND_SEEK_BACKWARD "seek_backward" + #define TOTEM_IR_COMMAND_VOLUME_UP "volume_up" + #define TOTEM_IR_COMMAND_VOLUME_DOWN "volume_down" + #define TOTEM_IR_COMMAND_FULLSCREEN "fullscreen" + #define TOTEM_IR_COMMAND_QUIT "quit" + #define TOTEM_IR_COMMAND_UP "up" + #define TOTEM_IR_COMMAND_DOWN "down" + #define TOTEM_IR_COMMAND_LEFT "left" + #define TOTEM_IR_COMMAND_RIGHT "right" + #define TOTEM_IR_COMMAND_SELECT "select" + #define TOTEM_IR_COMMAND_MENU "menu" + #define TOTEM_IR_COMMAND_PLAYPAUSE "play_pause" + #define TOTEM_IR_COMMAND_ZOOM_UP "zoom_up" + #define TOTEM_IR_COMMAND_ZOOM_DOWN "zoom_down" + #define TOTEM_IR_COMMAND_SHOW_PLAYING "show_playing" + #define TOTEM_IR_COMMAND_SHOW_VOLUME "show_volume" + #define TOTEM_IR_COMMAND_EJECT "eject" + #define TOTEM_IR_COMMAND_PLAY_DVD "play_dvd" + #define TOTEM_IR_COMMAND_MUTE "mute" + + begin + prog = Totem + button = Play + config = play + end + begin + prog = Totem + button = Pause + config = pause + end + begin + prog = Totem + button = Stop + config = stop + end + begin + prog = Totem + button = Forward + config = seek_forward + end + begin + prog = Totem + button = Rewind + config = seek_backward + end + begin + prog = Totem + button = Skip + config = next + end + begin + prog = Totem + button = Replay + config = previous + end + begin + prog = Totem + button = VolUp + config = volume_up + end + begin + prog = Totem + button = VolDown + config = volume-down + end + +# lirc_wb667 replace end #
+
diff --git a/app-misc/lirc/files/modprobed.lirc b/app-misc/lirc/files/modprobed.lirc new file mode 100644 index 0000000..2ed9558 --- /dev/null +++ b/app-misc/lirc/files/modprobed.lirc @@ -0,0 +1,22 @@ +# +# For first serial receivers: +# +#options lirc_serial irq=4 io=0x3f8 +#options lirc_sir irq=4 io=0x3f8 + +# +# Detach first serial port from serial-driver. +# Use this when you have your serial-port-driver statically +# compiled into your kernel, or as a module but loaded before +# the lirc-module. +# +#install lirc_serial setserial /dev/ttyS0 uart none; modprobe --ignore-install lirc_serial +# +#install lirc_sir setserial /dev/ttyS0 uart none; modprobe --ignore-install lirc_sir + + +# +# For parallel receivers: +# +#options lirc_parallel irq=7 io=0x3bc + diff --git a/app-misc/lirc/files/modules.order b/app-misc/lirc/files/modules.order new file mode 100644 index 0000000..0b096bf --- /dev/null +++ b/app-misc/lirc/files/modules.order @@ -0,0 +1 @@ +kernel//usr/local/portage/app-misc/lirc/files/lirc_wb677/lirc_wb677.ko diff --git a/app-misc/lirc/files/modulesd.lirc b/app-misc/lirc/files/modulesd.lirc new file mode 100644 index 0000000..d1838c5 --- /dev/null +++ b/app-misc/lirc/files/modulesd.lirc @@ -0,0 +1,22 @@ +# +# For first serial receivers: +# +#options lirc_serial irq=4 io=0x3f8 +#options lirc_sir irq=4 io=0x3f8 + +# +# Detach first serial port from serial-driver. +# Use this when you have your serial-port-driver statically +# compiled into your kernel, or as a module but loaded before +# the lirc-module. +# +#pre-install lirc_serial setserial /dev/ttyS0 uart none +# +#pre-install lirc_sir setserial /dev/ttyS0 uart none + + +# +# For parallel receivers: +# +#options lirc_parallel irq=7 io=0x3bc + diff --git a/app-misc/lirc/files/wb83677hg_ir.h b/app-misc/lirc/files/wb83677hg_ir.h new file mode 100755 index 0000000..30eb60b --- /dev/null +++ b/app-misc/lirc/files/wb83677hg_ir.h @@ -0,0 +1,44 @@ +#define IR_IOC_MAGIC 'i' + +/* output chip registers for debug */ +#define IR_DUMPCIRREG _IO(IR_IOC_MAGIC, 0x80) +#define IR_DUMPWAKEREG _IO(IR_IOC_MAGIC, 0x81) + + +/* study wake key on MCE CIR controller */ +#define IR_IOLEARNWAKE _IO(IR_IOC_MAGIC, 0x82) + +/* disable cir wake */ +#define IR_IOUNSETWAKE _IO(IR_IOC_MAGIC, 0x83) + +/* enable cir wake */ +#define IR_IOSETWAKE _IO(IR_IOC_MAGIC, 0x84) + + +/* get carrier for study ir signal */ +#define IR_IOGETCARRIER _IOR(IR_IOC_MAGIC, 0x85, unsigned int) + +/* set carrier for send ir signal */ +#define IR_IOSETCARRIER _IOW(IR_IOC_MAGIC, 0x86, unsigned int) + +/* start/stop study key */ +#define IR_IOSTARTSTUDY _IO(IR_IOC_MAGIC, 0x88) +#define IR_IOSTOPSTUDY _IO(IR_IOC_MAGIC, 0x89) + +/* study key buf len */ +#define IR_IOSTUDYLEN _IOR(IR_IOC_MAGIC, 0x8A, unsigned int) + +/* study key buf data */ +#define IR_IOSTUDYBUF _IOR(IR_IOC_MAGIC, 0x8B, unsigned char) + +/* restudy key buf data */ +#define IR_IORESTUDYBUF _IO(IR_IOC_MAGIC, 0x8C) + + +/* clean data */ +#define IR_IOCLEANDATA _IO(IR_IOC_MAGIC, 0x8E) + + +/* check chip identification for the applications which are related to hardware */ +#define IR_CHECKCHIP _IOR(IR_IOC_MAGIC, 0x8F, unsigned long long) + diff --git a/app-misc/lirc/files/xbox-lircd.conf b/app-misc/lirc/files/xbox-lircd.conf new file mode 100755 index 0000000..d16e993 --- /dev/null +++ b/app-misc/lirc/files/xbox-lircd.conf @@ -0,0 +1,55 @@ +# +# LIRCD configuration file for Xbox DVD Kit +# +# Marko Friedemann <mfr@bmx-chemnitz.de> +# +# +# brand: Microsoft +# model: Xbox DVD Remote +# supported devices: Xbox DVD Remote via xpad-ir driver +# +# comment: EXPERIMENTAL +# + +begin remote + + name XboxDVDDongle + bits 8 + + begin codes + + SELECT 0x0b + UP 0xa6 + DOWN 0xa7 + RIGHT 0xa8 + LEFT 0xa9 + INFO 0xc3 + + 9 0xc6 + 8 0xc7 + 7 0xc8 + 6 0xc9 + 5 0xca + 4 0xcb + 3 0xcc + 2 0xcd + 1 0xce + 0 0xcf + + DISPLAY 0xd5 + BACK 0xd8 + SKIP+ 0xdd + SKIP- 0xdf + STOP 0xe0 + REVERSE 0xe2 + FORWARD 0xe3 + TITLE 0xe5 + PAUSE 0xe6 + PLAY 0xea + MENU 0xf7 + + end codes + +end remote + + diff --git a/app-misc/lirc/lirc-0.8.6-r4.ebuild b/app-misc/lirc/lirc-0.8.6-r4.ebuild new file mode 100644 index 0000000..6b44063 --- /dev/null +++ b/app-misc/lirc/lirc-0.8.6-r4.ebuild @@ -0,0 +1,376 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: + +inherit eutils linux-mod flag-o-matic autotools + +DESCRIPTION="decode and send infra-red signals of many commonly used remote controls" +HOMEPAGE="http://www.lirc.org/" + +MY_P=${PN}-${PV/_/} + +if [[ "${PV/_pre/}" = "${PV}" ]]; then + SRC_URI="mirror://sourceforge/lirc/${MY_P}.tar.bz2" +else + SRC_URI="http://www.lirc.org/software/snapshots/${MY_P}.tar.bz2" +fi + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" +IUSE="debug doc X hardware-carrier transmitter +wb677" + +S="${WORKDIR}/${MY_P}" + +RDEPEND=" + X? ( + x11-libs/libX11 + x11-libs/libSM + x11-libs/libICE + ) + lirc_devices_alsa_usb? ( media-libs/alsa-lib ) + lirc_devices_audio? ( >media-libs/portaudio-18 ) + lirc_devices_irman? ( media-libs/libirman )" + +# This are drivers with names matching the +# parameter --with-driver=NAME +IUSE_LIRC_DEVICES_DIRECT=" + all userspace accent act200l act220l + adaptec alsa_usb animax asusdh atilibusb + atiusb audio audio_alsa avermedia avermedia_vdomate + avermedia98 awlibusb bestbuy bestbuy2 breakoutbox + bte bw6130 caraca chronos commandir + cph06x creative creative_infracd + devinput digimatrix dsp dvico ea65 ene0100 + exaudio flyvideo ftdi gvbctv5pci hauppauge + hauppauge_dvb hercules_smarttv_stereo i2cuser + igorplugusb iguanaIR imon imon_24g imon_knob + imon_lcd imon_pad imon_rsc irdeo irdeo_remote + irlink irman irreal it87 ite8709 + knc_one kworld leadtek_0007 leadtek_0010 + leadtek_pvr2000 livedrive_midi + livedrive_seq logitech macmini mceusb + mediafocusI mouseremote + mouseremote_ps2 mp3anywhere mplay nslu2 + packard_bell parallel pcmak pcmak_usb + pctv pixelview_bt878 pixelview_pak + pixelview_pro provideo realmagic + remotemaster sa1100 samsung sasem sb0540 serial + silitek sir slinke streamzap tekram + tekram_bt829 tira ttusbir tuxbox tvbox udp uirt2 + uirt2_raw usb_uirt_raw usbx +wpc8769l" + +# drivers that need special handling and +# must have another name specified for +# parameter --with-driver=NAME +IUSE_LIRC_DEVICES_SPECIAL=" + serial_igor_cesko + remote_wonder_plus xboxusb usbirboy inputlirc" + +IUSE_LIRC_DEVICES="${IUSE_LIRC_DEVICES_DIRECT} ${IUSE_LIRC_DEVICES_SPECIAL}" + +#device-driver which use libusb +LIBUSB_USED_BY_DEV=" + all atilibusb awlibusb sasem igorplugusb imon imon_lcd imon_pad + imon_rsc streamzap mceusb xboxusb irlink commandir" + +for dev in ${LIBUSB_USED_BY_DEV}; do + DEPEND="${DEPEND} lirc_devices_${dev}? ( dev-libs/libusb )" +done + +# adding only compile-time depends +DEPEND="${RDEPEND} ${DEPEND} + virtual/linux-sources + lirc_devices_ftdi? ( dev-embedded/libftdi ) + lirc_devices_all? ( dev-embedded/libftdi )" + +# adding only run-time depends +RDEPEND="${RDEPEND} + lirc_devices_usbirboy? ( app-misc/usbirboy ) + lirc_devices_inputlirc? ( app-misc/inputlircd ) + lirc_devices_iguanaIR? ( app-misc/iguanaIR )" + +# add all devices to IUSE +for dev in ${IUSE_LIRC_DEVICES}; do + IUSE="${IUSE} lirc_devices_${dev}" +done + +add_device() { + : ${lirc_device_count:=0} + ((lirc_device_count++)) + + if [[ ${lirc_device_count} -eq 2 ]]; then + ewarn + ewarn "When selecting multiple devices for lirc to be supported," + ewarn "it can not be guaranteed that the drivers play nice together." + ewarn + ewarn "If this is not intended, then abort emerge now with Ctrl-C," + ewarn "Set LIRC_DEVICES and restart emerge." + ewarn + epause + fi + + local dev="${1}" + local desc="device ${dev}" + if [[ -n "${2}" ]]; then + desc="${2}" + fi + + elog "Compiling support for ${desc}" + MY_OPTS="${MY_OPTS} --with-driver=${dev}" +} + +pkg_setup() { + + if use lirc_devices_mceusb2 + then + ewarn "The mceusb2 driver has been merged into the mceusb." + ewarn "Please only use the latter now." + fi + + ewarn "If your LIRC device requires modules, you'll need MODULE_UNLOAD" + ewarn "support in your kernel." + + linux-mod_pkg_setup + + # set default configure options + MY_OPTS="" + LIRC_DRIVER_DEVICE="/dev/lirc0" + + if use lirc_devices_all; then + # compile in drivers for a lot of devices + add_device all "a lot of devices" + else + # compile in only requested drivers + local dev + for dev in ${IUSE_LIRC_DEVICES_DIRECT}; do + if use lirc_devices_${dev}; then + add_device ${dev} + fi + done + + if use lirc_devices_remote_wonder_plus; then + add_device atiusb "device Remote Wonder Plus (atiusb-based)" + fi + + if use lirc_devices_serial_igor_cesko; then + add_device serial "serial with Igor Cesko design" + MY_OPTS="${MY_OPTS} --with-igor" + fi + + if use lirc_devices_imon_pad; then + ewarn "The imon_pad driver has incorporated the previous pad2keys patch" + ewarn "and removed the pad2keys_active option for the lirc_imon module" + ewarn "because it is always active." + ewarn "If you have an older imon VFD device, you may need to add the module" + ewarn "option display_type=1 to override autodetection and force VFD mode." + fi + + if use lirc_devices_xboxusb; then + add_device atiusb "device xboxusb" + fi + + if use lirc_devices_usbirboy; then + add_device userspace "device usbirboy" + LIRC_DRIVER_DEVICE="/dev/usbirboy" + fi + + if [[ "${MY_OPTS}" == "" ]]; then + if [[ "${PROFILE_ARCH}" == "xbox" ]]; then + # on xbox: use special driver + add_device atiusb "device xboxusb" + else + # no driver requested + elog + elog "Compiling only the lirc-applications, but no drivers." + elog "Enable drivers with LIRC_DEVICES if you need them." + MY_OPTS="--with-driver=none" + fi + fi + fi + + use hardware-carrier && MY_OPTS="${MY_OPTS} --without-soft-carrier" + use transmitter && MY_OPTS="${MY_OPTS} --with-transmitter" + + if [[ -n "${LIRC_OPTS}" ]] ; then + ewarn + ewarn "LIRC_OPTS is deprecated from lirc-0.8.0-r1 on." + ewarn + ewarn "Please use LIRC_DEVICES from now on." + ewarn "e.g. LIRC_DEVICES=\"serial sir\"" + ewarn + ewarn "Flags are now set per use-flags." + ewarn "e.g. transmitter, hardware-carrier" + + local opt + local unsupported_opts="" + + # test for allowed options for LIRC_OPTS + for opt in ${LIRC_OPTS}; do + case ${opt} in + --with-port=*|--with-irq=*|--with-timer=*|--with-tty=*) + MY_OPTS="${MY_OPTS} ${opt}" + ;; + *) + unsupported_opts="${unsupported_opts} ${opt}" + ;; + esac + done + if [[ -n ${unsupported_opts} ]]; then + ewarn "These options are no longer allowed to be set" + ewarn "with LIRC_OPTS: ${unsupported_opts}" + die "LIRC_OPTS is no longer recommended." + fi + fi + + # Setup parameter for linux-mod.eclass + MODULE_NAMES="lirc(misc:${S})" + BUILD_TARGETS="all" + + ECONF_PARAMS=" --localstatedir=/var + --with-syslog=LOG_DAEMON + --enable-sandboxed + --with-kerneldir=${KV_DIR} + --with-moduledir=/lib/modules/${KV_FULL}/misc + $(use_enable debug) + $(use_with X x) + ${MY_OPTS}" + + einfo + einfo "lirc-configure-opts: ${MY_OPTS}" + elog "Setting default lirc-device to ${LIRC_DRIVER_DEVICE}" + + filter-flags -Wl,-O1 + + # force non-parallel make, Bug 196134 + MAKEOPTS="${MAKEOPTS} -j1" +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # Rip out dos CRLF + edos2unix contrib/lirc.rules + + # Apply patches needed for some special device-types + use lirc_devices_audio || epatch "${FILESDIR}"/lirc-0.8.4-portaudio_check.patch + use lirc_devices_remote_wonder_plus && epatch "${FILESDIR}"/lirc-0.8.3_pre1-remotewonderplus.patch + + # remove parallel driver on SMP systems + if linux_chkconfig_present SMP ; then + sed -i -e "s:lirc_parallel\.o::" drivers/lirc_parallel/Makefile.am + fi + + # Bug #187418 + if kernel_is ge 2 6 22 ; then + ewarn "Disabling lirc_gpio driver as it does no longer work Kernel 2.6.22+" + sed -i -e "s:lirc_gpio\.o::" drivers/lirc_gpio/Makefile.am + fi + + # correct autoconf.h location if 2.6.33 + if kernel_is ge 2 6 33 ; then + epatch "${FILESDIR}"/2.6.33.patch + sed -i 's/linux\/autoconf.h/generated\/autoconf.h/g' drivers/*/*.c + fi + + # respect CFLAGS + sed -i -e 's:CFLAGS="-O2:CFLAGS=""\n#CFLAGS="-O2:' configure.ac + + # setting default device-node + local f + for f in configure.ac acconfig.h; do + [[ -f "$f" ]] && sed -i -e '/#define LIRC_DRIVER_DEVICE/d' "$f" + done + echo "#define LIRC_DRIVER_DEVICE \"${LIRC_DRIVER_DEVICE}\"" >> acconfig.h + + eautoreconf +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + + newinitd "${FILESDIR}"/lircd-0.8.6 lircd + newinitd "${FILESDIR}"/lircmd lircmd + newconfd "${FILESDIR}"/lircd.conf.2 lircd + + insinto /etc/modprobe.d/ + newins "${FILESDIR}"/modprobed.lirc lirc.conf + + newinitd "${FILESDIR}"/irexec-initd-0.8.6-r2 irexec + newconfd "${FILESDIR}"/irexec-confd irexec + + if use doc ; then + dohtml doc/html/*.html + insinto /usr/share/doc/${PF}/images + doins doc/images/* + fi + + insinto /usr/share/lirc/remotes + doins -r remotes/* + + keepdir /var/run/lirc /etc/lirc + if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then + newdoc "${D}"/etc/lirc/lircd.conf lircd.conf.example + fi +} + +pkg_preinst() { + linux-mod_pkg_preinst + + local dir="${ROOT}/etc/modprobe.d" + if [[ -a "${dir}"/lirc && ! -a "${dir}"/lirc.conf ]]; then + elog "Renaming ${dir}/lirc to lirc.conf" + mv -f "${dir}/lirc" "${dir}/lirc.conf" + fi + + # copy the first file that can be found + if [[ -f "${ROOT}"/etc/lirc/lircd.conf ]]; then + cp "${ROOT}"/etc/lirc/lircd.conf "${T}"/lircd.conf + elif [[ -f "${ROOT}"/etc/lircd.conf ]]; then + cp "${ROOT}"/etc/lircd.conf "${T}"/lircd.conf + MOVE_OLD_LIRCD_CONF=1 + elif [[ -f "${D}"/etc/lirc/lircd.conf ]]; then + cp "${D}"/etc/lirc/lircd.conf "${T}"/lircd.conf + fi + + # stop portage from touching the config file + if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then + rm -f "${D}"/etc/lirc/lircd.conf + fi +} + +pkg_postinst() { + linux-mod_pkg_postinst + + # copy config file to new location + # without portage knowing about it + # so it will not delete it on unmerge or ever touch it again + if [[ -e "${T}"/lircd.conf ]]; then + cp "${T}"/lircd.conf "${ROOT}"/etc/lirc/lircd.conf + if [[ "$MOVE_OLD_LIRCD_CONF" = "1" ]]; then + elog "Moved /etc/lircd.conf to /etc/lirc/lircd.conf" + rm -f "${ROOT}"/etc/lircd.conf + fi + fi + + # wb677 specific + cp "${FILESDIR}"/lircd.conf.wb677 "${ROOT}"/etc/lirc/lircd.conf + cp "${FILESDIR}"/lircrc_nuvoton "${ROOT}"/etc/lirc/lircrc + cp -R "${WORKDIR}" /usr/src/ + + # compile + emake -C "${FILESDIR}"/lirc_wb677/ + emake -C "${FILESDIR}"/lirc_wb677/ install + + ewarn + ewarn "This ebuild is meant to be used only for remote controller wb677" + ewarn "shipped with ION 330" + ewarn + ewarn "To start:" + ewarn + ewarn "modprobe lirc_wb677" + ewarn "/etc/init.d/lirc start" + ewarn + +} diff --git a/app-misc/lirc/metadata.xml b/app-misc/lirc/metadata.xml new file mode 100644 index 0000000..ea955a2 --- /dev/null +++ b/app-misc/lirc/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>media-tv</herd> +<use> + <flag name='hardware-carrier'>The transmitter device generates its clock + signal in hardware</flag> + <flag name='transmitter'>Add transmitter support to some lirc-drivers + (e.g. serial)</flag> +</use> +</pkgmetadata> |