70 for (i = f; i < f+
count; i++)
78 vp702x_fe_refresh_state(st);
97 vp702x_fe_refresh_state(st);
103 static int vp702x_fe_read_unc_blocks(
struct dvb_frontend* fe,
u32 *unc)
106 vp702x_fe_refresh_state(st);
111 static int vp702x_fe_read_signal_strength(
struct dvb_frontend* fe,
u16 *strength)
114 vp702x_fe_refresh_state(st);
116 *strength = (st->
sig << 8) | st->
sig;
124 vp702x_fe_refresh_state(st);
126 _snr = (st->
snr & 0x1f) * 0xff / 0x1f;
127 *snr = (_snr << 8) | _snr;
138 static int vp702x_fe_set_frontend(
struct dvb_frontend *fe)
154 cmd[0] = (freq >> 8) & 0x7f;
155 cmd[1] = freq & 0xff;
160 cmd[3] = (sr >> 12) & 0xff;
161 cmd[4] = (sr >> 4) & 0xff;
162 cmd[5] = (sr << 4) & 0xf0;
164 deb_fe(
"setting frontend to: %u -> %u (%x) LNB-based GHz, symbolrate: %d -> %lu (%lx)\n",
166 (
unsigned long) sr, (
unsigned long) sr);
183 cmd[7] = vp702x_chksum(cmd,0,7);
190 if (cmd[2] == 0 && cmd[3] == 0)
191 deb_fe(
"tuning failed.\n");
193 deb_fe(
"tuning succeeded.\n");
214 static int vp702x_fe_send_diseqc_msg (
struct dvb_frontend* fe,
232 cmd[7] = vp702x_chksum(cmd, 0, 7);
236 if (cmd[2] == 0 && cmd[3] == 0)
237 deb_fe(
"diseqc cmd failed.\n");
239 deb_fe(
"diseqc cmd succeeded.\n");
275 if (buf[2] == 0 && buf[3] == 0)
276 deb_fe(
"set_tone cmd failed.\n");
278 deb_fe(
"set_tone cmd succeeded.\n");
308 if (buf[2] == 0 && buf[3] == 0)
309 deb_fe(
"set_voltage cmd failed.\n");
311 deb_fe(
"set_voltage cmd succeeded.\n");
334 s->
fe.demodulator_priv =
s;
348 .name =
"Twinhan DST-like frontend (VP7021/VP7020) DVB-S",
349 .frequency_min = 950000,
350 .frequency_max = 2150000,
351 .frequency_stepsize = 1000,
352 .frequency_tolerance = 0,
353 .symbol_rate_min = 1000000,
354 .symbol_rate_max = 45000000,
355 .symbol_rate_tolerance = 500,
361 .release = vp702x_fe_release,
363 .init = vp702x_fe_init,
364 .sleep = vp702x_fe_sleep,
366 .set_frontend = vp702x_fe_set_frontend,
367 .get_tune_settings = vp702x_fe_get_tune_settings,
369 .read_status = vp702x_fe_read_status,
370 .read_ber = vp702x_fe_read_ber,
371 .read_signal_strength = vp702x_fe_read_signal_strength,
372 .read_snr = vp702x_fe_read_snr,
373 .read_ucblocks = vp702x_fe_read_unc_blocks,
375 .diseqc_send_master_cmd = vp702x_fe_send_diseqc_msg,
376 .diseqc_send_burst = vp702x_fe_send_diseqc_burst,
377 .set_tone = vp702x_fe_set_tone,
378 .set_voltage = vp702x_fe_set_voltage,