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-common.h>
23 #include <linux/pci.h>
27 #include "dvb_demux.h"
28 #include "dvb_frontend.h"
31 #include "mantis_common.h"
32 #include "mantis_reg.h"
33 #include "mantis_uart.h"
35 static struct ir_scancode mantis_ir_table[] = {
37 { 0x28, KEY_FAVORITES },
39 { 0x17, KEY_INFO }, /* Preview */
41 { 0x3b, KEY_F22 }, /* Record List */
63 { 0x21, KEY_VOLUMEUP },
64 { 0x35, KEY_VOLUMEDOWN },
65 { 0x3d, KEY_CHANNELDOWN },
66 { 0x3a, KEY_CHANNELUP },
73 { 0x2d, KEY_FASTFORWARD },
74 { 0x1e, KEY_PREVIOUS }, /* Replay |< */
75 { 0x1d, KEY_NEXT }, /* Skip >| */
77 { 0x0b, KEY_CAMERA }, /* Capture */
78 { 0x0f, KEY_LANGUAGE }, /* SAP */
79 { 0x18, KEY_MODE }, /* PIP */
80 { 0x12, KEY_ZOOM }, /* Full screen */
81 { 0x1c, KEY_SUBTITLE },
83 { 0x16, KEY_F20 }, /* L/R */
84 { 0x38, KEY_F21 }, /* Hibernate */
86 { 0x37, KEY_SWITCHVIDEOMODE }, /* A/V */
87 { 0x31, KEY_AGAIN }, /* Recall */
88 { 0x1a, KEY_KPPLUS }, /* Zoom+ */
89 { 0x19, KEY_KPMINUS }, /* Zoom- */
96 struct ir_scancode_table ir_mantis = {
97 .scan = mantis_ir_table,
98 .size = ARRAY_SIZE(mantis_ir_table),
100 EXPORT_SYMBOL_GPL(ir_mantis);
102 int mantis_input_init(struct mantis_pci *mantis)
104 struct input_dev *rc;
105 struct ir_input_state rc_state;
106 char name[80], dev[80];
109 rc = input_allocate_device();
111 dprintk(MANTIS_ERROR, 1, "Input device allocate failed");
115 sprintf(name, "Mantis %s IR receiver", mantis->hwconfig->model_name);
116 sprintf(dev, "pci-%s/ir0", pci_name(mantis->pdev));
121 ir_input_init(rc, &rc_state, IR_TYPE_OTHER);
123 rc->id.bustype = BUS_PCI;
124 rc->id.vendor = mantis->vendor_id;
125 rc->id.product = mantis->device_id;
127 rc->dev = mantis->pdev->dev;
129 err = ir_input_register(rc, &ir_mantis, NULL);
131 dprintk(MANTIS_ERROR, 1, "IR device registration failed, ret = %d", err);
132 input_free_device(rc);
141 int mantis_exit(struct mantis_pci *mantis)
143 struct input_dev *rc = mantis->rc;
145 ir_input_unregister(rc);