diff options
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/bt8xx/dst.c | 53 |
1 files changed, 16 insertions, 37 deletions
diff --git a/linux/drivers/media/dvb/bt8xx/dst.c b/linux/drivers/media/dvb/bt8xx/dst.c index 3d8c57859..5dc20ce19 100644 --- a/linux/drivers/media/dvb/bt8xx/dst.c +++ b/linux/drivers/media/dvb/bt8xx/dst.c @@ -322,8 +322,6 @@ EXPORT_SYMBOL(read_dst); static int dst_set_freq(struct dst_state *state, u32 freq) { - u8 *val; - state->frequency = freq; if (debug > 4) dprintk("%s: set Frequency %u\n", __FUNCTION__, freq); @@ -332,46 +330,28 @@ static int dst_set_freq(struct dst_state *state, u32 freq) freq = freq / 1000; if (freq < 950 || freq > 2150) return -EINVAL; - val = &state->tx_tuna[0]; - val[2] = (freq >> 8) & 0x7f; - val[3] = (u8) freq; - val[4] = 1; - val[8] &= ~4; - if (freq < 1531) - val[8] |= 4; + state->tx_tuna[2] = (freq >> 8); + state->tx_tuna[3] = (u8) freq; + state->tx_tuna[4] = 0x01; + state->tx_tuna[8] &= ~0x04; + if (state->type_flags & DST_TYPE_HAS_OBS_REGS) { + if (freq < 1531) + state->tx_tuna[8] |= 0x04; + } + } else if (state->dst_type == DST_TYPE_IS_TERR) { freq = freq / 1000; if (freq < 137000 || freq > 858000) return -EINVAL; - val = &state->tx_tuna[0]; - val[2] = (freq >> 16) & 0xff; - val[3] = (freq >> 8) & 0xff; - val[4] = (u8) freq; - val[5] = 0; - switch (state->bandwidth) { - case BANDWIDTH_6_MHZ: - val[6] = 6; - break; - - case BANDWIDTH_7_MHZ: - case BANDWIDTH_AUTO: - val[6] = 7; - break; + state->tx_tuna[2] = (freq >> 16) & 0xff; + state->tx_tuna[3] = (freq >> 8) & 0xff; + state->tx_tuna[4] = (u8) freq; - case BANDWIDTH_8_MHZ: - val[6] = 8; - break; - } - - val[7] = 0; - val[8] = 0; } else if (state->dst_type == DST_TYPE_IS_CABLE) { - /* guess till will get one */ - freq = freq / 1000; - val = &state->tx_tuna[0]; - val[2] = (freq >> 16) & 0xff; - val[3] = (freq >> 8) & 0xff; - val[4] = (u8) freq; + state->tx_tuna[2] = (freq >> 16) & 0xff; + state->tx_tuna[3] = (freq >> 8) & 0xff; + state->tx_tuna[4] = (u8) freq; + } else return -EINVAL; return 0; @@ -409,7 +389,6 @@ static int dst_set_bandwidth(struct dst_state* state, fe_bandwidth_t bandwidth) static int dst_set_inversion(struct dst_state* state, fe_spectral_inversion_t inversion) { state->inversion = inversion; - switch (inversion) { case INVERSION_OFF: // Inversion = Normal state->tx_tuna[8] &= ~0x80; |