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 <linux/signal.h>
22 #include <linux/sched.h>
23 #include <linux/interrupt.h>
28 #include "dvb_demux.h"
29 #include "dvb_frontend.h"
33 #include "mantis_common.h"
34 #include "mantis_ioc.h"
35 #include "mantis_dvb.h"
36 #include "mantis_vp1034.h"
37 #include "mantis_reg.h"
39 static const struct mb86a16_config vp1034_mb86a16_config = {
40 .demod_address = 0x08,
41 .set_voltage = vp1034_set_voltage,
44 #define MANTIS_MODEL_NAME "VP-1034"
45 #define MANTIS_DEV_TYPE "DVB-S/DSS"
47 int vp1034_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage)
49 struct mantis_pci *mantis = fe->dvb->priv;
53 dprintk(MANTIS_ERROR, 1, "Polarization=[13V]");
54 mantis_gpio_set_bits(mantis, 13, 1);
55 mantis_gpio_set_bits(mantis, 14, 0);
58 dprintk(MANTIS_ERROR, 1, "Polarization=[18V]");
59 mantis_gpio_set_bits(mantis, 13, 1);
60 mantis_gpio_set_bits(mantis, 14, 1);
63 dprintk(MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN");
66 dprintk(MANTIS_ERROR, 1, "Invalid = (%d)", (u32) voltage);
69 mmwrite(0x00, MANTIS_GPIF_DOUT);
74 static int vp1034_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *fe)
76 struct i2c_adapter *adapter = &mantis->adapter;
80 err = mantis_frontend_power(mantis, POWER_ON);
82 mantis_frontend_soft_reset(mantis);
85 dprintk(MANTIS_ERROR, 1, "Probing for MB86A16 (DVB-S/DSS)");
86 fe = dvb_attach(mb86a16_attach, &vp1034_mb86a16_config, adapter);
88 dprintk(MANTIS_ERROR, 1,
89 "found MB86A16 DVB-S/DSS frontend @0x%02x",
90 vp1034_mb86a16_config.demod_address);
96 dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>",
103 dprintk(MANTIS_ERROR, 1, "Done!");
108 struct mantis_hwconfig vp1034_config = {
109 .model_name = MANTIS_MODEL_NAME,
110 .dev_type = MANTIS_DEV_TYPE,
111 .ts_size = MANTIS_TS_204,
113 .baud_rate = MANTIS_BAUD_9600,
114 .parity = MANTIS_PARITY_NONE,
117 .frontend_init = vp1034_frontend_init,