aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2009-12-15 04:15:27 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-01-17 08:55:43 -0500
commit5dd83a35bea908ebb8243d67d8c251eed2bb5cc8 (patch)
tree59fb048f9735e4ca0ce44d27847eb181e3c718b3 /drivers/media
parent281859179f731b28aae78d13b2e8720219492000 (diff)
V4L/DVB (13801): [MB86A16] Use the search callback
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/mb86a16.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/drivers/media/dvb/frontends/mb86a16.c b/drivers/media/dvb/frontends/mb86a16.c
index eddb35baaf00..33387b78d85a 100644
--- a/drivers/media/dvb/frontends/mb86a16.c
+++ b/drivers/media/dvb/frontends/mb86a16.c
@@ -1487,16 +1487,19 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
1487 } else { 1487 } else {
1488 dprintk(verbose, MB86A16_INFO, 1, "NO -- SYNC"); 1488 dprintk(verbose, MB86A16_INFO, 1, "NO -- SYNC");
1489 SEQ_set(state, 1); 1489 SEQ_set(state, 1);
1490 ret = -1;
1490 } 1491 }
1491 } 1492 }
1492 } else { 1493 } else {
1493 dprintk (verbose, MB86A16_INFO, 1, "NO -- SIGNAL"); 1494 dprintk (verbose, MB86A16_INFO, 1, "NO -- SIGNAL");
1495 ret = -1;
1494 } 1496 }
1495 1497
1496 sync = sync_chk(state, &junk); 1498 sync = sync_chk(state, &junk);
1497 if (sync) { 1499 if (sync) {
1498 dprintk(verbose, MB86A16_INFO, 1, "******* SYNC *******"); 1500 dprintk(verbose, MB86A16_INFO, 1, "******* SYNC *******");
1499 freqerr_chk(state, state->frequency, state->srate, 1); 1501 freqerr_chk(state, state->frequency, state->srate, 1);
1502 ret = 0;
1500 break; 1503 break;
1501 } 1504 }
1502 } 1505 }
@@ -1610,33 +1613,21 @@ err:
1610 return -EREMOTEIO; 1613 return -EREMOTEIO;
1611} 1614}
1612 1615
1613#define MB86A16_FE_ALGO 1 1616static enum dvbfe_search mb86a16_search(struct dvb_frontend *fe,
1614 1617 struct dvb_frontend_parameters *p)
1615static int mb86a16_frontend_algo(struct dvb_frontend *fe)
1616{
1617 return MB86A16_FE_ALGO;
1618}
1619
1620static int mb86a16_set_frontend(struct dvb_frontend *fe,
1621 struct dvb_frontend_parameters *p,
1622 unsigned int mode_flags,
1623 int *delay,
1624 fe_status_t *status)
1625{ 1618{
1626 int ret = 0;
1627 struct mb86a16_state *state = fe->demodulator_priv; 1619 struct mb86a16_state *state = fe->demodulator_priv;
1628 1620
1629 if (p != NULL) { 1621 state->frequency = p->frequency / 1000;
1630 state->frequency = p->frequency / 1000; 1622 state->srate = p->u.qpsk.symbol_rate / 1000;
1631 state->srate = p->u.qpsk.symbol_rate / 1000;
1632 ret = mb86a16_set_fe(state);
1633 }
1634 if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
1635 mb86a16_read_status(fe, status);
1636 1623
1637 *delay = HZ/3000; 1624 if (!mb86a16_set_fe(state)) {
1625 dprintk(verbose, MB86A16_ERROR, 1, "Succesfully acquired LOCK");
1626 return DVBFE_ALGO_SEARCH_SUCCESS;
1627 }
1638 1628
1639 return ret; 1629 dprintk(verbose, MB86A16_ERROR, 1, "Lock acquisition failed!");
1630 return DVBFE_ALGO_SEARCH_FAILED;
1640} 1631}
1641 1632
1642static void mb86a16_release(struct dvb_frontend *fe) 1633static void mb86a16_release(struct dvb_frontend *fe)
@@ -1809,6 +1800,11 @@ static int mb86a16_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
1809 return 0; 1800 return 0;
1810} 1801}
1811 1802
1803static enum dvbfe_algo mb86a16_frontend_algo(struct dvb_frontend *fe)
1804{
1805 return DVBFE_ALGO_CUSTOM;
1806}
1807
1812static struct dvb_frontend_ops mb86a16_ops = { 1808static struct dvb_frontend_ops mb86a16_ops = {
1813 .info = { 1809 .info = {
1814 .name = "Fujitsu MB86A16 DVB-S", 1810 .name = "Fujitsu MB86A16 DVB-S",
@@ -1826,9 +1822,10 @@ static struct dvb_frontend_ops mb86a16_ops = {
1826 FE_CAN_FEC_AUTO 1822 FE_CAN_FEC_AUTO
1827 }, 1823 },
1828 .release = mb86a16_release, 1824 .release = mb86a16_release,
1829 .tune = mb86a16_set_frontend, 1825
1830 .read_status = mb86a16_read_status,
1831 .get_frontend_algo = mb86a16_frontend_algo, 1826 .get_frontend_algo = mb86a16_frontend_algo,
1827 .search = mb86a16_search,
1828 .read_status = mb86a16_read_status,
1832 .init = mb86a16_init, 1829 .init = mb86a16_init,
1833 .sleep = mb86a16_sleep, 1830 .sleep = mb86a16_sleep,
1834 .read_status = mb86a16_read_status, 1831 .read_status = mb86a16_read_status,