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 <media/rc-core.h>
22 #include <linux/pci.h>
26 #include "dvb_demux.h"
27 #include "dvb_frontend.h"
30 #include "mantis_common.h"
31 #include "mantis_reg.h"
32 #include "mantis_uart.h"
34 #define MODULE_NAME "mantis_core"
35 #define RC_MAP_MANTIS "rc-mantis"
37 static struct rc_map_table mantis_ir_table
[] = {
39 { 0x28, KEY_FAVORITES
},
41 { 0x17, KEY_INFO
}, /* Preview */
43 { 0x3b, KEY_F22
}, /* Record List */
65 { 0x21, KEY_VOLUMEUP
},
66 { 0x35, KEY_VOLUMEDOWN
},
67 { 0x3d, KEY_CHANNELDOWN
},
68 { 0x3a, KEY_CHANNELUP
},
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
},
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- */
98 static struct rc_map_list ir_mantis_map
= {
100 .scan
= mantis_ir_table
,
101 .size
= ARRAY_SIZE(mantis_ir_table
),
102 .rc_type
= RC_TYPE_UNKNOWN
,
103 .name
= RC_MAP_MANTIS
,
107 int mantis_input_init(struct mantis_pci
*mantis
)
112 err
= rc_map_register(&ir_mantis_map
);
116 dev
= rc_allocate_device();
118 dprintk(MANTIS_ERROR
, 1, "Remote device allocation failed");
123 sprintf(mantis
->input_name
, "Mantis %s IR receiver", mantis
->hwconfig
->model_name
);
124 sprintf(mantis
->input_phys
, "pci-%s/ir0", pci_name(mantis
->pdev
));
126 dev
->input_name
= mantis
->input_name
;
127 dev
->input_phys
= mantis
->input_phys
;
128 dev
->input_id
.bustype
= BUS_PCI
;
129 dev
->input_id
.vendor
= mantis
->vendor_id
;
130 dev
->input_id
.product
= mantis
->device_id
;
131 dev
->input_id
.version
= 1;
132 dev
->driver_name
= MODULE_NAME
;
133 dev
->map_name
= RC_MAP_MANTIS
;
134 dev
->dev
.parent
= &mantis
->pdev
->dev
;
136 err
= rc_register_device(dev
);
138 dprintk(MANTIS_ERROR
, 1, "IR device registration failed, ret = %d", err
);
148 rc_map_unregister(&ir_mantis_map
);
153 int mantis_exit(struct mantis_pci
*mantis
)
155 rc_unregister_device(mantis
->rc
);
156 rc_map_unregister(&ir_mantis_map
);