2 * Driver for Dummy Frontend
4 * Written by Emard <emard@softhome.net>
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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
22 #include <linux/module.h>
23 #include <linux/init.h>
25 #include "dvb_frontend.h"
30 /* depending on module parameter sct deliver different infos
33 static struct dvb_frontend_info dvb_s_dummyfe_info = {
34 .name = "DVB-S dummy frontend",
36 .frequency_min = 950000,
37 .frequency_max = 2150000,
38 .frequency_stepsize = 250, /* kHz for QPSK frontends */
39 .frequency_tolerance = 29500,
40 .symbol_rate_min = 1000000,
41 .symbol_rate_max = 45000000,
42 /* .symbol_rate_tolerance = ???,*/
43 .notifier_delay = 50, /* 1/20 s */
44 .caps = FE_CAN_INVERSION_AUTO |
45 FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
46 FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
50 static struct dvb_frontend_info dvb_c_dummyfe_info = {
51 .name = "DVB-C dummy frontend",
53 .frequency_stepsize = 62500,
54 .frequency_min = 51000000,
55 .frequency_max = 858000000,
56 .symbol_rate_min = (57840000/2)/64, /* SACLK/64 == (XIN/2)/64 */
57 .symbol_rate_max = (57840000/2)/4, /* SACLK/4 */
59 .frequency_tolerance = ???,
60 .symbol_rate_tolerance = ???, /* ppm */ /* == 8% (spec p. 5) */
63 .caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 |
64 FE_CAN_QAM_128 | FE_CAN_QAM_256 |
65 FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO
68 static struct dvb_frontend_info dvb_t_dummyfe_info = {
69 .name = "DVB-T dummy frontend",
72 .frequency_max = 863250000,
73 .frequency_stepsize = 62500,
74 /*.frequency_tolerance = */ /* FIXME: 12% of SR */
75 .symbol_rate_min = 0, /* FIXME */
76 .symbol_rate_max = 9360000, /* FIXME */
77 .symbol_rate_tolerance = 4000,
79 .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
80 FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
81 FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |
82 FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
83 FE_CAN_TRANSMISSION_MODE_AUTO |
84 FE_CAN_GUARD_INTERVAL_AUTO |
85 FE_CAN_HIERARCHY_AUTO,
88 struct dvb_frontend_info *frontend_info(void)
93 return &dvb_t_dummyfe_info;
95 return &dvb_c_dummyfe_info;
98 return &dvb_s_dummyfe_info;
103 static int dvbdummyfe_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
107 memcpy (arg, frontend_info(),
108 sizeof(struct dvb_frontend_info));
113 fe_status_t *status = arg;
114 *status = FE_HAS_SIGNAL
124 u32 *ber = (u32 *) arg;
129 case FE_READ_SIGNAL_STRENGTH:
132 *((u16*) arg) = (signal << 8) | signal;
139 *(u16*) arg = (snr << 8) | snr;
143 case FE_READ_UNCORRECTED_BLOCKS:
147 case FE_SET_FRONTEND:
150 case FE_GET_FRONTEND:
172 static int dvbdummyfe_attach (struct dvb_i2c_bus *i2c, void **data)
174 return dvb_register_frontend (dvbdummyfe_ioctl, i2c, NULL, frontend_info());
178 static void dvbdummyfe_detach (struct dvb_i2c_bus *i2c, void *data)
180 dvb_unregister_frontend (dvbdummyfe_ioctl, i2c);
184 static int __init init_dvbdummyfe (void)
186 return dvb_register_i2c_device (THIS_MODULE,
192 static void __exit exit_dvbdummyfe (void)
194 dvb_unregister_i2c_device (dvbdummyfe_attach);
198 module_init(init_dvbdummyfe);
199 module_exit(exit_dvbdummyfe);
202 MODULE_DESCRIPTION("DVB DUMMY Frontend");
203 MODULE_AUTHOR("Emard");
204 MODULE_LICENSE("GPL");
205 MODULE_PARM(sct, "i");