Lines Matching +full:4 +full:- +full:temp

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * USB1.1 DVB-T receiver.
9 * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
12 #include "af9005-script.h"
77 case 4: in af9005_read_word_agc()
78 *value = ((u16) (temp1 & 0x30) << 4) + (u16) temp0; in af9005_read_word_agc()
85 return -EINVAL; in af9005_read_word_agc()
93 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_is_fecmon_available()
95 u8 temp; in af9005_is_fecmon_available() local
99 ret = af9005_read_register_bits(state->d, xd_p_fec_vtb_rsd_mon_en, in af9005_is_fecmon_available()
101 fec_vtb_rsd_mon_en_len, &temp); in af9005_is_fecmon_available()
104 if (temp & 1) { in af9005_is_fecmon_available()
106 af9005_read_register_bits(state->d, in af9005_is_fecmon_available()
109 reg_ofsm_read_rbc_en_len, &temp); in af9005_is_fecmon_available()
112 if ((temp & 1) == 0) in af9005_is_fecmon_available()
124 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_get_post_vit_err_cw_count()
128 u8 temp, temp0, temp1, temp2; in af9005_get_post_vit_err_cw_count() local
136 af9005_read_register_bits(state->d, xd_r_fec_rsd_ber_rdy, in af9005_get_post_vit_err_cw_count()
138 &temp); in af9005_get_post_vit_err_cw_count()
141 if (!temp) { in af9005_get_post_vit_err_cw_count()
147 af9005_read_ofdm_register(state->d, in af9005_get_post_vit_err_cw_count()
153 af9005_read_ofdm_register(state->d, in af9005_get_post_vit_err_cw_count()
162 af9005_read_ofdm_register(state->d, xd_r_fec_rsd_bit_err_cnt_7_0, in af9005_get_post_vit_err_cw_count()
167 af9005_read_ofdm_register(state->d, xd_r_fec_rsd_bit_err_cnt_15_8, in af9005_get_post_vit_err_cw_count()
172 af9005_read_ofdm_register(state->d, xd_r_fec_rsd_bit_err_cnt_23_16, in af9005_get_post_vit_err_cw_count()
177 *post_err_count = err_count - (u32) loc_abort_count *8 * 8; in af9005_get_post_vit_err_cw_count()
181 af9005_read_ofdm_register(state->d, xd_p_fec_rsd_packet_unit_7_0, in af9005_get_post_vit_err_cw_count()
186 af9005_read_ofdm_register(state->d, xd_p_fec_rsd_packet_unit_15_8, in af9005_get_post_vit_err_cw_count()
193 return -EIO; in af9005_get_post_vit_err_cw_count()
197 *post_cw_count = cw_count - (u32) loc_abort_count; in af9005_get_post_vit_err_cw_count()
227 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_get_pre_vit_err_bit_count()
228 u8 temp, temp0, temp1, temp2; in af9005_get_pre_vit_err_bit_count() local
233 af9005_read_register_bits(state->d, xd_r_fec_vtb_ber_rdy, in af9005_get_pre_vit_err_bit_count()
235 &temp); in af9005_get_pre_vit_err_bit_count()
238 if (!temp) { in af9005_get_pre_vit_err_bit_count()
243 af9005_read_ofdm_register(state->d, xd_r_fec_vtb_err_bit_cnt_7_0, in af9005_get_pre_vit_err_bit_count()
248 af9005_read_ofdm_register(state->d, xd_r_fec_vtb_err_bit_cnt_15_8, in af9005_get_pre_vit_err_bit_count()
253 af9005_read_ofdm_register(state->d, xd_r_fec_vtb_err_bit_cnt_23_16, in af9005_get_pre_vit_err_bit_count()
260 af9005_read_ofdm_register(state->d, xd_p_fec_super_frm_unit_7_0, in af9005_get_pre_vit_err_bit_count()
265 af9005_read_ofdm_register(state->d, xd_p_fec_super_frm_unit_15_8, in af9005_get_pre_vit_err_bit_count()
277 af9005_read_register_bits(state->d, xd_g_reg_tpsd_txmod, in af9005_get_pre_vit_err_bit_count()
279 &temp); in af9005_get_pre_vit_err_bit_count()
282 if (temp == 0) { in af9005_get_pre_vit_err_bit_count()
285 } else if (temp == 1) { in af9005_get_pre_vit_err_bit_count()
290 return -EINVAL; in af9005_get_pre_vit_err_bit_count()
295 af9005_read_register_bits(state->d, xd_g_reg_tpsd_const, in af9005_get_pre_vit_err_bit_count()
297 &temp); in af9005_get_pre_vit_err_bit_count()
300 switch (temp) { in af9005_get_pre_vit_err_bit_count()
305 bits = 4; in af9005_get_pre_vit_err_bit_count()
312 return -EINVAL; in af9005_get_pre_vit_err_bit_count()
314 *pre_bit_count = super_frame_count * 68 * 4 * x * bits; in af9005_get_pre_vit_err_bit_count()
322 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_reset_pre_viterbi()
327 af9005_write_ofdm_register(state->d, xd_p_fec_super_frm_unit_7_0, in af9005_reset_pre_viterbi()
331 ret = af9005_write_ofdm_register(state->d, xd_p_fec_super_frm_unit_15_8, in af9005_reset_pre_viterbi()
337 af9005_write_register_bits(state->d, xd_p_fec_vtb_ber_rst, in af9005_reset_pre_viterbi()
346 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_reset_post_viterbi()
351 af9005_write_ofdm_register(state->d, xd_p_fec_rsd_packet_unit_7_0, in af9005_reset_post_viterbi()
356 af9005_write_ofdm_register(state->d, xd_p_fec_rsd_packet_unit_15_8, in af9005_reset_post_viterbi()
362 af9005_write_register_bits(state->d, xd_p_fec_rsd_ber_rst, in af9005_reset_post_viterbi()
371 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_get_statistic()
384 ret = af9005_get_pre_vit_err_bit_count(fe, &state->pre_vit_error_count, in af9005_get_statistic()
385 &state->pre_vit_bit_count); in af9005_get_statistic()
388 if (state->pre_vit_bit_count > 0) { in af9005_get_statistic()
389 /* according to v 0.0.4 of the dvb api ber should be a multiple in af9005_get_statistic()
390 of 10E-9 so we have to multiply the error count by in af9005_get_statistic()
393 (u64) state->pre_vit_error_count * (u64) 1000000000; in af9005_get_statistic()
394 denominator = (u64) state->pre_vit_bit_count; in af9005_get_statistic()
395 state->ber = do_div(numerator, denominator); in af9005_get_statistic()
397 state->ber = 0xffffffff; in af9005_get_statistic()
401 ret = af9005_get_post_vit_ber(fe, &state->post_vit_error_count, in af9005_get_statistic()
402 &state->post_vit_bit_count, in af9005_get_statistic()
403 &state->abort_count); in af9005_get_statistic()
406 state->unc += state->abort_count; in af9005_get_statistic()
415 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_refresh_state()
416 if (time_after(jiffies, state->next_status_check)) { in af9005_fe_refresh_state()
422 state->next_status_check = jiffies + 250 * HZ / 1000; in af9005_fe_refresh_state()
430 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_read_status()
431 u8 temp; in af9005_fe_read_status() local
434 if (fe->ops.tuner_ops.release == NULL) in af9005_fe_read_status()
435 return -ENODEV; in af9005_fe_read_status()
438 ret = af9005_read_register_bits(state->d, xd_p_agc_lock, in af9005_fe_read_status()
439 agc_lock_pos, agc_lock_len, &temp); in af9005_fe_read_status()
442 if (temp) in af9005_fe_read_status()
445 ret = af9005_read_register_bits(state->d, xd_p_fd_tpsd_lock, in af9005_fe_read_status()
447 &temp); in af9005_fe_read_status()
450 if (temp) in af9005_fe_read_status()
453 ret = af9005_read_register_bits(state->d, in af9005_fe_read_status()
456 mp2if_sync_byte_locked_pos, &temp); in af9005_fe_read_status()
459 if (temp) in af9005_fe_read_status()
461 if (state->opened) in af9005_fe_read_status()
462 af9005_led_control(state->d, *stat & FE_HAS_LOCK); in af9005_fe_read_status()
465 af9005_read_register_bits(state->d, xd_p_reg_strong_sginal_detected, in af9005_fe_read_status()
467 reg_strong_sginal_detected_len, &temp); in af9005_fe_read_status()
470 if (temp != state->strong) { in af9005_fe_read_status()
471 deb_info("adjust for strong signal %d\n", temp); in af9005_fe_read_status()
472 state->strong = temp; in af9005_fe_read_status()
479 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_read_ber()
480 if (fe->ops.tuner_ops.release == NULL) in af9005_fe_read_ber()
481 return -ENODEV; in af9005_fe_read_ber()
483 *ber = state->ber; in af9005_fe_read_ber()
489 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_read_unc_blocks()
490 if (fe->ops.tuner_ops.release == NULL) in af9005_fe_read_unc_blocks()
491 return -ENODEV; in af9005_fe_read_unc_blocks()
493 *unc = state->unc; in af9005_fe_read_unc_blocks()
500 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_read_signal_strength()
504 if (fe->ops.tuner_ops.release == NULL) in af9005_fe_read_signal_strength()
505 return -ENODEV; in af9005_fe_read_signal_strength()
507 af9005_read_ofdm_register(state->d, xd_r_reg_aagc_rf_gain, in af9005_fe_read_signal_strength()
512 af9005_read_ofdm_register(state->d, xd_r_reg_aagc_if_gain, in af9005_fe_read_signal_strength()
518 *strength = (512 - rf_gain - if_gain) << 7; in af9005_fe_read_signal_strength()
527 return -ENOSYS; in af9005_fe_read_snr()
532 u8 temp0, temp1, temp2, temp3, buf[4]; in af9005_fe_program_cfoe()
570 return -EINVAL; in af9005_fe_program_cfoe()
766 u8 temp; in af9005_fe_select_bw() local
769 temp = 0; in af9005_fe_select_bw()
772 temp = 1; in af9005_fe_select_bw()
775 temp = 2; in af9005_fe_select_bw()
779 return -EINVAL; in af9005_fe_select_bw()
782 reg_bw_len, temp); in af9005_fe_select_bw()
787 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_power()
788 u8 temp = on; in af9005_fe_power() local
791 ret = af9005_send_command(state->d, 0x03, &temp, 1, NULL, 0); in af9005_fe_power()
805 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_init()
806 struct dvb_usb_adapter *adap = fe->dvb->priv; in af9005_fe_init()
808 u8 temp, temp0 = 0, temp1 = 0, temp2 = 0; in af9005_fe_init() local
817 af9005_write_register_bits(state->d, xd_I2C_reg_ofdm_rst_en, in af9005_fe_init()
818 4, 1, 0x01))) in af9005_fe_init()
820 if ((ret = af9005_write_ofdm_register(state->d, APO_REG_RESET, 0))) in af9005_fe_init()
826 af9005_read_ofdm_register(state->d, in af9005_fe_init()
827 xd_I2C_reg_ofdm_rst, &temp))) in af9005_fe_init()
829 if (temp & (regmask[reg_ofdm_rst_len - 1] << reg_ofdm_rst_pos)) in af9005_fe_init()
834 return -ETIMEDOUT; in af9005_fe_init()
841 misc ctrl 3 -> 1 in af9005_fe_init()
846 ret = af9005_write_ofdm_register(state->d, 0xb200, 0xa9); in af9005_fe_init()
849 ret = af9005_write_ofdm_register(state->d, xd_g_reg_ofsm_clk, 0x07); in af9005_fe_init()
852 temp = 0x01; in af9005_fe_init()
853 ret = af9005_send_command(state->d, 0x03, &temp, 1, NULL, 0); in af9005_fe_init()
856 ret = af9005_write_ofdm_register(state->d, xd_g_reg_ofsm_clk, 0x00); in af9005_fe_init()
859 ret = af9005_write_ofdm_register(state->d, 0xb200, 0xa1); in af9005_fe_init()
863 temp = regmask[reg_ofdm_rst_len - 1] << reg_ofdm_rst_pos; in af9005_fe_init()
865 af9005_write_register_bits(state->d, xd_I2C_reg_ofdm_rst, in af9005_fe_init()
868 ret = af9005_write_register_bits(state->d, xd_I2C_reg_ofdm_rst, in af9005_fe_init()
874 ret = af9005_write_ofdm_register(state->d, 0xaefc, 0); in af9005_fe_init()
881 af9005_write_register_bits(state->d, xd_p_reg_dca_stand_alone, in af9005_fe_init()
889 af9005_write_register_bits(state->d, xd_p_reg_dca_upper_chip, in af9005_fe_init()
894 af9005_write_register_bits(state->d, xd_p_reg_dca_lower_chip, in af9005_fe_init()
902 af9005_write_ofdm_register(state->d, xd_I2C_i2c_m_period, 0x14))) in af9005_fe_init()
908 af9005_write_register_bits(state->d, xd_p_reg_dca_en, in af9005_fe_init()
912 ret = af9005_write_ofdm_register(state->d, 0xa16c, 1); in af9005_fe_init()
915 ret = af9005_write_ofdm_register(state->d, 0xa3c1, 0); in af9005_fe_init()
921 ret = af9005_fe_program_cfoe(state->d, 6000000); in af9005_fe_init()
924 /* set read-update bit for modulation */ in af9005_fe_init()
925 deb_info("set read-update bit for modulation\n"); in af9005_fe_init()
927 af9005_write_register_bits(state->d, xd_p_reg_feq_read_update, in af9005_fe_init()
935 /* set read-update bit to 1 for DCA modulation */ in af9005_fe_init()
936 deb_info("set read-update bit 1 for DCA modulation\n"); in af9005_fe_init()
938 af9005_write_register_bits(state->d, xd_p_reg_dca_read_update, in af9005_fe_init()
946 af9005_write_register_bits(state->d, xd_p_fec_vtb_rsd_mon_en, in af9005_fe_init()
952 ret = af9005_write_ofdm_register(state->d, 0xa601, 0); in af9005_fe_init()
956 if ((ret = af9005_write_ofdm_register(state->d, 0xaefb, 0x01))) in af9005_fe_init()
964 af9005_write_register_bits(state->d, script[i].reg, in af9005_fe_init()
978 state->original_if_unplug_th = script[i].val; in af9005_fe_init()
980 state->original_rf_unplug_th = script[i].val; in af9005_fe_init()
982 state->original_dtop_if_unplug_th = script[i].val; in af9005_fe_init()
984 state->original_dtop_rf_unplug_th = script[i].val; in af9005_fe_init()
987 state->original_fcw = in af9005_fe_init()
996 af9005_read_word_agc(state->d, in af9005_fe_init()
999 &state->original_rf_top); in af9005_fe_init()
1005 af9005_read_word_agc(state->d, in af9005_fe_init()
1008 &state->original_if_top); in af9005_fe_init()
1014 af9005_read_word_agc(state->d, 0xA60E, 0xA60A, 4, 2, in af9005_fe_init()
1015 &state->original_aci0_if_top); in af9005_fe_init()
1021 af9005_read_word_agc(state->d, 0xA60E, 0xA60B, 6, 2, in af9005_fe_init()
1022 &state->original_aci1_if_top); in af9005_fe_init()
1027 if (fe->ops.tuner_ops.release == NULL) { in af9005_fe_init()
1029 ret = af9005_read_eeprom(adap->dev, 0xc6, buf, 2); in af9005_fe_init()
1038 ret = af9005_read_eeprom(adap->dev, 0xc8, buf, 2); in af9005_fe_init()
1044 if (dvb_attach(mt2060_attach, fe, &adap->dev->i2c_adap, in af9005_fe_init()
1047 return -ENODEV; in af9005_fe_init()
1052 if (dvb_attach(qt1010_attach, fe, &adap->dev->i2c_adap, in af9005_fe_init()
1055 return -ENODEV; in af9005_fe_init()
1060 return -ENODEV; in af9005_fe_init()
1062 ret = fe->ops.tuner_ops.init(fe); in af9005_fe_init()
1078 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_ts_bus_ctrl()
1081 state->opened++; in af9005_ts_bus_ctrl()
1084 state->opened--; in af9005_ts_bus_ctrl()
1085 if (!state->opened) in af9005_ts_bus_ctrl()
1086 af9005_led_control(state->d, 0); in af9005_ts_bus_ctrl()
1093 struct dtv_frontend_properties *fep = &fe->dtv_property_cache; in af9005_fe_set_frontend()
1094 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_set_frontend()
1096 u8 temp, temp0, temp1, temp2; in af9005_fe_set_frontend() local
1098 deb_info("af9005_fe_set_frontend freq %d bw %d\n", fep->frequency, in af9005_fe_set_frontend()
1099 fep->bandwidth_hz); in af9005_fe_set_frontend()
1100 if (fe->ops.tuner_ops.release == NULL) { in af9005_fe_set_frontend()
1102 return -ENODEV; in af9005_fe_set_frontend()
1107 ret = af9005_led_control(state->d, 0); in af9005_fe_set_frontend()
1111 ret = af9005_write_register_bits(state->d, XD_MP2IF_MISC, 2, 1, 0); in af9005_fe_set_frontend()
1117 temp0 = (u8) (state->original_fcw & 0x000000ff); in af9005_fe_set_frontend()
1118 temp1 = (u8) ((state->original_fcw & 0x0000ff00) >> 8); in af9005_fe_set_frontend()
1119 temp2 = (u8) ((state->original_fcw & 0x00ff0000) >> 16); in af9005_fe_set_frontend()
1120 ret = af9005_write_ofdm_register(state->d, 0xae1a, temp0); in af9005_fe_set_frontend()
1123 ret = af9005_write_ofdm_register(state->d, 0xae19, temp1); in af9005_fe_set_frontend()
1126 ret = af9005_write_ofdm_register(state->d, 0xae18, temp2); in af9005_fe_set_frontend()
1133 af9005_write_word_agc(state->d, in af9005_fe_set_frontend()
1136 state->original_rf_top); in af9005_fe_set_frontend()
1140 af9005_write_word_agc(state->d, in af9005_fe_set_frontend()
1143 state->original_if_top); in af9005_fe_set_frontend()
1147 af9005_write_word_agc(state->d, 0xA60E, 0xA60A, 4, 2, in af9005_fe_set_frontend()
1148 state->original_aci0_if_top); in af9005_fe_set_frontend()
1152 af9005_write_word_agc(state->d, 0xA60E, 0xA60B, 6, 2, in af9005_fe_set_frontend()
1153 state->original_aci1_if_top); in af9005_fe_set_frontend()
1159 ret = af9005_fe_select_bw(state->d, fep->bandwidth_hz); in af9005_fe_set_frontend()
1162 ret = af9005_fe_program_cfoe(state->d, fep->bandwidth_hz); in af9005_fe_set_frontend()
1168 ret = af9005_write_ofdm_register(state->d, 0xaefd, 0); in af9005_fe_set_frontend()
1175 af9005_write_ofdm_register(state->d, xd_p_reg_unplug_th, in af9005_fe_set_frontend()
1176 state->original_if_unplug_th); in af9005_fe_set_frontend()
1181 ret = fe->ops.tuner_ops.set_params(fe); in af9005_fe_set_frontend()
1187 temp = 0; in af9005_fe_set_frontend()
1188 ret = af9005_write_tuner_registers(state->d, 0xffff, &temp, 1); in af9005_fe_set_frontend()
1195 af9005_write_register_bits(state->d, in af9005_fe_set_frontend()
1204 state->pre_vit_error_count = 0; in af9005_fe_set_frontend()
1205 state->pre_vit_bit_count = 0; in af9005_fe_set_frontend()
1206 state->ber = 0; in af9005_fe_set_frontend()
1207 state->post_vit_error_count = 0; in af9005_fe_set_frontend()
1208 /* state->unc = 0; commented out since it should be ever increasing */ in af9005_fe_set_frontend()
1209 state->abort_count = 0; in af9005_fe_set_frontend()
1211 state->next_status_check = jiffies; in af9005_fe_set_frontend()
1212 state->strong = -1; in af9005_fe_set_frontend()
1220 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_get_frontend()
1222 u8 temp; in af9005_fe_get_frontend() local
1226 af9005_read_register_bits(state->d, xd_g_reg_tpsd_const, in af9005_fe_get_frontend()
1228 &temp); in af9005_fe_get_frontend()
1233 switch (temp) { in af9005_fe_get_frontend()
1235 fep->modulation = QPSK; in af9005_fe_get_frontend()
1239 fep->modulation = QAM_16; in af9005_fe_get_frontend()
1243 fep->modulation = QAM_64; in af9005_fe_get_frontend()
1250 af9005_read_register_bits(state->d, xd_g_reg_tpsd_hier, in af9005_fe_get_frontend()
1252 &temp); in af9005_fe_get_frontend()
1256 switch (temp) { in af9005_fe_get_frontend()
1258 fep->hierarchy = HIERARCHY_NONE; in af9005_fe_get_frontend()
1262 fep->hierarchy = HIERARCHY_1; in af9005_fe_get_frontend()
1266 fep->hierarchy = HIERARCHY_2; in af9005_fe_get_frontend()
1270 fep->hierarchy = HIERARCHY_4; in af9005_fe_get_frontend()
1271 deb_info("4\n"); in af9005_fe_get_frontend()
1277 af9005_read_register_bits(state->d, xd_g_reg_dec_pri, in af9005_fe_get_frontend()
1278 reg_dec_pri_pos, reg_dec_pri_len, &temp); in af9005_fe_get_frontend()
1281 /* if temp is set = high priority */ in af9005_fe_get_frontend()
1282 deb_info("PRIORITY %s\n", temp ? "high" : "low"); in af9005_fe_get_frontend()
1286 af9005_read_register_bits(state->d, xd_g_reg_tpsd_hpcr, in af9005_fe_get_frontend()
1288 &temp); in af9005_fe_get_frontend()
1292 switch (temp) { in af9005_fe_get_frontend()
1294 fep->code_rate_HP = FEC_1_2; in af9005_fe_get_frontend()
1298 fep->code_rate_HP = FEC_2_3; in af9005_fe_get_frontend()
1302 fep->code_rate_HP = FEC_3_4; in af9005_fe_get_frontend()
1306 fep->code_rate_HP = FEC_5_6; in af9005_fe_get_frontend()
1309 case 4: in af9005_fe_get_frontend()
1310 fep->code_rate_HP = FEC_7_8; in af9005_fe_get_frontend()
1317 af9005_read_register_bits(state->d, xd_g_reg_tpsd_lpcr, in af9005_fe_get_frontend()
1319 &temp); in af9005_fe_get_frontend()
1323 switch (temp) { in af9005_fe_get_frontend()
1325 fep->code_rate_LP = FEC_1_2; in af9005_fe_get_frontend()
1329 fep->code_rate_LP = FEC_2_3; in af9005_fe_get_frontend()
1333 fep->code_rate_LP = FEC_3_4; in af9005_fe_get_frontend()
1337 fep->code_rate_LP = FEC_5_6; in af9005_fe_get_frontend()
1340 case 4: in af9005_fe_get_frontend()
1341 fep->code_rate_LP = FEC_7_8; in af9005_fe_get_frontend()
1348 af9005_read_register_bits(state->d, xd_g_reg_tpsd_gi, in af9005_fe_get_frontend()
1349 reg_tpsd_gi_pos, reg_tpsd_gi_len, &temp); in af9005_fe_get_frontend()
1353 switch (temp) { in af9005_fe_get_frontend()
1355 fep->guard_interval = GUARD_INTERVAL_1_32; in af9005_fe_get_frontend()
1359 fep->guard_interval = GUARD_INTERVAL_1_16; in af9005_fe_get_frontend()
1363 fep->guard_interval = GUARD_INTERVAL_1_8; in af9005_fe_get_frontend()
1367 fep->guard_interval = GUARD_INTERVAL_1_4; in af9005_fe_get_frontend()
1374 af9005_read_register_bits(state->d, xd_g_reg_tpsd_txmod, in af9005_fe_get_frontend()
1376 &temp); in af9005_fe_get_frontend()
1380 switch (temp) { in af9005_fe_get_frontend()
1382 fep->transmission_mode = TRANSMISSION_MODE_2K; in af9005_fe_get_frontend()
1386 fep->transmission_mode = TRANSMISSION_MODE_8K; in af9005_fe_get_frontend()
1393 af9005_read_register_bits(state->d, xd_g_reg_bw, reg_bw_pos, in af9005_fe_get_frontend()
1394 reg_bw_len, &temp); in af9005_fe_get_frontend()
1396 switch (temp) { in af9005_fe_get_frontend()
1398 fep->bandwidth_hz = 6000000; in af9005_fe_get_frontend()
1402 fep->bandwidth_hz = 7000000; in af9005_fe_get_frontend()
1406 fep->bandwidth_hz = 8000000; in af9005_fe_get_frontend()
1415 struct af9005_fe_state *state = fe->demodulator_priv; in af9005_fe_release()
1432 state->d = d; in af9005_fe_attach()
1433 state->opened = 0; in af9005_fe_attach()
1435 memcpy(&state->frontend.ops, &af9005_fe_ops, in af9005_fe_attach()
1437 state->frontend.demodulator_priv = state; in af9005_fe_attach()
1439 return &state->frontend; in af9005_fe_attach()
1447 .name = "AF9005 USB DVB-T",