4 Copyright (C) 2005, 2006 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 "mantis_common.h"
22 #include "mantis_vp1033.h"
24 u8 lgtdqcs001f_inittab[] = {
69 struct stv0299_config lgtdqcs001f_config = {
70 .demod_address = 0x68,
71 .inittab = lgtdqcs001f_inittab,
75 // .enhanced_tuning = 0,
77 // .lock_output = STV0229_LOCKOUTPUT_0,
78 .volt13_op0_op1 = STV0299_VOLT13_OP0,
80 .set_symbol_rate = lgtdqcs001f_set_symbol_rate,
81 // .pll_set = lgtdqcs001f_pll_set,
84 #define MANTIS_MODEL_NAME "VP-1033"
85 #define MANTIS_DEV_TYPE "DVB-S/DSS"
87 struct mantis_hwconfig vp1033_mantis_config = {
88 .model_name = MANTIS_MODEL_NAME,
89 .dev_type = MANTIS_DEV_TYPE,
90 .ts_size = MANTIS_TS_204,
93 int lgtdqcs001f_tuner_set(struct dvb_frontend *fe,
94 struct dvb_frontend_parameters *params)
99 struct mantis_pci *mantis = fe->dvb->priv;
101 struct i2c_msg msg = {
107 div = params->frequency / 250;
109 buf[0] = (div >> 8) & 0x7f;
114 if (params->frequency < 1531000)
118 if (i2c_transfer(&mantis->adapter, &msg, 1) < 0) {
119 dprintk(verbose, MANTIS_ERROR, 1, "Write: I2C Transfer failed");
122 msleep_interruptible(100);
127 int lgtdqcs001f_set_symbol_rate(struct dvb_frontend *fe,
128 u32 srate, u32 ratio)
133 if (srate < 1500000) {
136 } else if (srate < 3000000) {
139 } else if (srate < 7000000) {
142 } else if (srate < 14000000) {
145 } else if (srate < 30000000) {
148 } else if (srate < 45000000) {
152 stv0299_writereg (fe, 0x13, aclk);
153 stv0299_writereg (fe, 0x14, bclk);
155 stv0299_writereg (fe, 0x1f, (ratio >> 16) & 0xff);
156 stv0299_writereg (fe, 0x20, (ratio >> 8) & 0xff);
157 stv0299_writereg (fe, 0x21, (ratio ) & 0xf0);