blob: c9c947911627ff170f5fea5c50e34a4725a48d58 [file] [log] [blame]
Manu Abraham41e840b2009-12-02 21:57:10 -03001/*
2 Mantis VP-1034 driver
3
4 Copyright (C) 2005, 2006 Manu Abraham (abraham.manu@gmail.com)
5
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.
10
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.
15
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.
19*/
20
21#include "mantis_common.h"
22#include "mantis_vp1034.h"
23
24struct mb86a16_config vp1034_config = {
25 .demod_address = 0x08,
26 .set_voltage = vp1034_set_voltage,
27};
28
Manu Abrahamdf0cca12009-12-02 22:07:24 -030029#define MANTIS_MODEL_NAME "VP-1034"
30#define MANTIS_DEV_TYPE "DVB-S/DSS"
31
32struct mantis_hwconfig vp1034_mantis_config = {
33 .model_name = MANTIS_MODEL_NAME,
34 .dev_type = MANTIS_DEV_TYPE,
35};
36
Manu Abraham41e840b2009-12-02 21:57:10 -030037int vp1034_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
38{
39 struct mantis_pci *mantis = fe->dvb->priv;
40
41 switch (voltage) {
42 case SEC_VOLTAGE_13:
43 mmwrite((mmread(MANTIS_GPIF_ADDR)) | voltage, MANTIS_GPIF_ADDR);
44 dprintk(verbose, MANTIS_ERROR, 1, "Polarization=[13V]");
45 break;
46 case SEC_VOLTAGE_18:
47 mmwrite((mmread(MANTIS_GPIF_ADDR)) & voltage, MANTIS_GPIF_ADDR);
48 dprintk(verbose, MANTIS_ERROR, 1, "Polarization=[18V]");
49 break;
50 case SEC_VOLTAGE_OFF:
51 dprintk(verbose, MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN");
52 break;
53 default:
54 dprintk(verbose, MANTIS_ERROR, 1, "Invalid = (%d)", (u32 ) voltage);
55 return -EINVAL;
56 }
57 mmwrite(0x00, MANTIS_GPIF_DOUT);
58
59 return 0;
60}