summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Stakenvicius <axs@gentoo.org>2013-08-27 18:22:33 +0000
committerIan Stakenvicius <axs@gentoo.org>2013-08-27 18:22:33 +0000
commit4510e6cf59d9d668e06fa0c13d86f2b20d43b875 (patch)
tree863cb607a945f99ddc69c80253984ea68cdf7e02 /app-misc/lirc
parent*** empty log message *** (diff)
downloadhistorical-4510e6cf59d9d668e06fa0c13d86f2b20d43b875.tar.gz
historical-4510e6cf59d9d668e06fa0c13d86f2b20d43b875.tar.bz2
historical-4510e6cf59d9d668e06fa0c13d86f2b20d43b875.zip
added support for zotac, bug 462596
Package-Manager: portage-2.1.12.2/cvs/Linux x86_64 Manifest-Sign-Key: 0x2B6559ED
Diffstat (limited to 'app-misc/lirc')
-rw-r--r--app-misc/lirc/ChangeLog6
-rw-r--r--app-misc/lirc/Manifest13
-rw-r--r--app-misc/lirc/files/lirc-0.9.0-add-zotac-support.patch658
-rw-r--r--app-misc/lirc/lirc-0.9.0-r2.ebuild8
4 files changed, 675 insertions, 10 deletions
diff --git a/app-misc/lirc/ChangeLog b/app-misc/lirc/ChangeLog
index 39357be74ed5..b90484dca8bd 100644
--- a/app-misc/lirc/ChangeLog
+++ b/app-misc/lirc/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for app-misc/lirc
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/ChangeLog,v 1.241 2013/05/24 16:31:01 axs Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/ChangeLog,v 1.242 2013/08/27 18:22:28 axs Exp $
+
+ 27 Aug 2013; Ian Stakenvicius <axs@gentoo.org>
+ +files/lirc-0.9.0-add-zotac-support.patch, lirc-0.9.0-r2.ebuild:
+ added support for zotac, bug 462596
24 May 2013; Ian Stakenvicius <axs@gentoo.org>
+files/lirc-0.9.0-kernel-3.8-fixes.patch, lirc-0.9.0-r2.ebuild:
diff --git a/app-misc/lirc/Manifest b/app-misc/lirc/Manifest
index 82ea88ea7670..9f4564b3c00e 100644
--- a/app-misc/lirc/Manifest
+++ b/app-misc/lirc/Manifest
@@ -6,6 +6,7 @@ AUX irexec-initd 808 SHA256 9325419aa45d80c205bc1cd47fe839b178da74bca5dd928cbe3a
AUX irexec-initd-0.8.6-r2 816 SHA256 5e5a31fbd93294a6e210499a880fcab371b23706824c9d60d827b0187d7bade4 SHA512 b90226e8dc29ed1769275a010e0b1f5376b91d4f3cfd7bb9dd135bdee31c0f7849f31a885baafe4cbbf9f11b548712e1d78198b44252c779ffeccc5e47730054 WHIRLPOOL 00936357f3df1f63821d7da4f4452ba25a5368d4d128c088e421be2fff2e50d1a190522a9aac6712da2867e827492e674806e5871f797eacf12d333091991f96
AUX lirc-0.8.3_pre1-remotewonderplus.patch 943 SHA256 547efbfa30f282ba9100495044e3b720c8f74c44f9a4e34db934d2ac7976fe29 SHA512 f1c5b03eafb8fb9d4190e438fb4ca734cac102c7f3a097f193a0a1ac7cdee33b01fb1d794959e00be16c78bb66e34d113f3ff8fb87678e99f82670ec0306e3ca WHIRLPOOL 999b01a1c2860457bf9ed68891cbb497595d58fe57627bc87d5f6401835ee5586ebcf124e1f563264ba64df22e38c7a6ccfbaf628123c5a2419bb0f57f74f19a
AUX lirc-0.8.4-portaudio_check.patch 769 SHA256 01e2034aaa6a7eb039e5c0e6c3b4a6ed38860614d3d0b0005d99a4aac2b3827e SHA512 a4e63da5d03f1fbb072679c3a415ae55767d601512f158c5e2fc52a045b632a055b94dca4e9d0d236ceeeb367daf22d4cc71f542229edb4fb13410512a8e4f0b WHIRLPOOL 0717efa4d7934c9736b220ec4416d1827397267b34bc3343a16a5963729fcfaa4871bb4e47b1aebbb310ea5bcc2bfaa7c675a451f5db46d979f0e4438e84a37e
+AUX lirc-0.9.0-add-zotac-support.patch 19299 SHA256 c3bb9a808a9cd17825a491d9c193eb92fbdb82265064a77b5798fdf6c14a423f SHA512 598123b32f95d3445dd18417a8682f65e5620be7b5bc9656f921ba154a91c4e91ef8a071549fb8590a50d617747251e2b9858fac75c695dda3e442c0ba0498c8 WHIRLPOOL 450631ce389a09ab18c885398b4090e6e9a5995b6b011ac2ad5b69103b9fbc0f0bc9a84ec8495cf67b7a76f617cacc020c44618d1af6af53774a708ce12cf29c
AUX lirc-0.9.0-atiusb_kfifo.patch 437 SHA256 b7950ee185588a3626b8024cb22c0e67c8514362f5c9cb74bfcead8018e11b02 SHA512 d072ecd94ed4b7f1662441106650b7eb329cbe62887819c1e607ae87375a17dedea02a3a5dcf6956a1151743fd652ec5884577c595771740eef509daab8dbd02 WHIRLPOOL f0013dd75d6cf3486cddbea4e97e7ca9962af882befc5e994f258d1eb5e77e09379c4ca246e407f4c7ad5438b860e0e3b0abb2cade6f04b101525f060188ed03
AUX lirc-0.9.0-kernel-2.6.39-fixes.patch 2175 SHA256 f5f48c867716288835a73b8d29aa9b1fcc4905a723e1f99e35fe396b2c759957 SHA512 a502b815cec565a49382e9ad0e7237a9bc7da431f41e94db42d214655577212606500ea2651a298db8cd3a68ce706461e6a773b0d9e3316ac7d49b2038fda354 WHIRLPOOL f1968f51cc29ce4f630c59c964d106e024f4cb3e5938ea80b271800a65d130a42531db5fe6e220ae20577cd4f1998de09e5dbdf52ff1cf6f3839922dd9ece114
AUX lirc-0.9.0-kernel-3.3.0-fixes.patch 1545 SHA256 f02e7b3c52dd17e179b6f89afc15f5eec2889a18f1df4523df680fbf50adb584 SHA512 75743844d7fe61a91174c1d7ee78a229e347659a35d1062a704c39e424d8a433efac4216a0b840282c38a4f2f22baa7a489c1c0402a40f734e7475992046a2ae WHIRLPOOL 871523dc5a9757d170b740acd9845b0ba42c4c5c4c5fdc71b5c701cefa2f6122cf1cb6171698e6bf2e605d93f052d15371657f5c1901794819ca2c3eded2ec1f
@@ -20,13 +21,13 @@ AUX lircmd 466 SHA256 d47f22a33a83c14a4a0c333d6a445c40e550c491899fb0c6d323e23fe1
AUX modprobed.lirc 549 SHA256 b4951252321ea326d3ec401e5ff1112716c5aaf5b2ca94d9f5e187e22ad35c44 SHA512 a64cac97e21ab53c247d8dd3e518b3caee5eeb9c3558727eba8a04684894c6be1695ce681e71d559474f4e78bbb39130d97f843eae18e56b3d3eb70f1fbefc63 WHIRLPOOL a45ec8b3cd725f9b4c6b991cf6d4fec7869a07911a2ac82535dca665a0dd99a66b40d85faf0beea780001e9260a8a17c1ccec880c05a271a138c1e0501f7727c
AUX modulesd.lirc 482 SHA256 3906b61951e1245cb3c9b16e81255a735f7bcdbbfcbedcdf44cd53236e2a3f28 SHA512 07ae7c7288878f65857962bb3a343b83d58eca6447299253dd297dec6443b95d89f46ebcbe1f1ac66ec5062f8134a2e19ecc3ce397b2f8d0d27f203a2a103fcc WHIRLPOOL 2bc4c45d3fd314cc88d50f79974b2aafa4e55a7df7383cbd2f3ddf5b66e144b5700f8d411f79ea458caec0da3e47d5e0db2c34e1efcc2d748c473fe2c5ae7389
DIST lirc-0.9.0.tar.bz2 857286 SHA256 6323afae6ad498d4369675f77ec3dbb680fe661bea586aa296e67f2e2daba4ff SHA512 e91534c63e6065bd7da3b15e1676edf1672b8beb21864a6825df86247d7d165bf2dee6f8191732933e24e42a406e46afc55559948e4061eed2de7b08fac13431 WHIRLPOOL 0a1c00b07898aa7a5d78865fb73c6d26c6331dd0a4945773a801d29e40298b365eb58cae113a95fcf73be678a24ac082ad0868e8051303d732882fb82a859a7b
-EBUILD lirc-0.9.0-r2.ebuild 13219 SHA256 419dacad5dc92fe968e77dd5edb9fd73bdab0b59efb266ad301203bb071088bc SHA512 b0dbb78d12e61b2648563b24586e3d0e777ffd1b8179d6865d2d4038942dae95478b2beee50edbb86de9187097ef05495fb8e0d4494912bc815672882d971971 WHIRLPOOL 84625e8c0ad16516869905da1429c98156ceb85a2688fe0a5d0221d7b3ddfeaef10a6eedd67f7e7a7c9136e7c968a84387a09911860da8fadf8c383ff46d0b36
-MISC ChangeLog 39803 SHA256 9426914d9b6d072de4983c5f08133caea7763ed959f256e9bcae39c863ed3f06 SHA512 b6e1273b8e2299ea9b9b895da622b730612495424259db8031325e7b4b0f6703d26b93e7eed2a1e963a9bbd053033ce8ee0c7901d9765d221d1df7959bf2a402 WHIRLPOOL 3c6b5ded3b1345862d31a60baba2584e2d7989f71199baa693f695be4ece0f52d3e7f44fd4ed720dbed8381971c36b7a552cb1c445666d14761124a328bed6d8
+EBUILD lirc-0.9.0-r2.ebuild 13326 SHA256 cafd8dc28bf153e64d2b2d75896d0c7f1150abab68a7c77b5e254bf5d124d8db SHA512 5608912391766fcf12e553eaa70bf9b7abdb8e44ae235fc57d8f00c4794feeba7c03c7840dc2230a432d1e8d27579e9a0658434e71b81545d686e0c73a55924c WHIRLPOOL b6d6576ea56d765f5fd23d348ed99f6de26fddfbb6df6379840b4a52511414531b349d52ab777ef4dfa46bacc80e365ad161c213ab35c2d7ab87686552a83195
+MISC ChangeLog 39958 SHA256 8f06c64827d124cffcf1388819e8051a8f703f1e7fcaee71890a391c0e408fed SHA512 68caca4028af5c70d03a9fdb0ca84fd8c2197826f8c6f0a1062beb2c91af6049f37266429c9ece18af532fa3e14db606d05c9b11f2e25220092b8d14aae768da WHIRLPOOL 767a7f50a86a160cfc1fe77e83386b5f8bf62e3a3bd8dcabd4481f5db5c8d9caff857c8a1390143dece599f11b07ede02724f392e3462baf968746e49f8913fa
MISC metadata.xml 376 SHA256 e3b4637a67a93eb4b9457fa5941e8a6a891adca11a1ebc80c21a59650eac93aa SHA512 17eca2da394c7ca359766b80a0bd743f57235e49f422a7c2b1108e7d2dcdd7ea38ba36d8b3e3bc58b3d3818d75af99c0220eefff9d73aea97b561278cc243ce7 WHIRLPOOL 39c1156d377164114fb8730153a9e5e9dd4753ed98aec00fdff779de354336c3f791dd4fde3a0eff2dff3a8e62279f6e1ab473cf5e6cf00902f3febce0e2ac4f
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.19 (GNU/Linux)
+Version: GnuPG v2.0.20 (GNU/Linux)
-iF4EAREIAAYFAlGflc8ACgkQ2ugaI38ACPAi5wD8CEma09ehQQW/qnEggxLlturr
-RaeUXjeyqvAWu4BsPSsA/ixJeoh+sC8/FT6J6XOJ4oCNw8LR95fyaQl4SBOdMMZ1
-=NHB+
+iF4EAREIAAYFAlIc7noACgkQ2ugaI38ACPDm3QD7B+wn2x4WORaLyJAPZTTxpEm9
+EsC4++vUhf0U3JtGBCMBAKgVNZYZrOwRnwg4k6pDrJYHS4LSpMK9P0MO+mduuLZW
+=k4Rz
-----END PGP SIGNATURE-----
diff --git a/app-misc/lirc/files/lirc-0.9.0-add-zotac-support.patch b/app-misc/lirc/files/lirc-0.9.0-add-zotac-support.patch
new file mode 100644
index 000000000000..3fe6b6055bf0
--- /dev/null
+++ b/app-misc/lirc/files/lirc-0.9.0-add-zotac-support.patch
@@ -0,0 +1,658 @@
+diff -rupN base/configure.ac mod/configure.ac
+--- base/configure.ac 2011-03-25 23:28:18.000000000 +0100
++++ mod/configure.ac 2013-03-21 16:25:07.218419985 +0100
+@@ -383,7 +383,7 @@ AC_CHECK_HEADERS(linux/input.h,[
+ dnl check if hiddev is available
+ AC_CHECK_HEADERS([linux/types.h])
+ AC_CHECK_HEADERS([linux/hiddev.h],[
+- possible_drivers="${possible_drivers} (asusdh) (bw6130) (dvico) (macmini)"
++ possible_drivers="${possible_drivers} (asusdh) (bw6130) (dvico) (macmini) (zotac)"
+ AC_MSG_CHECKING(for HIDDEV_FLAG_UREF support)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <linux/types.h>
+@@ -393,7 +393,7 @@ AC_CHECK_HEADERS([linux/hiddev.h],[
+ ]])],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LINUX_HIDDEV_FLAG_UREF)
+- possible_drivers="${possible_drivers} (samsung) (sb0540)"
++ possible_drivers="${possible_drivers} (samsung) (sb0540) (zotac)"
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+@@ -446,7 +446,7 @@ AC_ARG_WITH(driver,
+ srm7500libusb, tekram,
+ tekram_bt829, tira, tira_raw, ttusbir,
+ tuxbox, tvbox, udp, uirt2, uirt2_raw,
+- usb_uirt_raw, usbx, wpc8769l],
++ usb_uirt_raw, usbx, wpc8769l, zotac],
+ driver=${withval},
+ driver="unset"
+ )
+@@ -464,6 +464,7 @@ portaudio_lib=""
+ alsa_lib=""
+ atilibusb_lib=""
+ atwf83_lib=""
++zotac_lib=""
+ awlibusb_lib=""
+ dfclibusb_lib=""
+ srm7500libusb_lib=""
+@@ -683,6 +684,10 @@ if test "$driver" = "userspace" -o "$dri
+ usbx)
+ hw_module="${hw_module} hw_usbx.o serial.o"
+ ;;
++ zotac)
++ hw_module="${hw_module} hw_zotac.o"
++ zotac_lib=-lpthread
++ ;;
+ esac
+ done
+ #remove duplicates
+@@ -733,6 +738,14 @@ if test "$driver" = "alsa_usb"; then
+ lircd_conf="creative/lircd.conf.alsa_usb"
+ fi
+
++if test "$driver" = "zotac"; then
++ lirc_driver="$driver"
++ hw_module="hw_zotac.o"
++ HW_DEFAULT="hw_zotac"
++ lircd_conf="zotac/lircd.conf.zotac"
++ zotac_lib=-lpthread
++fi
++
+ if test "$driver" = "animax"; then
+ lirc_driver="lirc_dev lirc_serial"
+ lircd_conf="animax/lircd.conf.animax"
+@@ -1499,6 +1512,7 @@ if test "$lirc_driver" = "none" || \
+ test "$lirc_driver" = "macmini" || \
+ test "$lirc_driver" = "samsung" || \
+ test "$lirc_driver" = "sb0540" || \
++ test "$lirc_driver" = "zotac" || \
+ test "$lirc_driver" = "srm7500libusb" || \
+ test "$lirc_driver" = "userspace"; then
+ lirc_driver=
+@@ -1669,7 +1683,7 @@ if ! echo ${hw_module}|grep " receive.o"
+ receive="receive.o"
+ fi
+
+-hw_module_libs="${alsa_lib} ${atilibusb_lib} ${awlibusb_lib} ${caraca_lib} ${commandir_lib} ${dfclibusb_lib} ${ftdi_lib} ${iguanaIR_lib} ${irman_lib} ${portaudio_lib} ${srm7500libusb_lib} ${atwf83_lib}"
++hw_module_libs="${alsa_lib} ${atilibusb_lib} ${awlibusb_lib} ${caraca_lib} ${commandir_lib} ${dfclibusb_lib} ${ftdi_lib} ${iguanaIR_lib} ${irman_lib} ${portaudio_lib} ${srm7500libusb_lib} ${atwf83_lib} ${zotac_lib}"
+
+ dnl tell the Makefiles what we decided
+ AC_SUBST(daemon)
+diff -rupN base/daemons/Makefile.am mod/daemons/Makefile.am
+--- base/daemons/Makefile.am 2011-03-25 23:28:18.000000000 +0100
++++ mod/daemons/Makefile.am 2013-03-21 16:25:40.488790784 +0100
+@@ -58,7 +58,8 @@ EXTRA_libhw_module_a_SOURCES = \
+ hw_usbx.c hw_usbx.h \
+ receive.c receive.h \
+ transmit.c transmit.h \
+- serial.c serial.h
++ serial.c serial.h \
++ hw_zotac.c
+
+ libhw_module_a_LIBADD = @hw_module@
+ libhw_module_a_DEPENDENCIES = @hw_module@
+diff -rupN base/daemons/hw-types.c mod/daemons/hw-types.c
+--- base/daemons/hw-types.c 2011-03-25 23:28:18.000000000 +0100
++++ mod/daemons/hw-types.c 2013-03-21 16:26:38.913200218 +0100
+@@ -59,6 +59,7 @@ extern struct hardware hw_uirt2;
+ extern struct hardware hw_uirt2_raw;
+ extern struct hardware hw_usb_uirt_raw;
+ extern struct hardware hw_usbx;
++extern struct hardware hw_zotac;
+
+ #ifndef HW_DEFAULT
+ # define HW_DEFAULT hw_default
+@@ -160,6 +161,7 @@ struct hardware *hw_list[] = {
+ #ifdef HAVE_LINUX_HIDDEV_FLAG_UREF
+ &hw_samsung,
+ &hw_sb0540,
++ &hw_zotac,
+ #endif
+ &hw_silitek,
+ #ifdef HAVE_LIBUSB
+diff -rupN base/daemons/hw_zotac.c mod/daemons/hw_zotac.c
+--- base/daemons/hw_zotac.c 1970-01-01 01:00:00.000000000 +0100
++++ mod/daemons/hw_zotac.c 2013-03-21 16:31:06.989272556 +0100
+@@ -0,0 +1,429 @@
++/****************************************************************************
++ ** hw_zotac.c *************************************************************
++ ****************************************************************************
++ *
++ * Lirc driver for Zotac remote
++ *
++ * Copyright (C) 2010 Rainer Hochecker
++ *
++ * Distribute under GPL version 2 or later.
++ *
++ */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stdio.h>
++#include <pthread.h>
++#include <sys/fcntl.h>
++#include <signal.h>
++#include <linux/hiddev.h>
++#include <sys/ioctl.h>
++#include "hardware.h"
++#include "ir_remote.h"
++#include "lircd.h"
++
++enum {
++ RPT_NO = 0,
++ RPT_YES = 1,
++};
++
++static int zotac_init();
++static int zotac_deinit();
++static char *zotac_rec(struct ir_remote *remotes);
++static int zotac_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp,
++ lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp);
++static void *zotac_repeat();
++static int zotac_getcode();
++
++/** Max number of repetitions */
++const unsigned max_repeat_count = 500;
++/** Code that triggers key release */
++const unsigned release_code = 0x00000000;
++/** Code that triggers device remove */
++const unsigned remove_code =0x00FFFFFF;
++/** Time to wait before first repetition */
++const unsigned repeat_time1_us = 500000;
++/** Time to wait between two repetitions */
++const unsigned repeat_time2_us = 100000;
++/** Pipe between main thread and repetition thread */
++static int fd_pipe[2] = { -1, -1 };
++
++/** Thread that simulates repetitions */
++static pthread_t repeat_thread;
++/** File descriptor for the real device */
++static int fd_hidraw;
++
++const int main_code_length = 32;
++static signed int main_code = 0;
++static struct timeval start, end, last;
++static int repeat_state = RPT_NO;
++static int error_state = 0;
++static int probe_code = 0;
++
++#ifdef HAVE_LINUX_HIDDEV_FLAG_UREF
++/* Zotac USB iR Receiver */
++struct hardware hw_zotac = {
++ "/dev/usb/hiddev0", /* "device" */
++ -1, /* fd (device) */
++ LIRC_CAN_REC_LIRCCODE, /* features */
++ 0, /* send_mode */
++ LIRC_MODE_LIRCCODE, /* rec_mode */
++ 32, /* code_length */
++ zotac_init, /* init_func */
++ zotac_deinit, /* deinit_func */
++ NULL, /* send_func */
++ zotac_rec, /* rec_func */
++ zotac_decode, /* decode_func */
++ NULL, /* ioctl_func */
++ NULL, /* readdata */
++ "zotac" /* name */
++};
++#endif
++
++static int zotac_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp,
++ lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp)
++{
++ LOGPRINTF(1, "zotac_decode");
++
++ if (!map_code(remote, prep, codep, postp, 0, 0, main_code_length, main_code, 0, 0)) {
++ return 0;
++ }
++
++ map_gap(remote, &start, &last, 0, repeat_flagp, min_remaining_gapp, max_remaining_gapp);
++ /* override repeat */
++ *repeat_flagp = repeat_state;
++
++ return 1;
++}
++
++static int zotac_getcode() {
++
++ ssize_t rd;
++ struct hiddev_usage_ref uref;
++ struct hiddev_report_info rinfo;
++ struct hiddev_field_info finfo;
++ int shift = 0;
++
++ rd = read(fd_hidraw, &uref, sizeof(uref));
++ if (rd < 0) {
++ logprintf(LOG_ERR, "error reading '%s'", hw.device);
++ logperror(LOG_ERR, NULL);
++ zotac_deinit();
++ error_state = 1;
++ return -1;
++ }
++
++ if (uref.field_index == HID_FIELD_INDEX_NONE) {
++ /*
++ * we get this when the new report has been send from
++ * device at this point we have the uref structure
++ * prefilled with correct report type and id
++ *
++ */
++
++ switch (uref.report_id) {
++ case 1: /* USB standard keyboard usage page */
++ {
++ /* This page reports cursor keys */
++ LOGPRINTF(3, "Keyboard (standard)\n");
++
++ /* check for special codes */
++ uref.field_index = 0;
++ uref.usage_index = 1;
++ /* fetch the usage code for given indexes */
++ ioctl(fd_hidraw, HIDIOCGUCODE, &uref, sizeof(uref));
++ /* fetch the value from report */
++ ioctl(fd_hidraw, HIDIOCGUSAGE, &uref, sizeof(uref));
++
++ if (uref.value)
++ shift = 1;
++
++ /* populate required field number */
++ uref.field_index = 1;
++ uref.usage_index = 0;
++ /* fetch the usage code for given indexes */
++ ioctl(fd_hidraw, HIDIOCGUCODE, &uref, sizeof(uref));
++ /* fetch the value from report */
++ ioctl(fd_hidraw, HIDIOCGUSAGE, &uref, sizeof(uref));
++ /* now we have the key */
++
++ LOGPRINTF(3, "usage: %x value: %x shift: %d\n",uref.usage_code, uref.value, shift);
++
++ /* now we have the key */
++ if (uref.value) {
++ probe_code = (uref.usage_code | uref.value);
++ if (shift)
++ probe_code |= 0x10000000;
++ LOGPRINTF(3, "Main code 1: %x\n", probe_code);
++ return 1;
++ }
++ else {
++ LOGPRINTF(3, "rel button\n");
++ probe_code = release_code;
++ return 2;
++ }
++ }
++ break;
++
++ case 2:
++ case 3: /* USB generic desktop usage page */
++ case 4:
++ {
++ /* This page reports power key
++ * (via SystemControl SLEEP)
++ */
++ LOGPRINTF(3, "Generic desktop (standard)\n");
++
++
++ /* traverse report descriptor */
++ rinfo.report_type = HID_REPORT_TYPE_INPUT;
++ rinfo.report_id = HID_REPORT_ID_FIRST;
++ rd = ioctl(fd_hidraw, HIDIOCGREPORTINFO, &rinfo);
++
++ unsigned int i,j;
++ while (rd >= 0) {
++ for (i = 0; i < rinfo.num_fields; i++) {
++ finfo.report_type = rinfo.report_type;
++ finfo.report_id = rinfo.report_id;
++ finfo.field_index = i;
++ ioctl(fd_hidraw, HIDIOCGFIELDINFO, &finfo);
++ for (j = 0; j < finfo.maxusage; j++) {
++ uref.field_index = i;
++ uref.usage_index = j;
++ ioctl(fd_hidraw, HIDIOCGUCODE, &uref);
++ ioctl(fd_hidraw, HIDIOCGUSAGE, &uref);
++
++ if (uref.value != 0) {
++ LOGPRINTF(3, "field: %d, idx: %d, usage: %x value: %x\n",i, j, uref.usage_code, uref.value);
++ probe_code = uref.usage_code;
++ return 1;
++ }
++ }
++ }
++ rinfo.report_id |= HID_REPORT_ID_NEXT;
++ rd = ioctl(fd_hidraw, HIDIOCGREPORTINFO, &rinfo);
++ }
++ return 2;
++ }
++ break;
++ default:
++ /* Unknown/unsupported report id.
++ * Should not happen because remaining reports
++ * from report descriptor seem to be unused by remote.
++ */
++ logprintf(LOG_ERR, "Unexpected report id %d", uref.report_id);
++ break;
++ }
++ }
++ else {
++ /* This page reports power key
++ * (via SystemControl SLEEP)
++ */
++ LOGPRINTF(3, "Same Event ...\n");
++
++ /* traverse report descriptor */
++ rinfo.report_type = HID_REPORT_TYPE_INPUT;
++ rinfo.report_id = HID_REPORT_ID_FIRST;
++ rd = ioctl(fd_hidraw, HIDIOCGREPORTINFO, &rinfo);
++
++ unsigned int i,j;
++ while (rd >= 0) {
++ for (i = 0; i < rinfo.num_fields; i++) {
++ finfo.report_type = rinfo.report_type;
++ finfo.report_id = rinfo.report_id;
++ finfo.field_index = i;
++ ioctl(fd_hidraw, HIDIOCGFIELDINFO, &finfo);
++ for (j = 0; j < finfo.maxusage; j++) {
++ uref.field_index = i;
++ uref.usage_index = j;
++ ioctl(fd_hidraw, HIDIOCGUCODE, &uref);
++ ioctl(fd_hidraw, HIDIOCGUSAGE, &uref);
++
++ if (uref.value != 0) {
++ LOGPRINTF(3, "usage: %x value: %x\n",uref.usage_code, uref.value);
++ //probe_code = uref.usage_code;
++ return 0;
++ }
++ }
++ }
++ rinfo.report_id |= HID_REPORT_ID_NEXT;
++ rd = ioctl(fd_hidraw, HIDIOCGREPORTINFO, &rinfo);
++ }
++ return 2;
++ }
++ return 0;
++}
++
++static int zotac_init()
++{
++ logprintf(LOG_INFO, "zotac initializing '%s'", hw.device);
++ if ((fd_hidraw = open(hw.device, O_RDONLY)) < 0) {
++ logprintf(LOG_ERR, "unable to open '%s'", hw.device);
++ return 0;
++ }
++ int flags = HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT;
++ if (ioctl(fd_hidraw, HIDIOCSFLAG, &flags)) {
++ return 0;
++ }
++ hw.fd = fd_hidraw;
++
++ /* Create pipe so that events sent by the repeat thread will
++ trigger main thread */
++ if (pipe(fd_pipe) != 0) {
++ logperror(LOG_ERR, "couldn't open pipe");
++ close(fd_hidraw);
++ return 0;
++ }
++ hw.fd = fd_pipe[0];
++ /* Create thread to simulate repetitions */
++ if (pthread_create(&repeat_thread, NULL, zotac_repeat, NULL)) {
++ logprintf(LOG_ERR, "Could not create \"repeat thread\"");
++ return 0;
++ }
++ return 1;
++}
++
++static int zotac_deinit()
++{
++ pthread_cancel(repeat_thread);
++ if (fd_hidraw != -1) {
++ // Close device if it is open
++ logprintf(LOG_INFO, "closing '%s'", hw.device);
++ close(fd_hidraw);
++ fd_hidraw = -1;
++ }
++ // Close pipe input
++ if (fd_pipe[1] >= 0) {
++ close(fd_pipe[1]);
++ fd_pipe[1] = -1;
++ }
++ // Close pipe output
++ if (fd_pipe[0] >= 0) {
++ close(fd_pipe[0]);
++ fd_pipe[0] = -1;
++ }
++ hw.fd = -1;
++ return 1;
++}
++
++/**
++ * Runtime that reads device, forwards codes to main thread
++ * and simulates repetitions.
++ */
++static void *zotac_repeat()
++{
++ int repeat_count = 0;
++ unsigned current_code;
++ int ret;
++ int sel;
++ fd_set files;
++ struct timeval delay;
++ int pressed = 0;
++ int fd = fd_pipe[1];
++
++ while (1) {
++ // Initialize set to monitor device's events
++ FD_ZERO(&files);
++ FD_SET(fd_hidraw, &files);
++ if (pressed) {
++ sel = select(FD_SETSIZE, &files, NULL, NULL, &delay);
++ } else {
++ sel = select(FD_SETSIZE, &files, NULL, NULL, NULL);
++ }
++
++ switch (sel) {
++ case 1:
++ // Data ready in device's file
++ ret = zotac_getcode();
++
++ if (ret < 0) {
++ // Error
++ logprintf(LOG_ERR, "(%s) Could not read %s", __FUNCTION__, hw.device);
++ goto exit_loop;
++ }
++ if (ret == 1) {
++ // Key code : forward it to main thread
++ pressed = 1;
++ repeat_count = 0;
++ delay.tv_sec = 0;
++ delay.tv_usec = repeat_time1_us;
++ current_code = probe_code;
++ } else if (ret == 2) {
++ // Release code : stop repetitions
++ pressed = 0;
++ current_code = release_code;
++ } else if (ret == 0) {
++ continue;
++ }
++ break;
++ case 0:
++ repeat_count++;
++ if (repeat_count >= max_repeat_count) {
++ // Too many repetitions, something must have gone wrong
++ logprintf(LOG_ERR,"(%s) too many repetitions", __FUNCTION__);
++ goto exit_loop;
++ }
++ // Timeout : send current_code again to main
++ // thread to simulate repetition
++ delay.tv_sec = 0;
++ delay.tv_usec = repeat_time2_us;
++ break;
++ default:
++ // Error
++ logprintf(LOG_ERR, "(%s) select() failed", __FUNCTION__);
++ goto exit_loop;
++ }
++ // Send code to main thread through pipe
++ write(fd, &current_code, sizeof(current_code));
++ }
++exit_loop:
++
++ // Wake up main thread with special key code
++ current_code = remove_code;
++ write(fd, &current_code, sizeof(current_code));
++ return NULL;
++}
++
++/*
++* Aureal Technology ATWF@83 cheap remote
++* specific code.
++*/
++
++static char *zotac_rec(struct ir_remote *remotes)
++{
++ unsigned ev;
++ int rd;
++ last = end;
++ gettimeofday(&start, NULL);
++ rd = read(hw.fd, &ev, sizeof(ev));
++
++ if (rd == -1) {
++ // Error
++ logprintf(LOG_ERR, "(%s) could not read pipe", __FUNCTION__);
++ zotac_deinit();
++ return 0;
++ }
++
++ if (ev == release_code) {
++ // Release code
++ main_code = 0;
++ return 0;
++ } else if (ev == remove_code) {
++ // Device has been removed
++ zotac_deinit();
++ return 0;
++ }
++
++ LOGPRINTF(1, "zotac : %x", ev);
++ // Record the code and check for repetition
++ if (main_code == ev) {
++ repeat_state = RPT_YES;
++ } else {
++ main_code = ev;
++ repeat_state = RPT_NO;
++ }
++ gettimeofday(&end, NULL);
++ return decode_all(remotes);
++}
+diff -rupN base/remotes/zotac/lircd.conf.zotac mod/remotes/zotac/lircd.conf.zotac
+--- base/remotes/zotac/lircd.conf.zotac 1970-01-01 01:00:00.000000000 +0100
++++ mod/remotes/zotac/lircd.conf.zotac 2013-03-21 16:31:31.343367869 +0100
+@@ -0,0 +1,77 @@
++
++# Please make this file available to others
++# by sending it to <lirc@bartelmus.de>
++#
++# this config file was automatically generated
++# using lirc-0.9.1-git(zotac) on Mon Apr 2 14:10:29 2012
++#
++# contributed by
++#
++# brand: zotac.conf
++# model no. of remote control:
++# devices being controlled by this remote:
++#
++
++begin remote
++
++ name zotac.conf
++ bits 32
++ eps 30
++ aeps 100
++
++ one 0 0
++ zero 0 0
++ gap 100123
++ min_repeat 9
++# suppress_repeat 9
++# uncomment to suppress unwanted repeats
++# toggle_bit_mask 0x7004F
++
++ begin codes
++ KEY_SLEEP 0x00010082
++ KEY_WAKEUP 0x00010083
++ KEY_RECORD 0x000C00B2
++ KEY_PAUSE 0x000C00B1
++ KEY_STOP 0x000C00B7
++ KEY_REWIND 0x000C00B4
++ KEY_PLAY 0x000C00B0
++ KEY_FORWARD 0x000C00B3
++ KEY_LEFTSHIFT 0x000C00B6
++ KEY_RIGHTSHIFT 0x000C00B5
++ KEY_BACK 0x000C0224
++ KEY_INFO 0x000C0209
++ KEY_MENU 0xFFBC000D
++ KEY_UP 0x00070052
++ KEY_LEFT 0x00070050
++ KEY_RIGHT 0x0007004F
++ KEY_DOWN 0x00070051
++ KEY_OK 0x00070028
++ KEY_VOLUMEUP 0x000C00E9
++ KEY_VOLUMEDOWN 0x000C00EA
++ KEY_MUTE 0x000C00E2
++ KEY_CHANNELUP 0x000C009C
++ KEY_CHANNELDOWN 0x000C009D
++ KEY_1 0x0007001E
++ KEY_2 0x0007001F
++ KEY_3 0x00070020
++ KEY_4 0x00070021
++ KEY_5 0x00070022
++ KEY_6 0x00070023
++ KEY_7 0x00070024
++ KEY_8 0x00070025
++ KEY_9 0x00070026
++ KEY_0 0x00070027
++ KEY_NUMERIC_STAR 0x10070025
++ KEY_NUMERIC_POUND 0x10070020
++ KEY_CLEAR 0x00070029
++ KEY_TEXT 0xFFBC005A
++ KEY_TITLE 0x000C008D
++ KEY_ENTER 0x00070028
++ KEY_RED 0xFFBC005B
++ KEY_GREEN 0xFFBC005C
++ KEY_YELLOW 0xFFBC005D
++ KEY_BLUE 0xFFBC005E
++ end codes
++
++end remote
++
+diff -rupN base/setup.data mod/setup.data
+--- base/setup.data 2011-03-25 23:28:18.000000000 +0100
++++ mod/setup.data 2013-03-21 16:28:11.433935463 +0100
+@@ -146,6 +146,7 @@ hw_menu_entry: @hw-usb
+ usb_uirt_raw: "USB-UIRT"
+ mplay: "VLSystem MPlay Blast"
+ mplay: "VLSystem MPlay Mini"
++ zotac: "Zotac USB IR Receiver"
+
+ param_type: \
+ act200l \
+@@ -260,7 +261,8 @@ param_type: \
+ ttusbir \
+ tvbox \
+ udp \
+- wpc8769l
++ wpc8769l \
++ zotac
+ none:
+
+ default_param: \
+@@ -331,7 +333,8 @@ default_param: \
+ ttusbir \
+ tvbox \
+ udp \
+- wpc8769l
++ wpc8769l \
++ zotac
+ none:
+
+ default_param: \
diff --git a/app-misc/lirc/lirc-0.9.0-r2.ebuild b/app-misc/lirc/lirc-0.9.0-r2.ebuild
index bf56eefe91da..d59add563297 100644
--- a/app-misc/lirc/lirc-0.9.0-r2.ebuild
+++ b/app-misc/lirc/lirc-0.9.0-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/lirc-0.9.0-r2.ebuild,v 1.11 2013/05/24 16:31:01 axs Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/lirc-0.9.0-r2.ebuild,v 1.12 2013/08/27 18:22:28 axs Exp $
EAPI=4
@@ -65,7 +65,7 @@ IUSE_LIRC_DEVICES_DIRECT="
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"
+ uirt2_raw usb_uirt_raw usbx wpc8769l zotac"
# drivers that need special handling and
# must have another name specified for
@@ -94,7 +94,7 @@ LIRCDEV_BUILT_FOR_DEV="all
imon_knob imon_lcd imon_pad imon_rsc irdeo irdeo_remote knc_one
leadtek_pvr2000 nslu2 packard_bell parallel pixelview_bt878
provideo sa1100 sasem serial sir tekram tekram_bt829 ttusbir
- tvbox wpc8769l"
+ tvbox wpc8769l zotac"
#lirc_gpio drivers, which cannot be supported on kernel >= 2.6.22
LIRC_GPIO_DEV="
@@ -299,6 +299,8 @@ src_prepare() {
epatch "${FILESDIR}"/${P}-kernel-3.5-err-fix.patch
# Apply fix for missing __devinit __devexit defines in kernel 3.8+ (bug 461532)
epatch "${FILESDIR}"/${P}-kernel-3.8-fixes.patch
+ # Add support for zotac remote, bug 342848
+ epatch "${FILESDIR}"/${P}-add-zotac-support.patch
# Do not build drivers from the top-level Makefile
sed -i -e 's:\(SUBDIRS =\) drivers\(.*\):\1\2:' Makefile.am