diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-26 13:26:49 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-31 06:49:12 -0500 |
commit | 5942c679a8a2cb95331501ff3b6965efed259408 (patch) | |
tree | 316ba5927b840de547934e174f1bbc094d11b189 /drivers/media/dvb/bt8xx/dst.c | |
parent | dfc6438410ebe2b9858aaf41376f35a0a68eeb4b (diff) |
[media] dst: convert set_fontend to use DVBv5 parameters
Instead of using dvb_frontend_parameters struct, that were
designed for a subset of the supported standards, use the DVBv5
cache information.
Also, fill the supported delivery systems at dvb_frontend_ops
struct.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/bt8xx/dst.c')
-rw-r--r-- | drivers/media/dvb/bt8xx/dst.c | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c index 6afc083ab72..7d60893108b 100644 --- a/drivers/media/dvb/bt8xx/dst.c +++ b/drivers/media/dvb/bt8xx/dst.c | |||
@@ -386,7 +386,7 @@ static int dst_set_freq(struct dst_state *state, u32 freq) | |||
386 | return 0; | 386 | return 0; |
387 | } | 387 | } |
388 | 388 | ||
389 | static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth) | 389 | static int dst_set_bandwidth(struct dst_state *state, u32 bandwidth) |
390 | { | 390 | { |
391 | state->bandwidth = bandwidth; | 391 | state->bandwidth = bandwidth; |
392 | 392 | ||
@@ -394,7 +394,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth) | |||
394 | return -EOPNOTSUPP; | 394 | return -EOPNOTSUPP; |
395 | 395 | ||
396 | switch (bandwidth) { | 396 | switch (bandwidth) { |
397 | case BANDWIDTH_6_MHZ: | 397 | case 6000000: |
398 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) | 398 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) |
399 | state->tx_tuna[7] = 0x06; | 399 | state->tx_tuna[7] = 0x06; |
400 | else { | 400 | else { |
@@ -402,7 +402,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth) | |||
402 | state->tx_tuna[7] = 0x00; | 402 | state->tx_tuna[7] = 0x00; |
403 | } | 403 | } |
404 | break; | 404 | break; |
405 | case BANDWIDTH_7_MHZ: | 405 | case 7000000: |
406 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) | 406 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) |
407 | state->tx_tuna[7] = 0x07; | 407 | state->tx_tuna[7] = 0x07; |
408 | else { | 408 | else { |
@@ -410,7 +410,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth) | |||
410 | state->tx_tuna[7] = 0x00; | 410 | state->tx_tuna[7] = 0x00; |
411 | } | 411 | } |
412 | break; | 412 | break; |
413 | case BANDWIDTH_8_MHZ: | 413 | case 8000000: |
414 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) | 414 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) |
415 | state->tx_tuna[7] = 0x08; | 415 | state->tx_tuna[7] = 0x08; |
416 | else { | 416 | else { |
@@ -1561,7 +1561,7 @@ static int dst_init(struct dvb_frontend *fe) | |||
1561 | state->tone = SEC_TONE_OFF; | 1561 | state->tone = SEC_TONE_OFF; |
1562 | state->diseq_flags = 0; | 1562 | state->diseq_flags = 0; |
1563 | state->k22 = 0x02; | 1563 | state->k22 = 0x02; |
1564 | state->bandwidth = BANDWIDTH_7_MHZ; | 1564 | state->bandwidth = 7000000; |
1565 | state->cur_jiff = jiffies; | 1565 | state->cur_jiff = jiffies; |
1566 | if (state->dst_type == DST_TYPE_IS_SAT) | 1566 | if (state->dst_type == DST_TYPE_IS_SAT) |
1567 | memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_VLF) ? sat_tuna_188 : sat_tuna_204), sizeof (sat_tuna_204)); | 1567 | memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_VLF) ? sat_tuna_188 : sat_tuna_204), sizeof (sat_tuna_204)); |
@@ -1609,8 +1609,9 @@ static int dst_read_snr(struct dvb_frontend *fe, u16 *snr) | |||
1609 | return retval; | 1609 | return retval; |
1610 | } | 1610 | } |
1611 | 1611 | ||
1612 | static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) | 1612 | static int dst_set_frontend(struct dvb_frontend *fe) |
1613 | { | 1613 | { |
1614 | struct dtv_frontend_properties *p = &fe->dtv_property_cache; | ||
1614 | int retval = -EINVAL; | 1615 | int retval = -EINVAL; |
1615 | struct dst_state *state = fe->demodulator_priv; | 1616 | struct dst_state *state = fe->demodulator_priv; |
1616 | 1617 | ||
@@ -1623,17 +1624,17 @@ static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet | |||
1623 | if (state->dst_type == DST_TYPE_IS_SAT) { | 1624 | if (state->dst_type == DST_TYPE_IS_SAT) { |
1624 | if (state->type_flags & DST_TYPE_HAS_OBS_REGS) | 1625 | if (state->type_flags & DST_TYPE_HAS_OBS_REGS) |
1625 | dst_set_inversion(state, p->inversion); | 1626 | dst_set_inversion(state, p->inversion); |
1626 | dst_set_fec(state, p->u.qpsk.fec_inner); | 1627 | dst_set_fec(state, p->fec_inner); |
1627 | dst_set_symbolrate(state, p->u.qpsk.symbol_rate); | 1628 | dst_set_symbolrate(state, p->symbol_rate); |
1628 | dst_set_polarization(state); | 1629 | dst_set_polarization(state); |
1629 | dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->u.qpsk.symbol_rate); | 1630 | dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->symbol_rate); |
1630 | 1631 | ||
1631 | } else if (state->dst_type == DST_TYPE_IS_TERR) | 1632 | } else if (state->dst_type == DST_TYPE_IS_TERR) |
1632 | dst_set_bandwidth(state, p->u.ofdm.bandwidth); | 1633 | dst_set_bandwidth(state, p->bandwidth_hz); |
1633 | else if (state->dst_type == DST_TYPE_IS_CABLE) { | 1634 | else if (state->dst_type == DST_TYPE_IS_CABLE) { |
1634 | dst_set_fec(state, p->u.qam.fec_inner); | 1635 | dst_set_fec(state, p->fec_inner); |
1635 | dst_set_symbolrate(state, p->u.qam.symbol_rate); | 1636 | dst_set_symbolrate(state, p->symbol_rate); |
1636 | dst_set_modulation(state, p->u.qam.modulation); | 1637 | dst_set_modulation(state, p->modulation); |
1637 | } | 1638 | } |
1638 | retval = dst_write_tuna(fe); | 1639 | retval = dst_write_tuna(fe); |
1639 | } | 1640 | } |
@@ -1683,7 +1684,7 @@ static int dst_get_tuning_algo(struct dvb_frontend *fe) | |||
1683 | return dst_algo ? DVBFE_ALGO_HW : DVBFE_ALGO_SW; | 1684 | return dst_algo ? DVBFE_ALGO_HW : DVBFE_ALGO_SW; |
1684 | } | 1685 | } |
1685 | 1686 | ||
1686 | static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) | 1687 | static int dst_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p) |
1687 | { | 1688 | { |
1688 | struct dst_state *state = fe->demodulator_priv; | 1689 | struct dst_state *state = fe->demodulator_priv; |
1689 | 1690 | ||
@@ -1691,14 +1692,14 @@ static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet | |||
1691 | if (state->dst_type == DST_TYPE_IS_SAT) { | 1692 | if (state->dst_type == DST_TYPE_IS_SAT) { |
1692 | if (state->type_flags & DST_TYPE_HAS_OBS_REGS) | 1693 | if (state->type_flags & DST_TYPE_HAS_OBS_REGS) |
1693 | p->inversion = state->inversion; | 1694 | p->inversion = state->inversion; |
1694 | p->u.qpsk.symbol_rate = state->symbol_rate; | 1695 | p->symbol_rate = state->symbol_rate; |
1695 | p->u.qpsk.fec_inner = dst_get_fec(state); | 1696 | p->fec_inner = dst_get_fec(state); |
1696 | } else if (state->dst_type == DST_TYPE_IS_TERR) { | 1697 | } else if (state->dst_type == DST_TYPE_IS_TERR) { |
1697 | p->u.ofdm.bandwidth = state->bandwidth; | 1698 | p->bandwidth_hz = state->bandwidth; |
1698 | } else if (state->dst_type == DST_TYPE_IS_CABLE) { | 1699 | } else if (state->dst_type == DST_TYPE_IS_CABLE) { |
1699 | p->u.qam.symbol_rate = state->symbol_rate; | 1700 | p->symbol_rate = state->symbol_rate; |
1700 | p->u.qam.fec_inner = dst_get_fec(state); | 1701 | p->fec_inner = dst_get_fec(state); |
1701 | p->u.qam.modulation = dst_get_modulation(state); | 1702 | p->modulation = dst_get_modulation(state); |
1702 | } | 1703 | } |
1703 | 1704 | ||
1704 | return 0; | 1705 | return 0; |
@@ -1756,7 +1757,7 @@ struct dst_state *dst_attach(struct dst_state *state, struct dvb_adapter *dvb_ad | |||
1756 | EXPORT_SYMBOL(dst_attach); | 1757 | EXPORT_SYMBOL(dst_attach); |
1757 | 1758 | ||
1758 | static struct dvb_frontend_ops dst_dvbt_ops = { | 1759 | static struct dvb_frontend_ops dst_dvbt_ops = { |
1759 | 1760 | .delsys = { SYS_DVBT }, | |
1760 | .info = { | 1761 | .info = { |
1761 | .name = "DST DVB-T", | 1762 | .name = "DST DVB-T", |
1762 | .type = FE_OFDM, | 1763 | .type = FE_OFDM, |
@@ -1777,8 +1778,8 @@ static struct dvb_frontend_ops dst_dvbt_ops = { | |||
1777 | .release = dst_release, | 1778 | .release = dst_release, |
1778 | .init = dst_init, | 1779 | .init = dst_init, |
1779 | .tune = dst_tune_frontend, | 1780 | .tune = dst_tune_frontend, |
1780 | .set_frontend_legacy = dst_set_frontend, | 1781 | .set_frontend = dst_set_frontend, |
1781 | .get_frontend_legacy = dst_get_frontend, | 1782 | .get_frontend = dst_get_frontend, |
1782 | .get_frontend_algo = dst_get_tuning_algo, | 1783 | .get_frontend_algo = dst_get_tuning_algo, |
1783 | .read_status = dst_read_status, | 1784 | .read_status = dst_read_status, |
1784 | .read_signal_strength = dst_read_signal_strength, | 1785 | .read_signal_strength = dst_read_signal_strength, |
@@ -1786,7 +1787,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = { | |||
1786 | }; | 1787 | }; |
1787 | 1788 | ||
1788 | static struct dvb_frontend_ops dst_dvbs_ops = { | 1789 | static struct dvb_frontend_ops dst_dvbs_ops = { |
1789 | 1790 | .delsys = { SYS_DVBS }, | |
1790 | .info = { | 1791 | .info = { |
1791 | .name = "DST DVB-S", | 1792 | .name = "DST DVB-S", |
1792 | .type = FE_QPSK, | 1793 | .type = FE_QPSK, |
@@ -1803,8 +1804,8 @@ static struct dvb_frontend_ops dst_dvbs_ops = { | |||
1803 | .release = dst_release, | 1804 | .release = dst_release, |
1804 | .init = dst_init, | 1805 | .init = dst_init, |
1805 | .tune = dst_tune_frontend, | 1806 | .tune = dst_tune_frontend, |
1806 | .set_frontend_legacy = dst_set_frontend, | 1807 | .set_frontend = dst_set_frontend, |
1807 | .get_frontend_legacy = dst_get_frontend, | 1808 | .get_frontend = dst_get_frontend, |
1808 | .get_frontend_algo = dst_get_tuning_algo, | 1809 | .get_frontend_algo = dst_get_tuning_algo, |
1809 | .read_status = dst_read_status, | 1810 | .read_status = dst_read_status, |
1810 | .read_signal_strength = dst_read_signal_strength, | 1811 | .read_signal_strength = dst_read_signal_strength, |
@@ -1816,7 +1817,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = { | |||
1816 | }; | 1817 | }; |
1817 | 1818 | ||
1818 | static struct dvb_frontend_ops dst_dvbc_ops = { | 1819 | static struct dvb_frontend_ops dst_dvbc_ops = { |
1819 | 1820 | .delsys = { SYS_DVBC_ANNEX_A }, | |
1820 | .info = { | 1821 | .info = { |
1821 | .name = "DST DVB-C", | 1822 | .name = "DST DVB-C", |
1822 | .type = FE_QAM, | 1823 | .type = FE_QAM, |
@@ -1837,8 +1838,8 @@ static struct dvb_frontend_ops dst_dvbc_ops = { | |||
1837 | .release = dst_release, | 1838 | .release = dst_release, |
1838 | .init = dst_init, | 1839 | .init = dst_init, |
1839 | .tune = dst_tune_frontend, | 1840 | .tune = dst_tune_frontend, |
1840 | .set_frontend_legacy = dst_set_frontend, | 1841 | .set_frontend = dst_set_frontend, |
1841 | .get_frontend_legacy = dst_get_frontend, | 1842 | .get_frontend = dst_get_frontend, |
1842 | .get_frontend_algo = dst_get_tuning_algo, | 1843 | .get_frontend_algo = dst_get_tuning_algo, |
1843 | .read_status = dst_read_status, | 1844 | .read_status = dst_read_status, |
1844 | .read_signal_strength = dst_read_signal_strength, | 1845 | .read_signal_strength = dst_read_signal_strength, |
@@ -1860,8 +1861,8 @@ static struct dvb_frontend_ops dst_atsc_ops = { | |||
1860 | .release = dst_release, | 1861 | .release = dst_release, |
1861 | .init = dst_init, | 1862 | .init = dst_init, |
1862 | .tune = dst_tune_frontend, | 1863 | .tune = dst_tune_frontend, |
1863 | .set_frontend_legacy = dst_set_frontend, | 1864 | .set_frontend = dst_set_frontend, |
1864 | .get_frontend_legacy = dst_get_frontend, | 1865 | .get_frontend = dst_get_frontend, |
1865 | .get_frontend_algo = dst_get_tuning_algo, | 1866 | .get_frontend_algo = dst_get_tuning_algo, |
1866 | .read_status = dst_read_status, | 1867 | .read_status = dst_read_status, |
1867 | .read_signal_strength = dst_read_signal_strength, | 1868 | .read_signal_strength = dst_read_signal_strength, |