diff options
Diffstat (limited to 'drivers/media/dvb/mantis/mantis_vp1041.c')
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp1041.c | 79 |
1 files changed, 69 insertions, 10 deletions
diff --git a/drivers/media/dvb/mantis/mantis_vp1041.c b/drivers/media/dvb/mantis/mantis_vp1041.c index 90df80b80e11..1181fad3b27b 100644 --- a/drivers/media/dvb/mantis/mantis_vp1041.c +++ b/drivers/media/dvb/mantis/mantis_vp1041.c | |||
@@ -18,24 +18,31 @@ | |||
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <asm/irq.h> | ||
22 | #include <linux/signal.h> | ||
23 | #include <linux/sched.h> | ||
24 | #include <linux/interrupt.h> | ||
25 | |||
26 | #include "dmxdev.h" | ||
27 | #include "dvbdev.h" | ||
28 | #include "dvb_demux.h" | ||
29 | #include "dvb_frontend.h" | ||
30 | #include "dvb_net.h" | ||
31 | |||
21 | #include "mantis_common.h" | 32 | #include "mantis_common.h" |
33 | #include "mantis_ioc.h" | ||
34 | #include "mantis_dvb.h" | ||
22 | #include "mantis_vp1041.h" | 35 | #include "mantis_vp1041.h" |
23 | #include "stb0899_reg.h" | 36 | #include "stb0899_reg.h" |
37 | #include "stb0899_drv.h" | ||
24 | #include "stb0899_cfg.h" | 38 | #include "stb0899_cfg.h" |
25 | #include "stb6100_cfg.h" | 39 | #include "stb6100_cfg.h" |
40 | #include "stb6100.h" | ||
41 | #include "lnbp21.h" | ||
26 | 42 | ||
27 | #define MANTIS_MODEL_NAME "VP-1041" | 43 | #define MANTIS_MODEL_NAME "VP-1041" |
28 | #define MANTIS_DEV_TYPE "DSS/DVB-S/DVB-S2" | 44 | #define MANTIS_DEV_TYPE "DSS/DVB-S/DVB-S2" |
29 | 45 | ||
30 | struct mantis_hwconfig vp1041_mantis_config = { | ||
31 | .model_name = MANTIS_MODEL_NAME, | ||
32 | .dev_type = MANTIS_DEV_TYPE, | ||
33 | .ts_size = MANTIS_TS_188, | ||
34 | .baud_rate = MANTIS_BAUD_9600, | ||
35 | .parity = MANTIS_PARITY_NONE, | ||
36 | .bytes = 0, | ||
37 | }; | ||
38 | |||
39 | static const struct stb0899_s1_reg vp1041_stb0899_s1_init_1[] = { | 46 | static const struct stb0899_s1_reg vp1041_stb0899_s1_init_1[] = { |
40 | 47 | ||
41 | // 0x0000000b , /* SYSREG */ | 48 | // 0x0000000b , /* SYSREG */ |
@@ -258,7 +265,7 @@ static const struct stb0899_s1_reg vp1041_stb0899_s1_init_3[] = { | |||
258 | { 0xffff , 0xff }, | 265 | { 0xffff , 0xff }, |
259 | }; | 266 | }; |
260 | 267 | ||
261 | struct stb0899_config vp1041_config = { | 268 | struct stb0899_config vp1041_stb0899_config = { |
262 | .init_dev = vp1041_stb0899_s1_init_1, | 269 | .init_dev = vp1041_stb0899_s1_init_1, |
263 | .init_s2_demod = stb0899_s2_init_2, | 270 | .init_s2_demod = stb0899_s2_init_2, |
264 | .init_s1_demod = vp1041_stb0899_s1_init_3, | 271 | .init_s1_demod = vp1041_stb0899_s1_init_3, |
@@ -299,3 +306,55 @@ struct stb6100_config vp1041_stb6100_config = { | |||
299 | .tuner_address = 0x60, | 306 | .tuner_address = 0x60, |
300 | .refclock = 27000000, | 307 | .refclock = 27000000, |
301 | }; | 308 | }; |
309 | |||
310 | static int vp1041_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *fe) | ||
311 | { | ||
312 | struct i2c_adapter *adapter = &mantis->adapter; | ||
313 | |||
314 | int err = 0; | ||
315 | |||
316 | err = mantis_frontend_power(mantis, POWER_ON); | ||
317 | if (err == 0) { | ||
318 | mantis_frontend_soft_reset(mantis); | ||
319 | msleep(250); | ||
320 | mantis->fe = stb0899_attach(&vp1041_stb0899_config, adapter); | ||
321 | if (mantis->fe) { | ||
322 | dprintk(MANTIS_ERROR, 1, | ||
323 | "found STB0899 DVB-S/DVB-S2 frontend @0x%02x", | ||
324 | vp1041_stb0899_config.demod_address); | ||
325 | |||
326 | if (stb6100_attach(mantis->fe, &vp1041_stb6100_config, adapter)) { | ||
327 | if (!lnbp21_attach(mantis->fe, adapter, 0, 0)) { | ||
328 | printk("%s: No LNBP21 found!\n", __func__); | ||
329 | } | ||
330 | } | ||
331 | } else { | ||
332 | return -EREMOTEIO; | ||
333 | } | ||
334 | } else { | ||
335 | dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>", | ||
336 | adapter->name, | ||
337 | err); | ||
338 | |||
339 | return -EIO; | ||
340 | } | ||
341 | |||
342 | |||
343 | dprintk(MANTIS_ERROR, 1, "Done!"); | ||
344 | |||
345 | return 0; | ||
346 | } | ||
347 | |||
348 | struct mantis_hwconfig vp1041_config = { | ||
349 | .model_name = MANTIS_MODEL_NAME, | ||
350 | .dev_type = MANTIS_DEV_TYPE, | ||
351 | .ts_size = MANTIS_TS_188, | ||
352 | |||
353 | .baud_rate = MANTIS_BAUD_9600, | ||
354 | .parity = MANTIS_PARITY_NONE, | ||
355 | .bytes = 0, | ||
356 | |||
357 | .frontend_init = vp1041_frontend_init, | ||
358 | .power = GPIF_A12, | ||
359 | .reset = GPIF_A13, | ||
360 | }; | ||