aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2006-06-21 09:27:26 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 01:05:15 -0400
commit8cfba6301c3c7e0d3332e237b99fefc0db001163 (patch)
tree4c04d234e7c232a2ca8a0a9bf46f0a7f7afbb4e0 /drivers/media/dvb
parent2e506a0faff0caa62e4c9531611684ff61cf1ca4 (diff)
V4L/DVB (4159): Implement tuning algorithm as a module parameter
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/bt8xx/dst.c52
1 files changed, 47 insertions, 5 deletions
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c
index 2346667721bc..df97210b6b5a 100644
--- a/drivers/media/dvb/bt8xx/dst.c
+++ b/drivers/media/dvb/bt8xx/dst.c
@@ -38,6 +38,10 @@ static unsigned int dst_addons;
38module_param(dst_addons, int, 0644); 38module_param(dst_addons, int, 0644);
39MODULE_PARM_DESC(dst_addons, "CA daughterboard, default is 0 (No addons)"); 39MODULE_PARM_DESC(dst_addons, "CA daughterboard, default is 0 (No addons)");
40 40
41static unsigned int dst_algo;
42module_param(dst_algo, int, 0644);
43MODULE_PARM_DESC(dst_algo, "tuning algo: default is 0=(SW), 1=(HW)");
44
41#define HAS_LOCK 1 45#define HAS_LOCK 1
42#define ATTEMPT_TUNE 2 46#define ATTEMPT_TUNE 2
43#define HAS_POWER 4 47#define HAS_POWER 4
@@ -1360,7 +1364,36 @@ static int dst_read_snr(struct dvb_frontend *fe, u16 *snr)
1360 return 0; 1364 return 0;
1361} 1365}
1362 1366
1363static int dst_set_frontend(struct dvb_frontend* fe, 1367static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
1368{
1369 struct dst_state *state = fe->demodulator_priv;
1370
1371 if (p != NULL) {
1372 dst_set_freq(state, p->frequency);
1373 dprintk(verbose, DST_DEBUG, 1, "Set Frequency=[%d]", p->frequency);
1374
1375 if (state->dst_type == DST_TYPE_IS_SAT) {
1376 if (state->type_flags & DST_TYPE_HAS_OBS_REGS)
1377 dst_set_inversion(state, p->inversion);
1378 dst_set_fec(state, p->u.qpsk.fec_inner);
1379 dst_set_symbolrate(state, p->u.qpsk.symbol_rate);
1380 dst_set_polarization(state);
1381 dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->u.qpsk.symbol_rate);
1382
1383 } else if (state->dst_type == DST_TYPE_IS_TERR)
1384 dst_set_bandwidth(state, p->u.ofdm.bandwidth);
1385 else if (state->dst_type == DST_TYPE_IS_CABLE) {
1386 dst_set_fec(state, p->u.qam.fec_inner);
1387 dst_set_symbolrate(state, p->u.qam.symbol_rate);
1388 dst_set_modulation(state, p->u.qam.modulation);
1389 }
1390 dst_write_tuna(fe);
1391 }
1392
1393 return 0;
1394}
1395
1396static int dst_tune_frontend(struct dvb_frontend* fe,
1364 struct dvb_frontend_parameters* p, 1397 struct dvb_frontend_parameters* p,
1365 unsigned int mode_flags, 1398 unsigned int mode_flags,
1366 int *delay, 1399 int *delay,
@@ -1397,6 +1430,11 @@ static int dst_set_frontend(struct dvb_frontend* fe,
1397 return 0; 1430 return 0;
1398} 1431}
1399 1432
1433static int dst_get_tuning_algo(struct dvb_frontend *fe)
1434{
1435 return dst_algo;
1436}
1437
1400static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) 1438static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
1401{ 1439{
1402 struct dst_state *state = fe->demodulator_priv; 1440 struct dst_state *state = fe->demodulator_priv;
@@ -1476,7 +1514,8 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
1476 1514
1477 .release = dst_release, 1515 .release = dst_release,
1478 .init = dst_init, 1516 .init = dst_init,
1479 .tune = dst_set_frontend, 1517 .tune = dst_tune_frontend,
1518 .set_frontend = dst_set_frontend,
1480 .get_frontend = dst_get_frontend, 1519 .get_frontend = dst_get_frontend,
1481 .read_status = dst_read_status, 1520 .read_status = dst_read_status,
1482 .read_signal_strength = dst_read_signal_strength, 1521 .read_signal_strength = dst_read_signal_strength,
@@ -1500,7 +1539,8 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
1500 1539
1501 .release = dst_release, 1540 .release = dst_release,
1502 .init = dst_init, 1541 .init = dst_init,
1503 .tune = dst_set_frontend, 1542 .tune = dst_tune_frontend,
1543 .set_frontend = dst_set_frontend,
1504 .get_frontend = dst_get_frontend, 1544 .get_frontend = dst_get_frontend,
1505 .read_status = dst_read_status, 1545 .read_status = dst_read_status,
1506 .read_signal_strength = dst_read_signal_strength, 1546 .read_signal_strength = dst_read_signal_strength,
@@ -1527,7 +1567,8 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
1527 1567
1528 .release = dst_release, 1568 .release = dst_release,
1529 .init = dst_init, 1569 .init = dst_init,
1530 .tune = dst_set_frontend, 1570 .tune = dst_tune_frontend,
1571 .set_frontend = dst_set_frontend,
1531 .get_frontend = dst_get_frontend, 1572 .get_frontend = dst_get_frontend,
1532 .read_status = dst_read_status, 1573 .read_status = dst_read_status,
1533 .read_signal_strength = dst_read_signal_strength, 1574 .read_signal_strength = dst_read_signal_strength,
@@ -1548,7 +1589,8 @@ static struct dvb_frontend_ops dst_atsc_ops = {
1548 1589
1549 .release = dst_release, 1590 .release = dst_release,
1550 .init = dst_init, 1591 .init = dst_init,
1551 .tune = dst_set_frontend, 1592 .tune = dst_tune_frontend,
1593 .set_frontend = dst_set_frontend,
1552 .get_frontend = dst_get_frontend, 1594 .get_frontend = dst_get_frontend,
1553 .read_status = dst_read_status, 1595 .read_status = dst_read_status,
1554 .read_signal_strength = dst_read_signal_strength, 1596 .read_signal_strength = dst_read_signal_strength,