aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/bt8xx/dst.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/bt8xx/dst.c')
-rw-r--r--drivers/media/dvb/bt8xx/dst.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c
index caa4e18ed1c1..430b3eb11815 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
389static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth) 389static 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
1612static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) 1612static 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 }
@@ -1642,31 +1643,32 @@ static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
1642} 1643}
1643 1644
1644static int dst_tune_frontend(struct dvb_frontend* fe, 1645static int dst_tune_frontend(struct dvb_frontend* fe,
1645 struct dvb_frontend_parameters* p, 1646 bool re_tune,
1646 unsigned int mode_flags, 1647 unsigned int mode_flags,
1647 unsigned int *delay, 1648 unsigned int *delay,
1648 fe_status_t *status) 1649 fe_status_t *status)
1649{ 1650{
1650 struct dst_state *state = fe->demodulator_priv; 1651 struct dst_state *state = fe->demodulator_priv;
1652 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
1651 1653
1652 if (p != NULL) { 1654 if (re_tune) {
1653 dst_set_freq(state, p->frequency); 1655 dst_set_freq(state, p->frequency);
1654 dprintk(verbose, DST_DEBUG, 1, "Set Frequency=[%d]", p->frequency); 1656 dprintk(verbose, DST_DEBUG, 1, "Set Frequency=[%d]", p->frequency);
1655 1657
1656 if (state->dst_type == DST_TYPE_IS_SAT) { 1658 if (state->dst_type == DST_TYPE_IS_SAT) {
1657 if (state->type_flags & DST_TYPE_HAS_OBS_REGS) 1659 if (state->type_flags & DST_TYPE_HAS_OBS_REGS)
1658 dst_set_inversion(state, p->inversion); 1660 dst_set_inversion(state, p->inversion);
1659 dst_set_fec(state, p->u.qpsk.fec_inner); 1661 dst_set_fec(state, p->fec_inner);
1660 dst_set_symbolrate(state, p->u.qpsk.symbol_rate); 1662 dst_set_symbolrate(state, p->symbol_rate);
1661 dst_set_polarization(state); 1663 dst_set_polarization(state);
1662 dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->u.qpsk.symbol_rate); 1664 dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->symbol_rate);
1663 1665
1664 } else if (state->dst_type == DST_TYPE_IS_TERR) 1666 } else if (state->dst_type == DST_TYPE_IS_TERR)
1665 dst_set_bandwidth(state, p->u.ofdm.bandwidth); 1667 dst_set_bandwidth(state, p->bandwidth_hz);
1666 else if (state->dst_type == DST_TYPE_IS_CABLE) { 1668 else if (state->dst_type == DST_TYPE_IS_CABLE) {
1667 dst_set_fec(state, p->u.qam.fec_inner); 1669 dst_set_fec(state, p->fec_inner);
1668 dst_set_symbolrate(state, p->u.qam.symbol_rate); 1670 dst_set_symbolrate(state, p->symbol_rate);
1669 dst_set_modulation(state, p->u.qam.modulation); 1671 dst_set_modulation(state, p->modulation);
1670 } 1672 }
1671 dst_write_tuna(fe); 1673 dst_write_tuna(fe);
1672 } 1674 }
@@ -1683,22 +1685,23 @@ static int dst_get_tuning_algo(struct dvb_frontend *fe)
1683 return dst_algo ? DVBFE_ALGO_HW : DVBFE_ALGO_SW; 1685 return dst_algo ? DVBFE_ALGO_HW : DVBFE_ALGO_SW;
1684} 1686}
1685 1687
1686static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) 1688static int dst_get_frontend(struct dvb_frontend *fe)
1687{ 1689{
1690 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
1688 struct dst_state *state = fe->demodulator_priv; 1691 struct dst_state *state = fe->demodulator_priv;
1689 1692
1690 p->frequency = state->decode_freq; 1693 p->frequency = state->decode_freq;
1691 if (state->dst_type == DST_TYPE_IS_SAT) { 1694 if (state->dst_type == DST_TYPE_IS_SAT) {
1692 if (state->type_flags & DST_TYPE_HAS_OBS_REGS) 1695 if (state->type_flags & DST_TYPE_HAS_OBS_REGS)
1693 p->inversion = state->inversion; 1696 p->inversion = state->inversion;
1694 p->u.qpsk.symbol_rate = state->symbol_rate; 1697 p->symbol_rate = state->symbol_rate;
1695 p->u.qpsk.fec_inner = dst_get_fec(state); 1698 p->fec_inner = dst_get_fec(state);
1696 } else if (state->dst_type == DST_TYPE_IS_TERR) { 1699 } else if (state->dst_type == DST_TYPE_IS_TERR) {
1697 p->u.ofdm.bandwidth = state->bandwidth; 1700 p->bandwidth_hz = state->bandwidth;
1698 } else if (state->dst_type == DST_TYPE_IS_CABLE) { 1701 } else if (state->dst_type == DST_TYPE_IS_CABLE) {
1699 p->u.qam.symbol_rate = state->symbol_rate; 1702 p->symbol_rate = state->symbol_rate;
1700 p->u.qam.fec_inner = dst_get_fec(state); 1703 p->fec_inner = dst_get_fec(state);
1701 p->u.qam.modulation = dst_get_modulation(state); 1704 p->modulation = dst_get_modulation(state);
1702 } 1705 }
1703 1706
1704 return 0; 1707 return 0;
@@ -1756,10 +1759,9 @@ struct dst_state *dst_attach(struct dst_state *state, struct dvb_adapter *dvb_ad
1756EXPORT_SYMBOL(dst_attach); 1759EXPORT_SYMBOL(dst_attach);
1757 1760
1758static struct dvb_frontend_ops dst_dvbt_ops = { 1761static struct dvb_frontend_ops dst_dvbt_ops = {
1759 1762 .delsys = { SYS_DVBT },
1760 .info = { 1763 .info = {
1761 .name = "DST DVB-T", 1764 .name = "DST DVB-T",
1762 .type = FE_OFDM,
1763 .frequency_min = 137000000, 1765 .frequency_min = 137000000,
1764 .frequency_max = 858000000, 1766 .frequency_max = 858000000,
1765 .frequency_stepsize = 166667, 1767 .frequency_stepsize = 166667,
@@ -1786,10 +1788,9 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
1786}; 1788};
1787 1789
1788static struct dvb_frontend_ops dst_dvbs_ops = { 1790static struct dvb_frontend_ops dst_dvbs_ops = {
1789 1791 .delsys = { SYS_DVBS },
1790 .info = { 1792 .info = {
1791 .name = "DST DVB-S", 1793 .name = "DST DVB-S",
1792 .type = FE_QPSK,
1793 .frequency_min = 950000, 1794 .frequency_min = 950000,
1794 .frequency_max = 2150000, 1795 .frequency_max = 2150000,
1795 .frequency_stepsize = 1000, /* kHz for QPSK frontends */ 1796 .frequency_stepsize = 1000, /* kHz for QPSK frontends */
@@ -1816,10 +1817,9 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
1816}; 1817};
1817 1818
1818static struct dvb_frontend_ops dst_dvbc_ops = { 1819static 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 .frequency_stepsize = 62500, 1823 .frequency_stepsize = 62500,
1824 .frequency_min = 51000000, 1824 .frequency_min = 51000000,
1825 .frequency_max = 858000000, 1825 .frequency_max = 858000000,
@@ -1846,9 +1846,9 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
1846}; 1846};
1847 1847
1848static struct dvb_frontend_ops dst_atsc_ops = { 1848static struct dvb_frontend_ops dst_atsc_ops = {
1849 .delsys = { SYS_ATSC },
1849 .info = { 1850 .info = {
1850 .name = "DST ATSC", 1851 .name = "DST ATSC",
1851 .type = FE_ATSC,
1852 .frequency_stepsize = 62500, 1852 .frequency_stepsize = 62500,
1853 .frequency_min = 510000000, 1853 .frequency_min = 510000000,
1854 .frequency_max = 858000000, 1854 .frequency_max = 858000000,