GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / media / dvb / mantis / mantis_input.c
bloba99489b8418b4e49890e1411020367571a63a325
1 /*
2 Mantis PCI bridge driver
4 Copyright (C) Manu Abraham (abraham.manu@gmail.com)
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <linux/input.h>
22 #include <media/ir-core.h>
23 #include <linux/pci.h>
25 #include "dmxdev.h"
26 #include "dvbdev.h"
27 #include "dvb_demux.h"
28 #include "dvb_frontend.h"
29 #include "dvb_net.h"
31 #include "mantis_common.h"
32 #include "mantis_reg.h"
33 #include "mantis_uart.h"
35 #define MODULE_NAME "mantis_core"
37 static struct ir_scancode mantis_ir_table[] = {
38 { 0x29, KEY_POWER },
39 { 0x28, KEY_FAVORITES },
40 { 0x30, KEY_TEXT },
41 { 0x17, KEY_INFO }, /* Preview */
42 { 0x23, KEY_EPG },
43 { 0x3b, KEY_F22 }, /* Record List */
44 { 0x3c, KEY_1 },
45 { 0x3e, KEY_2 },
46 { 0x39, KEY_3 },
47 { 0x36, KEY_4 },
48 { 0x22, KEY_5 },
49 { 0x20, KEY_6 },
50 { 0x32, KEY_7 },
51 { 0x26, KEY_8 },
52 { 0x24, KEY_9 },
53 { 0x2a, KEY_0 },
55 { 0x33, KEY_CANCEL },
56 { 0x2c, KEY_BACK },
57 { 0x15, KEY_CLEAR },
58 { 0x3f, KEY_TAB },
59 { 0x10, KEY_ENTER },
60 { 0x14, KEY_UP },
61 { 0x0d, KEY_RIGHT },
62 { 0x0e, KEY_DOWN },
63 { 0x11, KEY_LEFT },
65 { 0x21, KEY_VOLUMEUP },
66 { 0x35, KEY_VOLUMEDOWN },
67 { 0x3d, KEY_CHANNELDOWN },
68 { 0x3a, KEY_CHANNELUP },
69 { 0x2e, KEY_RECORD },
70 { 0x2b, KEY_PLAY },
71 { 0x13, KEY_PAUSE },
72 { 0x25, KEY_STOP },
74 { 0x1f, KEY_REWIND },
75 { 0x2d, KEY_FASTFORWARD },
76 { 0x1e, KEY_PREVIOUS }, /* Replay |< */
77 { 0x1d, KEY_NEXT }, /* Skip >| */
79 { 0x0b, KEY_CAMERA }, /* Capture */
80 { 0x0f, KEY_LANGUAGE }, /* SAP */
81 { 0x18, KEY_MODE }, /* PIP */
82 { 0x12, KEY_ZOOM }, /* Full screen */
83 { 0x1c, KEY_SUBTITLE },
84 { 0x2f, KEY_MUTE },
85 { 0x16, KEY_F20 }, /* L/R */
86 { 0x38, KEY_F21 }, /* Hibernate */
88 { 0x37, KEY_SWITCHVIDEOMODE }, /* A/V */
89 { 0x31, KEY_AGAIN }, /* Recall */
90 { 0x1a, KEY_KPPLUS }, /* Zoom+ */
91 { 0x19, KEY_KPMINUS }, /* Zoom- */
92 { 0x27, KEY_RED },
93 { 0x0C, KEY_GREEN },
94 { 0x01, KEY_YELLOW },
95 { 0x00, KEY_BLUE },
98 struct ir_scancode_table ir_mantis = {
99 .scan = mantis_ir_table,
100 .size = ARRAY_SIZE(mantis_ir_table),
102 EXPORT_SYMBOL_GPL(ir_mantis);
104 int mantis_input_init(struct mantis_pci *mantis)
106 struct input_dev *rc;
107 char name[80], dev[80];
108 int err;
110 rc = input_allocate_device();
111 if (!rc) {
112 dprintk(MANTIS_ERROR, 1, "Input device allocate failed");
113 return -ENOMEM;
116 sprintf(name, "Mantis %s IR receiver", mantis->hwconfig->model_name);
117 sprintf(dev, "pci-%s/ir0", pci_name(mantis->pdev));
119 rc->name = name;
120 rc->phys = dev;
122 rc->id.bustype = BUS_PCI;
123 rc->id.vendor = mantis->vendor_id;
124 rc->id.product = mantis->device_id;
125 rc->id.version = 1;
126 rc->dev = mantis->pdev->dev;
128 err = __ir_input_register(rc, &ir_mantis, NULL, MODULE_NAME);
129 if (err) {
130 dprintk(MANTIS_ERROR, 1, "IR device registration failed, ret = %d", err);
131 input_free_device(rc);
132 return -ENODEV;
135 mantis->rc = rc;
137 return 0;
140 int mantis_exit(struct mantis_pci *mantis)
142 struct input_dev *rc = mantis->rc;
144 ir_input_unregister(rc);
146 return 0;