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.
17 #include <media/rc-core.h>
18 #include <linux/pci.h>
22 #include "dvb_demux.h"
23 #include "dvb_frontend.h"
26 #include "mantis_common.h"
27 #include "mantis_input.h"
29 #define MODULE_NAME "mantis_core"
31 void mantis_input_process(struct mantis_pci
*mantis
, int scancode
)
34 rc_keydown(mantis
->rc
, RC_TYPE_UNKNOWN
, scancode
, 0);
37 int mantis_input_init(struct mantis_pci
*mantis
)
42 dev
= rc_allocate_device();
44 dprintk(MANTIS_ERROR
, 1, "Remote device allocation failed");
49 snprintf(mantis
->input_name
, sizeof(mantis
->input_name
),
50 "Mantis %s IR receiver", mantis
->hwconfig
->model_name
);
51 snprintf(mantis
->input_phys
, sizeof(mantis
->input_phys
),
52 "pci-%s/ir0", pci_name(mantis
->pdev
));
54 dev
->input_name
= mantis
->input_name
;
55 dev
->input_phys
= mantis
->input_phys
;
56 dev
->input_id
.bustype
= BUS_PCI
;
57 dev
->input_id
.vendor
= mantis
->vendor_id
;
58 dev
->input_id
.product
= mantis
->device_id
;
59 dev
->input_id
.version
= 1;
60 dev
->driver_name
= MODULE_NAME
;
61 dev
->map_name
= mantis
->rc_map_name
? : RC_MAP_EMPTY
;
62 dev
->dev
.parent
= &mantis
->pdev
->dev
;
64 err
= rc_register_device(dev
);
66 dprintk(MANTIS_ERROR
, 1, "IR device registration failed, ret = %d", err
);
78 EXPORT_SYMBOL_GPL(mantis_input_init
);
80 void mantis_input_exit(struct mantis_pci
*mantis
)
82 rc_unregister_device(mantis
->rc
);
84 EXPORT_SYMBOL_GPL(mantis_input_exit
);