diff options
author | Manu Abraham <devnull@localhost> | 2005-06-22 10:02:50 +0000 |
---|---|---|
committer | Manu Abraham <devnull@localhost> | 2005-06-22 10:02:50 +0000 |
commit | 1e5c36d757624601bd040a727c9bd75ca86f71a2 (patch) | |
tree | fd5dbe404f6de7f6fcc78f421110203a006cf613 /linux/drivers | |
parent | f7c7e6c5aff81450875557502e198e76babf229d (diff) | |
download | mediapointer-dvb-s2-1e5c36d757624601bd040a727c9bd75ca86f71a2.tar.gz mediapointer-dvb-s2-1e5c36d757624601bd040a727c9bd75ca86f71a2.tar.bz2 |
Set QAM size for DVB-C cards that do not autodetect QAM size
Signed-off-by Manu Abraham <manu@kromtek.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/dvb/bt8xx/dst.c | 102 | ||||
-rw-r--r-- | linux/drivers/media/dvb/bt8xx/dst_common.h | 1 |
2 files changed, 76 insertions, 27 deletions
diff --git a/linux/drivers/media/dvb/bt8xx/dst.c b/linux/drivers/media/dvb/bt8xx/dst.c index 776d1aacd..b6349ab12 100644 --- a/linux/drivers/media/dvb/bt8xx/dst.c +++ b/linux/drivers/media/dvb/bt8xx/dst.c @@ -367,35 +367,35 @@ static int dst_set_bandwidth(struct dst_state* state, fe_bandwidth_t bandwidth) return 0; switch (bandwidth) { - case BANDWIDTH_6_MHZ: - if (state->dst_hw_cap & DST_TYPE_HAS_CA) - state->tx_tuna[7] = 0x06; - else { - state->tx_tuna[6] = 0x06; - state->tx_tuna[7] = 0x00; - } - break; + case BANDWIDTH_6_MHZ: + if (state->dst_hw_cap & DST_TYPE_HAS_CA) + state->tx_tuna[7] = 0x06; + else { + state->tx_tuna[6] = 0x06; + state->tx_tuna[7] = 0x00; + } + break; - case BANDWIDTH_7_MHZ: - if (state->dst_hw_cap & DST_TYPE_HAS_CA) - state->tx_tuna[7] = 0x07; - else { - state->tx_tuna[6] = 0x07; - state->tx_tuna[7] = 0x00; - } - break; + case BANDWIDTH_7_MHZ: + if (state->dst_hw_cap & DST_TYPE_HAS_CA) + state->tx_tuna[7] = 0x07; + else { + state->tx_tuna[6] = 0x07; + state->tx_tuna[7] = 0x00; + } + break; - case BANDWIDTH_8_MHZ: - if (state->dst_hw_cap & DST_TYPE_HAS_CA) - state->tx_tuna[7] = 0x08; - else { - state->tx_tuna[6] = 0x08; - state->tx_tuna[7] = 0x00; - } - break; + case BANDWIDTH_8_MHZ: + if (state->dst_hw_cap & DST_TYPE_HAS_CA) + state->tx_tuna[7] = 0x08; + else { + state->tx_tuna[6] = 0x08; + state->tx_tuna[7] = 0x00; + } + break; - default: - return -EINVAL; + default: + return -EINVAL; } return 0; } @@ -467,6 +467,52 @@ static int dst_set_symbolrate(struct dst_state* state, u32 srate) return 0; } + +static int dst_set_modulation(struct dst_state *state, fe_modulation_t modulation) +{ + if (state->dst_type != DST_TYPE_IS_CABLE) + return 0; + + state->modulation = modulation; + switch (modulation) { + case QAM_16: + state->tx_tuna[8] = 0x10; + break; + + case QAM_32: + state->tx_tuna[8] = 0x20; + break; + + case QAM_64: + state->tx_tuna[8] = 0x40; + break; + + case QAM_128: + state->tx_tuna[8] = 0x80; + break; + + case QAM_256: + state->tx_tuna[8] = 0x00; + break; + + case QPSK: + case QAM_AUTO: + case VSB_8: + case VSB_16: + default: + return -EINVAL; + + } + + return 0; +} + +static fe_modulation_t dst_get_modulation(struct dst_state *state) +{ + return state->modulation; +} + + u8 dst_check_sum(u8 * buf, u32 len) { u32 i; @@ -1208,6 +1254,7 @@ static int dst_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_paramet } else if (state->dst_type == DST_TYPE_IS_CABLE) { dst_set_fec(state, p->u.qam.fec_inner); dst_set_symbolrate(state, p->u.qam.symbol_rate); + dst_set_modulation(state, p->u.qam.modulation); } dst_write_tuna(fe); @@ -1231,7 +1278,8 @@ static int dst_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_paramet } else if (state->dst_type == DST_TYPE_IS_CABLE) { p->u.qam.symbol_rate = state->symbol_rate; p->u.qam.fec_inner = dst_get_fec(state); - p->u.qam.modulation = QAM_AUTO; +// p->u.qam.modulation = QAM_AUTO; + p->u.qam.modulation = dst_get_modulation(state); } return 0; diff --git a/linux/drivers/media/dvb/bt8xx/dst_common.h b/linux/drivers/media/dvb/bt8xx/dst_common.h index 1c4d0aeb3..80bb399a8 100644 --- a/linux/drivers/media/dvb/bt8xx/dst_common.h +++ b/linux/drivers/media/dvb/bt8xx/dst_common.h @@ -111,6 +111,7 @@ struct dst_state { u32 dst_hw_cap; u8 dst_fw_version; fe_sec_mini_cmd_t minicmd; + fe_modulation_t modulation; u8 messages[256]; }; |