1 // SPDX-License-Identifier: GPL-2.0-or-later
5 Copyright (C) Manu Abraham (abraham.manu@gmail.com)
9 #include <linux/signal.h>
10 #include <linux/sched.h>
11 #include <linux/interrupt.h>
14 #include <media/dmxdev.h>
15 #include <media/dvbdev.h>
16 #include <media/dvb_demux.h>
17 #include <media/dvb_frontend.h>
18 #include <media/dvb_net.h>
21 #include "mantis_common.h"
22 #include "mantis_ioc.h"
23 #include "mantis_dvb.h"
24 #include "mantis_vp1034.h"
25 #include "mantis_reg.h"
27 static const struct mb86a16_config vp1034_mb86a16_config = {
28 .demod_address = 0x08,
29 .set_voltage = vp1034_set_voltage,
32 #define MANTIS_MODEL_NAME "VP-1034"
33 #define MANTIS_DEV_TYPE "DVB-S/DSS"
35 int vp1034_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage)
37 struct mantis_pci *mantis = fe->dvb->priv;
41 dprintk(MANTIS_ERROR, 1, "Polarization=[13V]");
42 mantis_gpio_set_bits(mantis, 13, 1);
43 mantis_gpio_set_bits(mantis, 14, 0);
46 dprintk(MANTIS_ERROR, 1, "Polarization=[18V]");
47 mantis_gpio_set_bits(mantis, 13, 1);
48 mantis_gpio_set_bits(mantis, 14, 1);
51 dprintk(MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN");
54 dprintk(MANTIS_ERROR, 1, "Invalid = (%d)", (u32) voltage);
57 mmwrite(0x00, MANTIS_GPIF_DOUT);
62 static int vp1034_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *fe)
64 struct i2c_adapter *adapter = &mantis->adapter;
68 err = mantis_frontend_power(mantis, POWER_ON);
70 mantis_frontend_soft_reset(mantis);
73 dprintk(MANTIS_ERROR, 1, "Probing for MB86A16 (DVB-S/DSS)");
74 fe = dvb_attach(mb86a16_attach, &vp1034_mb86a16_config, adapter);
76 dprintk(MANTIS_ERROR, 1,
77 "found MB86A16 DVB-S/DSS frontend @0x%02x",
78 vp1034_mb86a16_config.demod_address);
84 dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>",
91 dprintk(MANTIS_ERROR, 1, "Done!");
96 struct mantis_hwconfig vp1034_config = {
97 .model_name = MANTIS_MODEL_NAME,
98 .dev_type = MANTIS_DEV_TYPE,
99 .ts_size = MANTIS_TS_204,
101 .baud_rate = MANTIS_BAUD_9600,
102 .parity = MANTIS_PARITY_NONE,
105 .frontend_init = vp1034_frontend_init,