Lines Matching +full:2 +full:d
18 struct dvb_usb_device *d; member
49 static int af9005_write_word_agc(struct dvb_usb_device *d, u16 reghi, in af9005_write_word_agc() argument
54 if ((ret = af9005_write_ofdm_register(d, reglo, (u8) (value & 0xff)))) in af9005_write_word_agc()
56 return af9005_write_register_bits(d, reghi, pos, len, in af9005_write_word_agc()
60 static int af9005_read_word_agc(struct dvb_usb_device *d, u16 reghi, in af9005_read_word_agc() argument
66 if ((ret = af9005_read_ofdm_register(d, reglo, &temp0))) in af9005_read_word_agc()
68 if ((ret = af9005_read_ofdm_register(d, reghi, &temp1))) in af9005_read_word_agc()
74 case 2: in af9005_read_word_agc()
81 *value = ((u16) (temp1 & 0xC0) << 2) + (u16) temp0; in af9005_read_word_agc()
99 ret = af9005_read_register_bits(state->d, xd_p_fec_vtb_rsd_mon_en, in af9005_is_fecmon_available()
106 af9005_read_register_bits(state->d, in af9005_is_fecmon_available()
136 af9005_read_register_bits(state->d, xd_r_fec_rsd_ber_rdy, 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()
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()
195 deb_info("POST abort count %d err count %d rsd packets %d\n", in af9005_get_post_vit_err_cw_count()
233 af9005_read_register_bits(state->d, xd_r_fec_vtb_ber_rdy, 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()
283 /* 2K */ 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()
302 bits = 2; in af9005_get_pre_vit_err_bit_count()
307 case 2: /* QAM_64 */ in af9005_get_pre_vit_err_bit_count()
315 deb_info("PRE err count %d frame count %d bit count %d\n", in af9005_get_pre_vit_err_bit_count()
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()
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()
438 ret = af9005_read_register_bits(state->d, xd_p_agc_lock, in af9005_fe_read_status()
445 ret = af9005_read_register_bits(state->d, xd_p_fd_tpsd_lock, in af9005_fe_read_status()
453 ret = af9005_read_register_bits(state->d, 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()
471 deb_info("adjust for strong signal %d\n", temp); in af9005_fe_read_status()
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()
530 static int af9005_fe_program_cfoe(struct dvb_usb_device *d, u32 bw) in af9005_fe_program_cfoe() argument
569 err("Invalid bandwidth %d.", bw); in af9005_fe_program_cfoe()
585 buf[2] = temp1; in af9005_fe_program_cfoe()
589 ret = af9005_write_ofdm_register(d, 0xAE00, buf[0]); in af9005_fe_program_cfoe()
594 ret = af9005_write_ofdm_register(d, 0xAE01, buf[1]); in af9005_fe_program_cfoe()
599 ret = af9005_write_ofdm_register(d, 0xAE02, buf[2]); in af9005_fe_program_cfoe()
604 ret = af9005_write_ofdm_register(d, 0xAE03, buf[3]); in af9005_fe_program_cfoe()
620 buf[2] = temp1; in af9005_fe_program_cfoe()
623 ret = af9005_write_ofdm_register(d, 0xAE04, buf[0]); in af9005_fe_program_cfoe()
627 ret = af9005_write_ofdm_register(d, 0xAE05, buf[1]); in af9005_fe_program_cfoe()
631 ret = af9005_write_ofdm_register(d, 0xAE06, buf[2]); in af9005_fe_program_cfoe()
635 ret = af9005_write_ofdm_register(d, 0xAE07, buf[3]); in af9005_fe_program_cfoe()
651 buf[2] = temp1; in af9005_fe_program_cfoe()
654 ret = af9005_write_ofdm_register(d, 0xAE08, buf[0]); in af9005_fe_program_cfoe()
658 ret = af9005_write_ofdm_register(d, 0xAE09, buf[1]); in af9005_fe_program_cfoe()
662 ret = af9005_write_ofdm_register(d, 0xAE0A, buf[2]); in af9005_fe_program_cfoe()
666 ret = af9005_write_ofdm_register(d, 0xAE0B, buf[3]); in af9005_fe_program_cfoe()
682 buf[2] = temp1; in af9005_fe_program_cfoe()
685 ret = af9005_write_ofdm_register(d, 0xAE0C, buf[0]); in af9005_fe_program_cfoe()
689 ret = af9005_write_ofdm_register(d, 0xAE0D, buf[1]); in af9005_fe_program_cfoe()
693 ret = af9005_write_ofdm_register(d, 0xAE0E, buf[2]); in af9005_fe_program_cfoe()
697 ret = af9005_write_ofdm_register(d, 0xAE0F, buf[3]); in af9005_fe_program_cfoe()
713 buf[2] = temp1; in af9005_fe_program_cfoe()
716 ret = af9005_write_ofdm_register(d, 0xAE10, buf[0]); in af9005_fe_program_cfoe()
720 ret = af9005_write_ofdm_register(d, 0xAE11, buf[1]); in af9005_fe_program_cfoe()
724 ret = af9005_write_ofdm_register(d, 0xAE12, buf[2]); in af9005_fe_program_cfoe()
728 ret = af9005_write_ofdm_register(d, 0xAE13, buf[3]); in af9005_fe_program_cfoe()
744 buf[2] = temp1; in af9005_fe_program_cfoe()
747 ret = af9005_write_ofdm_register(d, 0xAE14, buf[0]); in af9005_fe_program_cfoe()
751 ret = af9005_write_ofdm_register(d, 0xAE15, buf[1]); in af9005_fe_program_cfoe()
755 ret = af9005_write_ofdm_register(d, 0xAE16, buf[2]); in af9005_fe_program_cfoe()
759 ret = af9005_write_ofdm_register(d, 0xAE17, buf[3]); in af9005_fe_program_cfoe()
764 static int af9005_fe_select_bw(struct dvb_usb_device *d, u32 bw) in af9005_fe_select_bw() argument
775 temp = 2; in af9005_fe_select_bw()
778 err("Invalid bandwidth %d.", bw); in af9005_fe_select_bw()
781 return af9005_write_register_bits(d, xd_g_reg_bw, reg_bw_pos, in af9005_fe_select_bw()
791 ret = af9005_send_command(state->d, 0x03, &temp, 1, NULL, 0); in af9005_fe_power()
809 u8 buf[2]; in af9005_fe_init()
817 af9005_write_register_bits(state->d, xd_I2C_reg_ofdm_rst_en, 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()
839 read eepr c6 (2) in af9005_fe_init()
840 read eepr c7 (2) 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()
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()
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()
899 /* set 2wire master clock to 0x14 (for 60KHz) */ in af9005_fe_init()
900 deb_info("set 2wire master clock to 0x14 (for 60KHz)\n"); 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()
927 af9005_write_register_bits(state->d, xd_p_reg_feq_read_update, 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()
996 af9005_read_word_agc(state->d, in af9005_fe_init()
998 xd_p_reg_aagc_rf_top_numerator_7_0, 0, 2, in af9005_fe_init()
1005 af9005_read_word_agc(state->d, in af9005_fe_init()
1007 xd_p_reg_aagc_if_top_numerator_7_0, 0, 2, in af9005_fe_init()
1014 af9005_read_word_agc(state->d, 0xA60E, 0xA60A, 4, 2, in af9005_fe_init()
1021 af9005_read_word_agc(state->d, 0xA60E, 0xA60B, 6, 2, in af9005_fe_init()
1029 ret = af9005_read_eeprom(adap->dev, 0xc6, buf, 2); in af9005_fe_init()
1034 deb_info("Tuner id %d, board id %d\n", buf[0], buf[1]); in af9005_fe_init()
1036 case 2: /* MT2060 */ in af9005_fe_init()
1038 ret = af9005_read_eeprom(adap->dev, 0xc8, buf, 2); in af9005_fe_init()
1059 err("Unsupported tuner type %d", buf[0]); in af9005_fe_init()
1086 af9005_led_control(state->d, 0); in af9005_ts_bus_ctrl()
1098 deb_info("af9005_fe_set_frontend freq %d bw %d\n", fep->frequency, 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()
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()
1135 xd_p_reg_aagc_rf_top_numerator_7_0, 0, 2, in af9005_fe_set_frontend()
1140 af9005_write_word_agc(state->d, in af9005_fe_set_frontend()
1142 xd_p_reg_aagc_if_top_numerator_7_0, 0, 2, in af9005_fe_set_frontend()
1147 af9005_write_word_agc(state->d, 0xA60E, 0xA60A, 4, 2, in af9005_fe_set_frontend()
1152 af9005_write_word_agc(state->d, 0xA60E, 0xA60B, 6, 2, 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()
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()
1197 reg_api_retrain_request_pos, 2, 0); in af9005_fe_set_frontend()
1226 af9005_read_register_bits(state->d, xd_g_reg_tpsd_const, in af9005_fe_get_frontend()
1242 case 2: in af9005_fe_get_frontend()
1250 af9005_read_register_bits(state->d, xd_g_reg_tpsd_hier, in af9005_fe_get_frontend()
1265 case 2: in af9005_fe_get_frontend()
1267 deb_info("2\n"); in af9005_fe_get_frontend()
1277 af9005_read_register_bits(state->d, xd_g_reg_dec_pri, in af9005_fe_get_frontend()
1286 af9005_read_register_bits(state->d, xd_g_reg_tpsd_hpcr, in af9005_fe_get_frontend()
1301 case 2: in af9005_fe_get_frontend()
1317 af9005_read_register_bits(state->d, xd_g_reg_tpsd_lpcr, in af9005_fe_get_frontend()
1332 case 2: in af9005_fe_get_frontend()
1348 af9005_read_register_bits(state->d, xd_g_reg_tpsd_gi, in af9005_fe_get_frontend()
1362 case 2: in af9005_fe_get_frontend()
1374 af9005_read_register_bits(state->d, xd_g_reg_tpsd_txmod, in af9005_fe_get_frontend()
1383 deb_info("2K\n"); in af9005_fe_get_frontend()
1393 af9005_read_register_bits(state->d, xd_g_reg_bw, reg_bw_pos, in af9005_fe_get_frontend()
1405 case 2: in af9005_fe_get_frontend()
1421 struct dvb_frontend *af9005_fe_attach(struct dvb_usb_device *d) in af9005_fe_attach() argument
1432 state->d = d; in af9005_fe_attach()