49
49
static int tuner_attach_stv6110(struct ngene_channel *chan)
51
struct i2c_adapter *i2c;
51
52
struct stv090x_config *feconf = (struct stv090x_config *)
52
53
chan->dev->card_info->fe_config[chan->number];
53
54
struct stv6110x_config *tunerconf = (struct stv6110x_config *)
54
55
chan->dev->card_info->tuner_config[chan->number];
55
56
struct stv6110x_devctl *ctl;
57
ctl = dvb_attach(stv6110x_attach, chan->fe, tunerconf,
58
/* tuner 1+2: i2c adapter #0, tuner 3+4: i2c adapter #1 */
60
i2c = &chan->dev->channel[0].i2c_adapter;
62
i2c = &chan->dev->channel[1].i2c_adapter;
64
ctl = dvb_attach(stv6110x_attach, chan->fe, tunerconf, i2c);
60
66
printk(KERN_ERR DEVICE_NAME ": No STV6110X found!\n");
64
70
feconf->tuner_init = ctl->tuner_init;
71
feconf->tuner_sleep = ctl->tuner_sleep;
65
72
feconf->tuner_set_mode = ctl->tuner_set_mode;
66
73
feconf->tuner_set_frequency = ctl->tuner_set_frequency;
67
74
feconf->tuner_get_frequency = ctl->tuner_get_frequency;
79
86
static int demod_attach_stv0900(struct ngene_channel *chan)
88
struct i2c_adapter *i2c;
81
89
struct stv090x_config *feconf = (struct stv090x_config *)
82
90
chan->dev->card_info->fe_config[chan->number];
84
chan->fe = dvb_attach(stv090x_attach,
87
chan->number == 0 ? STV090x_DEMODULATOR_0 :
88
STV090x_DEMODULATOR_1);
92
/* tuner 1+2: i2c adapter #0, tuner 3+4: i2c adapter #1 */
93
/* Note: Both adapters share the same i2c bus, but the demod */
94
/* driver requires that each demod has its own i2c adapter */
96
i2c = &chan->dev->channel[0].i2c_adapter;
98
i2c = &chan->dev->channel[1].i2c_adapter;
100
chan->fe = dvb_attach(stv090x_attach, feconf, i2c,
101
(chan->number & 1) == 0 ? STV090x_DEMODULATOR_0
102
: STV090x_DEMODULATOR_1);
89
103
if (chan->fe == NULL) {
90
104
printk(KERN_ERR DEVICE_NAME ": No STV0900 found!\n");
94
if (!dvb_attach(lnbh24_attach, chan->fe, &chan->i2c_adapter, 0,
108
/* store channel info */
109
if (feconf->tuner_i2c_lock)
110
chan->fe->analog_demod_priv = chan;
112
if (!dvb_attach(lnbh24_attach, chan->fe, i2c, 0,
95
113
0, chan->dev->card_info->lnb[chan->number])) {
96
114
printk(KERN_ERR DEVICE_NAME ": No LNBH24 found!\n");
97
115
dvb_frontend_detach(chan->fe);
123
static void cineS2_tuner_i2c_lock(struct dvb_frontend *fe, int lock)
125
struct ngene_channel *chan = fe->analog_demod_priv;
128
down(&chan->dev->pll_mutex);
130
up(&chan->dev->pll_mutex);
133
static int cineS2_probe(struct ngene_channel *chan)
135
struct i2c_adapter *i2c;
136
struct stv090x_config *fe_conf;
138
struct i2c_msg i2c_msg = { .flags = 0, .buf = buf };
141
/* tuner 1+2: i2c adapter #0, tuner 3+4: i2c adapter #1 */
142
if (chan->number < 2)
143
i2c = &chan->dev->channel[0].i2c_adapter;
145
i2c = &chan->dev->channel[1].i2c_adapter;
147
fe_conf = chan->dev->card_info->fe_config[chan->number];
148
i2c_msg.addr = fe_conf->address;
154
rc = i2c_transfer(i2c, &i2c_msg, 1);
158
/* demod found, attach it */
159
rc = demod_attach_stv0900(chan);
160
if (rc < 0 || chan->number < 2)
163
/* demod #2: reprogram outputs DPN1 & DPN2 */
166
switch (chan->number) {
178
rc = i2c_transfer(i2c, &i2c_msg, 1);
180
printk(KERN_ERR DEVICE_NAME ": could not setup DPNx\n");
104
188
static struct lgdt330x_config aver_m780 = {
105
189
.demod_address = 0xb2 >> 1,
151
235
.adc2_range = STV090x_ADC_1Vpp,
153
237
.diseqc_envelope_mode = true,
239
.tuner_i2c_lock = cineS2_tuner_i2c_lock,
242
static struct stv090x_config fe_cineS2_2 = {
244
.demod_mode = STV090x_DUAL,
245
.clk_mode = STV090x_CLK_EXT,
250
.ts1_mode = STV090x_TSMODE_SERIAL_PUNCTURED,
251
.ts2_mode = STV090x_TSMODE_SERIAL_PUNCTURED,
253
.repeater_level = STV090x_RPTLEVEL_16,
255
.adc1_range = STV090x_ADC_1Vpp,
256
.adc2_range = STV090x_ADC_1Vpp,
258
.diseqc_envelope_mode = true,
260
.tuner_i2c_lock = cineS2_tuner_i2c_lock,
156
263
static struct stv6110x_config tuner_cineS2_0 = {
188
296
.tuner_config = {&tuner_cineS2_0, &tuner_cineS2_1},
189
297
.lnb = {0x0b, 0x08},
300
.msi_supported = true,
194
303
static struct ngene_info ngene_info_satixS2v2 = {
195
304
.type = NGENE_SIDEWINDER,
196
305
.name = "Mystique SaTiX-S2 Dual (v2)",
197
.io_type = {NGENE_IO_TSIN, NGENE_IO_TSIN},
198
.demod_attach = {demod_attach_stv0900, demod_attach_stv0900},
199
.tuner_attach = {tuner_attach_stv6110, tuner_attach_stv6110},
200
.fe_config = {&fe_cineS2, &fe_cineS2},
201
.tuner_config = {&tuner_cineS2_0, &tuner_cineS2_1},
306
.io_type = {NGENE_IO_TSIN, NGENE_IO_TSIN, NGENE_IO_TSIN, NGENE_IO_TSIN,
308
.demod_attach = {demod_attach_stv0900, demod_attach_stv0900, cineS2_probe, cineS2_probe},
309
.tuner_attach = {tuner_attach_stv6110, tuner_attach_stv6110, tuner_attach_stv6110, tuner_attach_stv6110},
310
.fe_config = {&fe_cineS2, &fe_cineS2, &fe_cineS2_2, &fe_cineS2_2},
311
.tuner_config = {&tuner_cineS2_0, &tuner_cineS2_1, &tuner_cineS2_0, &tuner_cineS2_1},
312
.lnb = {0x0a, 0x08, 0x0b, 0x09},
315
.msi_supported = true,
207
318
static struct ngene_info ngene_info_cineS2v5 = {
208
319
.type = NGENE_SIDEWINDER,
209
320
.name = "Linux4Media cineS2 DVB-S2 Twin Tuner (v5)",
210
.io_type = {NGENE_IO_TSIN, NGENE_IO_TSIN},
211
.demod_attach = {demod_attach_stv0900, demod_attach_stv0900},
212
.tuner_attach = {tuner_attach_stv6110, tuner_attach_stv6110},
213
.fe_config = {&fe_cineS2, &fe_cineS2},
214
.tuner_config = {&tuner_cineS2_0, &tuner_cineS2_1},
321
.io_type = {NGENE_IO_TSIN, NGENE_IO_TSIN, NGENE_IO_TSIN, NGENE_IO_TSIN,
323
.demod_attach = {demod_attach_stv0900, demod_attach_stv0900, cineS2_probe, cineS2_probe},
324
.tuner_attach = {tuner_attach_stv6110, tuner_attach_stv6110, tuner_attach_stv6110, tuner_attach_stv6110},
325
.fe_config = {&fe_cineS2, &fe_cineS2, &fe_cineS2_2, &fe_cineS2_2},
326
.tuner_config = {&tuner_cineS2_0, &tuner_cineS2_1, &tuner_cineS2_0, &tuner_cineS2_1},
327
.lnb = {0x0a, 0x08, 0x0b, 0x09},
330
.msi_supported = true,
220
334
static struct ngene_info ngene_info_duoFlexS2 = {
221
335
.type = NGENE_SIDEWINDER,
222
336
.name = "Digital Devices DuoFlex S2 miniPCIe",
223
.io_type = {NGENE_IO_TSIN, NGENE_IO_TSIN},
224
.demod_attach = {demod_attach_stv0900, demod_attach_stv0900},
225
.tuner_attach = {tuner_attach_stv6110, tuner_attach_stv6110},
226
.fe_config = {&fe_cineS2, &fe_cineS2},
227
.tuner_config = {&tuner_cineS2_0, &tuner_cineS2_1},
337
.io_type = {NGENE_IO_TSIN, NGENE_IO_TSIN, NGENE_IO_TSIN, NGENE_IO_TSIN,
339
.demod_attach = {cineS2_probe, cineS2_probe, cineS2_probe, cineS2_probe},
340
.tuner_attach = {tuner_attach_stv6110, tuner_attach_stv6110, tuner_attach_stv6110, tuner_attach_stv6110},
341
.fe_config = {&fe_cineS2, &fe_cineS2, &fe_cineS2_2, &fe_cineS2_2},
342
.tuner_config = {&tuner_cineS2_0, &tuner_cineS2_1, &tuner_cineS2_0, &tuner_cineS2_1},
343
.lnb = {0x0a, 0x08, 0x0b, 0x09},
346
.msi_supported = true,
233
349
static struct ngene_info ngene_info_m780 = {