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 #if 0 /* Currently unused */
23 #include <media/rc-core.h>
24 #include <linux/pci.h>
28 #include "dvb_demux.h"
29 #include "dvb_frontend.h"
32 #include "mantis_common.h"
33 #include "mantis_reg.h"
34 #include "mantis_uart.h"
36 #define MODULE_NAME "mantis_core"
37 #define RC_MAP_MANTIS "rc-mantis"
39 static struct rc_map_table mantis_ir_table
[] = {
41 { 0x28, KEY_FAVORITES
},
43 { 0x17, KEY_INFO
}, /* Preview */
45 { 0x3b, KEY_F22
}, /* Record List */
67 { 0x21, KEY_VOLUMEUP
},
68 { 0x35, KEY_VOLUMEDOWN
},
69 { 0x3d, KEY_CHANNELDOWN
},
70 { 0x3a, KEY_CHANNELUP
},
77 { 0x2d, KEY_FASTFORWARD
},
78 { 0x1e, KEY_PREVIOUS
}, /* Replay |< */
79 { 0x1d, KEY_NEXT
}, /* Skip >| */
81 { 0x0b, KEY_CAMERA
}, /* Capture */
82 { 0x0f, KEY_LANGUAGE
}, /* SAP */
83 { 0x18, KEY_MODE
}, /* PIP */
84 { 0x12, KEY_ZOOM
}, /* Full screen */
85 { 0x1c, KEY_SUBTITLE
},
87 { 0x16, KEY_F20
}, /* L/R */
88 { 0x38, KEY_F21
}, /* Hibernate */
90 { 0x37, KEY_SWITCHVIDEOMODE
}, /* A/V */
91 { 0x31, KEY_AGAIN
}, /* Recall */
92 { 0x1a, KEY_KPPLUS
}, /* Zoom+ */
93 { 0x19, KEY_KPMINUS
}, /* Zoom- */
100 static struct rc_map_list ir_mantis_map
= {
102 .scan
= mantis_ir_table
,
103 .size
= ARRAY_SIZE(mantis_ir_table
),
104 .rc_type
= RC_TYPE_UNKNOWN
,
105 .name
= RC_MAP_MANTIS
,
109 int mantis_input_init(struct mantis_pci
*mantis
)
114 err
= rc_map_register(&ir_mantis_map
);
118 dev
= rc_allocate_device();
120 dprintk(MANTIS_ERROR
, 1, "Remote device allocation failed");
125 sprintf(mantis
->input_name
, "Mantis %s IR receiver", mantis
->hwconfig
->model_name
);
126 sprintf(mantis
->input_phys
, "pci-%s/ir0", pci_name(mantis
->pdev
));
128 dev
->input_name
= mantis
->input_name
;
129 dev
->input_phys
= mantis
->input_phys
;
130 dev
->input_id
.bustype
= BUS_PCI
;
131 dev
->input_id
.vendor
= mantis
->vendor_id
;
132 dev
->input_id
.product
= mantis
->device_id
;
133 dev
->input_id
.version
= 1;
134 dev
->driver_name
= MODULE_NAME
;
135 dev
->map_name
= RC_MAP_MANTIS
;
136 dev
->dev
.parent
= &mantis
->pdev
->dev
;
138 err
= rc_register_device(dev
);
140 dprintk(MANTIS_ERROR
, 1, "IR device registration failed, ret = %d", err
);
150 rc_map_unregister(&ir_mantis_map
);
155 int mantis_init_exit(struct mantis_pci
*mantis
)
157 rc_unregister_device(mantis
->rc
);
158 rc_map_unregister(&ir_mantis_map
);