aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-11-17 07:58:09 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 05:16:49 -0500
commitbce8d0fe4af4b3a1e46e66cd6116d6389ad0cc22 (patch)
tree8192bf86a9249e54fcc9b37da11791ae17ae401f /drivers/media/rc
parent1697c8dfba72fd182d670a68dca157f64dd3b1f2 (diff)
[media] rc: remove ir-common module
Something weird happened with commit 740069e6e043403199dbe2b42256722fb814f6ae. Instead of dong the right thing, it got somehow corrupted and reverted the rc changes. Thanks to David Härdeman for pointing me about the problem. This patch should be merged with 740069e6e04 before sending upstream. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/Kconfig5
-rw-r--r--drivers/media/rc/Makefile2
-rw-r--r--drivers/media/rc/ir-functions.c120
3 files changed, 0 insertions, 127 deletions
diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
index 2d1546889c9b..ef19375899ec 100644
--- a/drivers/media/rc/Kconfig
+++ b/drivers/media/rc/Kconfig
@@ -10,11 +10,6 @@ menuconfig IR_CORE
10 if you don't need IR, as otherwise, you may not be able to 10 if you don't need IR, as otherwise, you may not be able to
11 compile the driver for your adapter. 11 compile the driver for your adapter.
12 12
13config IR_LEGACY
14 tristate
15 depends on IR_CORE
16 default IR_CORE
17
18if IR_CORE 13if IR_CORE
19 14
20config LIRC 15config LIRC
diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
index 859c12cc03ff..8c0e4cb19551 100644
--- a/drivers/media/rc/Makefile
+++ b/drivers/media/rc/Makefile
@@ -1,10 +1,8 @@
1ir-common-objs := ir-functions.o
2rc-core-objs := rc-main.o rc-raw.o 1rc-core-objs := rc-main.o rc-raw.o
3 2
4obj-y += keymaps/ 3obj-y += keymaps/
5 4
6obj-$(CONFIG_IR_CORE) += rc-core.o 5obj-$(CONFIG_IR_CORE) += rc-core.o
7obj-$(CONFIG_IR_LEGACY) += ir-common.o
8obj-$(CONFIG_LIRC) += lirc_dev.o 6obj-$(CONFIG_LIRC) += lirc_dev.o
9obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o 7obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o
10obj-$(CONFIG_IR_RC5_DECODER) += ir-rc5-decoder.o 8obj-$(CONFIG_IR_RC5_DECODER) += ir-rc5-decoder.o
diff --git a/drivers/media/rc/ir-functions.c b/drivers/media/rc/ir-functions.c
deleted file mode 100644
index 14397d0541d8..000000000000
--- a/drivers/media/rc/ir-functions.c
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 * some common functions to handle infrared remote protocol decoding for
3 * drivers which have not yet been (or can't be) converted to use the
4 * regular protocol decoders...
5 *
6 * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#include <linux/module.h>
24#include <linux/string.h>
25#include <linux/jiffies.h>
26#include <media/ir-common.h>
27#include "rc-core-priv.h"
28
29/* -------------------------------------------------------------------------- */
30
31MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
32MODULE_LICENSE("GPL");
33
34/* RC5 decoding stuff, moved from bttv-input.c to share it with
35 * saa7134 */
36
37/* decode raw bit pattern to RC5 code */
38static u32 ir_rc5_decode(unsigned int code)
39{
40 unsigned int org_code = code;
41 unsigned int pair;
42 unsigned int rc5 = 0;
43 int i;
44
45 for (i = 0; i < 14; ++i) {
46 pair = code & 0x3;
47 code >>= 2;
48
49 rc5 <<= 1;
50 switch (pair) {
51 case 0:
52 case 2:
53 break;
54 case 1:
55 rc5 |= 1;
56 break;
57 case 3:
58 IR_dprintk(1, "ir-common: ir_rc5_decode(%x) bad code\n", org_code);
59 return 0;
60 }
61 }
62 IR_dprintk(1, "ir-common: code=%x, rc5=%x, start=%x, toggle=%x, address=%x, "
63 "instr=%x\n", rc5, org_code, RC5_START(rc5),
64 RC5_TOGGLE(rc5), RC5_ADDR(rc5), RC5_INSTR(rc5));
65 return rc5;
66}
67
68void ir_rc5_timer_end(unsigned long data)
69{
70 struct card_ir *ir = (struct card_ir *)data;
71 struct timeval tv;
72 unsigned long current_jiffies;
73 u32 gap;
74 u32 rc5 = 0;
75
76 /* get time */
77 current_jiffies = jiffies;
78 do_gettimeofday(&tv);
79
80 /* avoid overflow with gap >1s */
81 if (tv.tv_sec - ir->base_time.tv_sec > 1) {
82 gap = 200000;
83 } else {
84 gap = 1000000 * (tv.tv_sec - ir->base_time.tv_sec) +
85 tv.tv_usec - ir->base_time.tv_usec;
86 }
87
88 /* signal we're ready to start a new code */
89 ir->active = 0;
90
91 /* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */
92 if (gap < 28000) {
93 IR_dprintk(1, "ir-common: spurious timer_end\n");
94 return;
95 }
96
97 if (ir->last_bit < 20) {
98 /* ignore spurious codes (caused by light/other remotes) */
99 IR_dprintk(1, "ir-common: short code: %x\n", ir->code);
100 } else {
101 ir->code = (ir->code << ir->shift_by) | 1;
102 rc5 = ir_rc5_decode(ir->code);
103
104 /* two start bits? */
105 if (RC5_START(rc5) != ir->start) {
106 IR_dprintk(1, "ir-common: rc5 start bits invalid: %u\n", RC5_START(rc5));
107
108 /* right address? */
109 } else if (RC5_ADDR(rc5) == ir->addr) {
110 u32 toggle = RC5_TOGGLE(rc5);
111 u32 instr = RC5_INSTR(rc5);
112
113 /* Good code */
114 ir_keydown(ir->dev, instr, toggle);
115 IR_dprintk(1, "ir-common: instruction %x, toggle %x\n",
116 instr, toggle);
117 }
118 }
119}
120EXPORT_SYMBOL_GPL(ir_rc5_timer_end);