Lines Matching refs:reg
695 static int stv090x_read_reg(struct stv090x_state *state, unsigned int reg) in stv090x_read_reg() argument
700 u8 b0[] = { reg >> 8, reg & 0xff }; in stv090x_read_reg()
713 reg, ret); in stv090x_read_reg()
719 reg, buf); in stv090x_read_reg()
724 static int stv090x_write_regs(struct stv090x_state *state, unsigned int reg, u8 *data, u32 count) in stv090x_write_regs() argument
734 KBUILD_MODNAME, reg, count); in stv090x_write_regs()
738 buf[0] = reg >> 8; in stv090x_write_regs()
739 buf[1] = reg & 0xff; in stv090x_write_regs()
743 __func__, reg, count, data); in stv090x_write_regs()
749 reg, data[0], count, ret); in stv090x_write_regs()
756 static int stv090x_write_reg(struct stv090x_state *state, unsigned int reg, u8 data) in stv090x_write_reg() argument
760 return stv090x_write_regs(state, reg, &tmp, 1); in stv090x_write_reg()
765 u32 reg; in stv090x_i2c_gate_ctrl() local
783 reg = STV090x_READ_DEMOD(state, I2CRPT); in stv090x_i2c_gate_ctrl()
786 STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 1); in stv090x_i2c_gate_ctrl()
787 if (STV090x_WRITE_DEMOD(state, I2CRPT, reg) < 0) in stv090x_i2c_gate_ctrl()
792 STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 0); in stv090x_i2c_gate_ctrl()
793 if ((STV090x_WRITE_DEMOD(state, I2CRPT, reg)) < 0) in stv090x_i2c_gate_ctrl()
1211 u32 reg; in stv090x_vitclk_ctl() local
1216 reg = stv090x_read_reg(state, STV090x_STOPCLK2); in stv090x_vitclk_ctl()
1217 STV090x_SETFIELD(reg, STOP_CLKVIT1_FIELD, enable); in stv090x_vitclk_ctl()
1218 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_vitclk_ctl()
1225 reg = stv090x_read_reg(state, STV090x_STOPCLK2); in stv090x_vitclk_ctl()
1226 STV090x_SETFIELD(reg, STOP_CLKVIT2_FIELD, enable); in stv090x_vitclk_ctl()
1227 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_vitclk_ctl()
1279 u32 reg; in stv090x_delivery_search() local
1284 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_delivery_search()
1285 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 1); in stv090x_delivery_search()
1286 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_delivery_search()
1287 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1309 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_delivery_search()
1310 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0); in stv090x_delivery_search()
1311 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_delivery_search()
1312 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1314 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 1); in stv090x_delivery_search()
1315 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 1); in stv090x_delivery_search()
1316 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1357 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_delivery_search()
1358 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0); in stv090x_delivery_search()
1359 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_delivery_search()
1360 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1362 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 1); in stv090x_delivery_search()
1363 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 1); in stv090x_delivery_search()
1364 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_delivery_search()
1411 u32 reg, freq_abs; in stv090x_start_search() local
1415 reg = STV090x_READ_DEMOD(state, DMDISTATE); in stv090x_start_search()
1416 STV090x_SETFIELD_Px(reg, I2C_DEMOD_MODE_FIELD, 0x1f); in stv090x_start_search()
1417 if (STV090x_WRITE_DEMOD(state, DMDISTATE, reg) < 0) in stv090x_start_search()
1521 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_start_search()
1522 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0); in stv090x_start_search()
1523 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0); in stv090x_start_search()
1524 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_start_search()
1526 reg = STV090x_READ_DEMOD(state, DMDCFG2); in stv090x_start_search()
1527 STV090x_SETFIELD_Px(reg, S1S2_SEQUENTIAL_FIELD, 0x0); in stv090x_start_search()
1528 if (STV090x_WRITE_DEMOD(state, DMDCFG2, reg) < 0) in stv090x_start_search()
1599 u32 agc2_min = 0xffff, agc2 = 0, freq_init, freq_step, reg; in stv090x_get_agc2_min_level() local
1604 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_get_agc2_min_level()
1605 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0); in stv090x_get_agc2_min_level()
1606 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0); in stv090x_get_agc2_min_level()
1607 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_get_agc2_min_level()
1696 u32 srate_coarse = 0, agc2 = 0, car_step = 1200, reg; in stv090x_srate_srch_coarse() local
1704 reg = STV090x_READ_DEMOD(state, DMDISTATE); in stv090x_srate_srch_coarse()
1705 STV090x_SETFIELD_Px(reg, I2C_DEMOD_MODE_FIELD, 0x1f); /* Demod RESET */ in stv090x_srate_srch_coarse()
1706 if (STV090x_WRITE_DEMOD(state, DMDISTATE, reg) < 0) in stv090x_srate_srch_coarse()
1716 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_srate_srch_coarse()
1717 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 1); in stv090x_srate_srch_coarse()
1718 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0); in stv090x_srate_srch_coarse()
1719 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_srate_srch_coarse()
1786 reg = STV090x_READ_DEMOD(state, DSTATUS); in stv090x_srate_srch_coarse()
1787 if (STV090x_GETFIELD_Px(reg, TMGLOCK_QUALITY_FIELD) >= 2) in stv090x_srate_srch_coarse()
1828 if (state->config->tuner_get_status(fe, ®) < 0) in stv090x_srate_srch_coarse()
1832 if (reg) in stv090x_srate_srch_coarse()
1858 u32 srate_coarse, freq_coarse, sym, reg; in stv090x_srate_srch_fine() local
1878 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_srate_srch_fine()
1879 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); in stv090x_srate_srch_fine()
1880 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_srate_srch_fine()
1957 u32 reg; in stv090x_get_dmdlock() local
1961 reg = STV090x_READ_DEMOD(state, DMDSTATE); in stv090x_get_dmdlock()
1962 stat = STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD); in stv090x_get_dmdlock()
1973 reg = STV090x_READ_DEMOD(state, DSTATUS); in stv090x_get_dmdlock()
1974 lock = STV090x_GETFIELD_Px(reg, LOCK_DEFINITIF_FIELD); in stv090x_get_dmdlock()
1990 u32 agc2, reg, srate_coarse; in stv090x_blind_search() local
2049 reg = STV090x_READ_DEMOD(state, DSTATUS2); in stv090x_blind_search()
2050 if ((STV090x_GETFIELD_Px(reg, CFR_OVERFLOW_FIELD) == 0x01) && in stv090x_blind_search()
2051 (STV090x_GETFIELD_Px(reg, DEMOD_DELOCK_FIELD) == 0x01)) in stv090x_blind_search()
2073 u32 reg; in stv090x_chk_tmg() local
2086 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_chk_tmg()
2087 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); /* stop carrier offset search */ in stv090x_chk_tmg()
2088 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_chk_tmg()
2110 reg = STV090x_READ_DEMOD(state, DSTATUS); in stv090x_chk_tmg()
2111 if (STV090x_GETFIELD_Px(reg, TMGLOCK_QUALITY_FIELD) >= 2) in stv090x_chk_tmg()
2143 u32 reg; in stv090x_get_coldlock() local
2218 if (state->config->tuner_get_status(fe, ®) < 0) in stv090x_get_coldlock()
2220 if (reg) in stv090x_get_coldlock()
2348 u32 reg; in stv090x_search_car_loop() local
2372 reg = STV090x_READ_DEMOD(state, PDELCTRL1); in stv090x_search_car_loop()
2373 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0x1); /* stop DVB-S2 packet delin */ in stv090x_search_car_loop()
2374 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_search_car_loop()
2397 reg = STV090x_READ_DEMOD(state, PDELCTRL1); in stv090x_search_car_loop()
2398 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0); in stv090x_search_car_loop()
2399 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_search_car_loop()
2411 u32 reg; in stv090x_sw_algo() local
2476 reg = STV090x_READ_DEMOD(state, DMDSTATE); in stv090x_sw_algo()
2477 if ((lock) && (STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD) == STV090x_DVBS2)) { in stv090x_sw_algo()
2480 reg = STV090x_READ_DEMOD(state, DMDFLYW); in stv090x_sw_algo()
2481 dvbs2_fly_wheel = STV090x_GETFIELD_Px(reg, FLYWHEEL_CPT_FIELD); in stv090x_sw_algo()
2484 reg = STV090x_READ_DEMOD(state, DMDFLYW); in stv090x_sw_algo()
2485 dvbs2_fly_wheel = STV090x_GETFIELD_Px(reg, FLYWHEEL_CPT_FIELD); in stv090x_sw_algo()
2512 u32 reg; in stv090x_get_std() local
2515 reg = STV090x_READ_DEMOD(state, DMDSTATE); in stv090x_get_std()
2516 if (STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD) == 2) in stv090x_get_std()
2518 else if (STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD) == 3) { in stv090x_get_std()
2519 reg = STV090x_READ_DEMOD(state, FECM); in stv090x_get_std()
2520 if (STV090x_GETFIELD_Px(reg, DSS_DVB_FIELD) == 1) in stv090x_get_std()
2557 u32 reg, rate; in stv090x_get_viterbi() local
2559 reg = STV090x_READ_DEMOD(state, VITCURPUN); in stv090x_get_viterbi()
2560 rate = STV090x_GETFIELD_Px(reg, VIT_CURPUN_FIELD); in stv090x_get_viterbi()
2600 u32 reg; in stv090x_get_sig_params() local
2633 reg = STV090x_READ_DEMOD(state, DMDMODCOD); in stv090x_get_sig_params()
2634 state->modcod = STV090x_GETFIELD_Px(reg, DEMOD_MODCOD_FIELD); in stv090x_get_sig_params()
2635 state->pilots = STV090x_GETFIELD_Px(reg, DEMOD_TYPE_FIELD) & 0x01; in stv090x_get_sig_params()
2636 state->frame_len = STV090x_GETFIELD_Px(reg, DEMOD_TYPE_FIELD) >> 1; in stv090x_get_sig_params()
2637 reg = STV090x_READ_DEMOD(state, TMGOBS); in stv090x_get_sig_params()
2638 state->rolloff = STV090x_GETFIELD_Px(reg, ROLLOFF_STATUS_FIELD); in stv090x_get_sig_params()
2639 reg = STV090x_READ_DEMOD(state, FECM); in stv090x_get_sig_params()
2640 state->inversion = STV090x_GETFIELD_Px(reg, IQINV_FIELD); in stv090x_get_sig_params()
2853 u32 reg; in stv090x_optimize_track() local
2862 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_optimize_track()
2863 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 1); in stv090x_optimize_track()
2864 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 0); in stv090x_optimize_track()
2865 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2868 reg = STV090x_READ_DEMOD(state, DEMOD); in stv090x_optimize_track()
2869 STV090x_SETFIELD_Px(reg, ROLLOFF_CONTROL_FIELD, state->rolloff); in stv090x_optimize_track()
2870 STV090x_SETFIELD_Px(reg, MANUAL_SXROLLOFF_FIELD, 0x01); in stv090x_optimize_track()
2871 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_optimize_track()
2896 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_optimize_track()
2897 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0); in stv090x_optimize_track()
2898 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 1); in stv090x_optimize_track()
2899 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2908 reg = STV090x_READ_DEMOD(state, DMDMODCOD); in stv090x_optimize_track()
2909 modcod = STV090x_GETFIELD_Px(reg, DEMOD_MODCOD_FIELD); in stv090x_optimize_track()
2910 pilots = STV090x_GETFIELD_Px(reg, DEMOD_TYPE_FIELD) & 0x01; in stv090x_optimize_track()
2962 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_optimize_track()
2963 STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 1); in stv090x_optimize_track()
2964 STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 1); in stv090x_optimize_track()
2965 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
2972 reg = STV090x_READ_DEMOD(state, TMGOBS); in stv090x_optimize_track()
2976 reg = STV090x_READ_DEMOD(state, DMDCFGMD); in stv090x_optimize_track()
2977 STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0x00); in stv090x_optimize_track()
2978 STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); in stv090x_optimize_track()
2979 if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) in stv090x_optimize_track()
3095 u32 reg; in stv090x_get_feclock() local
3098 reg = STV090x_READ_DEMOD(state, DMDSTATE); in stv090x_get_feclock()
3099 stat = STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD); in stv090x_get_feclock()
3109 reg = STV090x_READ_DEMOD(state, PDELSTATUS1); in stv090x_get_feclock()
3110 lock = STV090x_GETFIELD_Px(reg, PKTDELIN_LOCK_FIELD); in stv090x_get_feclock()
3114 reg = STV090x_READ_DEMOD(state, VSTATUSVIT); in stv090x_get_feclock()
3115 lock = STV090x_GETFIELD_Px(reg, LOCKEDVIT_FIELD); in stv090x_get_feclock()
3128 u32 reg; in stv090x_get_lock() local
3140 reg = STV090x_READ_DEMOD(state, TSSTATUS); in stv090x_get_lock()
3141 lock = STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD); in stv090x_get_lock()
3152 u32 reg; in stv090x_set_s2rolloff() local
3156 reg = STV090x_READ_DEMOD(state, DEMOD); in stv090x_set_s2rolloff()
3157 STV090x_SETFIELD_Px(reg, MANUAL_SXROLLOFF_FIELD, 0x00); in stv090x_set_s2rolloff()
3158 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_set_s2rolloff()
3162 reg = STV090x_READ_DEMOD(state, DEMOD); in stv090x_set_s2rolloff()
3163 STV090x_SETFIELD_Px(reg, MANUAL_S2ROLLOFF_FIELD, 0x00); in stv090x_set_s2rolloff()
3164 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_set_s2rolloff()
3178 u32 reg; in stv090x_algo() local
3182 reg = STV090x_READ_DEMOD(state, TSCFGH); in stv090x_algo()
3183 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 1); /* Stop path 1 stream merger */ in stv090x_algo()
3184 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3266 reg = state->config->tuner_bbgain; in stv090x_algo()
3267 if (reg == 0) in stv090x_algo()
3268 reg = 10; /* default: 10dB */ in stv090x_algo()
3269 if (state->config->tuner_set_bbgain(fe, reg) < 0) in stv090x_algo()
3291 if (state->config->tuner_get_status(fe, ®) < 0) in stv090x_algo()
3296 if (reg) in stv090x_algo()
3324 reg = STV090x_READ_DEMOD(state, DEMOD); in stv090x_algo()
3325 STV090x_SETFIELD_Px(reg, SPECINV_CONTROL_FIELD, state->inversion); in stv090x_algo()
3329 STV090x_SETFIELD_Px(reg, MANUAL_SXROLLOFF_FIELD, 1); in stv090x_algo()
3332 STV090x_SETFIELD_Px(reg, MANUAL_S2ROLLOFF_FIELD, 1); in stv090x_algo()
3334 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_algo()
3375 reg = STV090x_READ_DEMOD(state, TSCFGH); in stv090x_algo()
3376 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0); /* release merger reset */ in stv090x_algo()
3377 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3382 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 1); /* merger reset */ in stv090x_algo()
3383 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3386 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0); /* release merger reset */ in stv090x_algo()
3387 if (STV090x_WRITE_DEMOD(state, TSCFGH, reg) < 0) in stv090x_algo()
3397 reg = STV090x_READ_DEMOD(state, PDELCTRL2); in stv090x_algo()
3398 STV090x_SETFIELD_Px(reg, RESET_UPKO_COUNT, 1); in stv090x_algo()
3399 if (STV090x_WRITE_DEMOD(state, PDELCTRL2, reg) < 0) in stv090x_algo()
3402 reg = STV090x_READ_DEMOD(state, PDELCTRL2); in stv090x_algo()
3403 STV090x_SETFIELD_Px(reg, RESET_UPKO_COUNT, 0); in stv090x_algo()
3404 if (STV090x_WRITE_DEMOD(state, PDELCTRL2, reg) < 0) in stv090x_algo()
3450 u32 reg; in stv090x_set_mis() local
3454 reg = STV090x_READ_DEMOD(state, PDELCTRL1); in stv090x_set_mis()
3455 STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x00); in stv090x_set_mis()
3456 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_set_mis()
3460 reg = STV090x_READ_DEMOD(state, PDELCTRL1); in stv090x_set_mis()
3461 STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x01); in stv090x_set_mis()
3462 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_set_mis()
3527 u32 reg, dstatus; in stv090x_read_status() local
3536 reg = STV090x_READ_DEMOD(state, DMDSTATE); in stv090x_read_status()
3537 search_state = STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD); in stv090x_read_status()
3549 reg = STV090x_READ_DEMOD(state, PDELSTATUS1); in stv090x_read_status()
3550 if (STV090x_GETFIELD_Px(reg, PKTDELIN_LOCK_FIELD)) { in stv090x_read_status()
3552 reg = STV090x_READ_DEMOD(state, TSSTATUS); in stv090x_read_status()
3553 if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) in stv090x_read_status()
3562 reg = STV090x_READ_DEMOD(state, VSTATUSVIT); in stv090x_read_status()
3563 if (STV090x_GETFIELD_Px(reg, LOCKEDVIT_FIELD)) { in stv090x_read_status()
3565 reg = STV090x_READ_DEMOD(state, TSSTATUS); in stv090x_read_status()
3566 if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) in stv090x_read_status()
3581 u32 reg, h, m, l; in stv090x_read_per() local
3589 reg = STV090x_READ_DEMOD(state, ERRCNT22); in stv090x_read_per()
3590 h = STV090x_GETFIELD_Px(reg, ERR_CNT2_FIELD); in stv090x_read_per()
3592 reg = STV090x_READ_DEMOD(state, ERRCNT21); in stv090x_read_per()
3593 m = STV090x_GETFIELD_Px(reg, ERR_CNT21_FIELD); in stv090x_read_per()
3595 reg = STV090x_READ_DEMOD(state, ERRCNT20); in stv090x_read_per()
3596 l = STV090x_GETFIELD_Px(reg, ERR_CNT20_FIELD); in stv090x_read_per()
3666 u32 reg; in stv090x_read_signal_strength() local
3670 reg = STV090x_READ_DEMOD(state, AGCIQIN1); in stv090x_read_signal_strength()
3671 agc_1 = STV090x_GETFIELD_Px(reg, AGCIQ_VALUE_FIELD); in stv090x_read_signal_strength()
3672 reg = STV090x_READ_DEMOD(state, AGCIQIN0); in stv090x_read_signal_strength()
3673 agc_0 = STV090x_GETFIELD_Px(reg, AGCIQ_VALUE_FIELD); in stv090x_read_signal_strength()
3690 u32 reg_0, reg_1, reg, i; in stv090x_read_cnr() local
3698 reg = STV090x_READ_DEMOD(state, DSTATUS); in stv090x_read_cnr()
3699 lock_f = STV090x_GETFIELD_Px(reg, LOCK_DEFINITIF_FIELD); in stv090x_read_cnr()
3723 reg = STV090x_READ_DEMOD(state, DSTATUS); in stv090x_read_cnr()
3724 lock_f = STV090x_GETFIELD_Px(reg, LOCK_DEFINITIF_FIELD); in stv090x_read_cnr()
3753 u32 reg; in stv090x_set_tone() local
3755 reg = STV090x_READ_DEMOD(state, DISTXCTL); in stv090x_set_tone()
3758 STV090x_SETFIELD_Px(reg, DISTX_MODE_FIELD, 0); in stv090x_set_tone()
3759 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 1); in stv090x_set_tone()
3760 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_set_tone()
3762 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 0); in stv090x_set_tone()
3763 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_set_tone()
3768 STV090x_SETFIELD_Px(reg, DISTX_MODE_FIELD, 0); in stv090x_set_tone()
3769 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 1); in stv090x_set_tone()
3770 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_set_tone()
3792 u32 reg, idle = 0, fifo_full = 1; in stv090x_send_diseqc_msg() local
3795 reg = STV090x_READ_DEMOD(state, DISTXCTL); in stv090x_send_diseqc_msg()
3797 STV090x_SETFIELD_Px(reg, DISTX_MODE_FIELD, in stv090x_send_diseqc_msg()
3799 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 1); in stv090x_send_diseqc_msg()
3800 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3802 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 0); in stv090x_send_diseqc_msg()
3803 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3806 STV090x_SETFIELD_Px(reg, DIS_PRECHARGE_FIELD, 1); in stv090x_send_diseqc_msg()
3807 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3813 reg = STV090x_READ_DEMOD(state, DISTXSTATUS); in stv090x_send_diseqc_msg()
3814 fifo_full = STV090x_GETFIELD_Px(reg, FIFO_FULL_FIELD); in stv090x_send_diseqc_msg()
3820 reg = STV090x_READ_DEMOD(state, DISTXCTL); in stv090x_send_diseqc_msg()
3821 STV090x_SETFIELD_Px(reg, DIS_PRECHARGE_FIELD, 0); in stv090x_send_diseqc_msg()
3822 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_msg()
3828 reg = STV090x_READ_DEMOD(state, DISTXSTATUS); in stv090x_send_diseqc_msg()
3829 idle = STV090x_GETFIELD_Px(reg, TX_IDLE_FIELD); in stv090x_send_diseqc_msg()
3844 u32 reg, idle = 0, fifo_full = 1; in stv090x_send_diseqc_burst() local
3848 reg = STV090x_READ_DEMOD(state, DISTXCTL); in stv090x_send_diseqc_burst()
3858 STV090x_SETFIELD_Px(reg, DISTX_MODE_FIELD, mode); in stv090x_send_diseqc_burst()
3859 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 1); in stv090x_send_diseqc_burst()
3860 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3862 STV090x_SETFIELD_Px(reg, DISEQC_RESET_FIELD, 0); in stv090x_send_diseqc_burst()
3863 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3866 STV090x_SETFIELD_Px(reg, DIS_PRECHARGE_FIELD, 1); in stv090x_send_diseqc_burst()
3867 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3871 reg = STV090x_READ_DEMOD(state, DISTXSTATUS); in stv090x_send_diseqc_burst()
3872 fifo_full = STV090x_GETFIELD_Px(reg, FIFO_FULL_FIELD); in stv090x_send_diseqc_burst()
3878 reg = STV090x_READ_DEMOD(state, DISTXCTL); in stv090x_send_diseqc_burst()
3879 STV090x_SETFIELD_Px(reg, DIS_PRECHARGE_FIELD, 0); in stv090x_send_diseqc_burst()
3880 if (STV090x_WRITE_DEMOD(state, DISTXCTL, reg) < 0) in stv090x_send_diseqc_burst()
3886 reg = STV090x_READ_DEMOD(state, DISTXSTATUS); in stv090x_send_diseqc_burst()
3887 idle = STV090x_GETFIELD_Px(reg, TX_IDLE_FIELD); in stv090x_send_diseqc_burst()
3901 u32 reg = 0, i = 0, rx_end = 0; in stv090x_recv_slave_reply() local
3906 reg = STV090x_READ_DEMOD(state, DISRX_ST0); in stv090x_recv_slave_reply()
3907 rx_end = STV090x_GETFIELD_Px(reg, RX_END_FIELD); in stv090x_recv_slave_reply()
3911 reply->msg_len = STV090x_GETFIELD_Px(reg, FIFO_BYTENBR_FIELD); in stv090x_recv_slave_reply()
3922 u32 reg; in stv090x_sleep() local
3945 reg = stv090x_read_reg(state, STV090x_TSTTNR1); in stv090x_sleep()
3946 STV090x_SETFIELD(reg, ADC1_PON_FIELD, 0); in stv090x_sleep()
3947 if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) in stv090x_sleep()
3950 reg = stv090x_read_reg(state, STV090x_TSTTNR2); in stv090x_sleep()
3951 STV090x_SETFIELD(reg, DISEQC1_PON_FIELD, 0); in stv090x_sleep()
3952 if (stv090x_write_reg(state, STV090x_TSTTNR2, reg) < 0) in stv090x_sleep()
3957 reg = stv090x_read_reg(state, STV090x_TSTTNR3); in stv090x_sleep()
3958 if (STV090x_GETFIELD(reg, ADC2_PON_FIELD) == 0) in stv090x_sleep()
3962 reg = stv090x_read_reg(state, STV090x_STOPCLK1); in stv090x_sleep()
3964 STV090x_SETFIELD(reg, STOP_CLKPKDT1_FIELD, 1); in stv090x_sleep()
3966 STV090x_SETFIELD(reg, STOP_CLKADCI1_FIELD, 1); in stv090x_sleep()
3970 STV090x_SETFIELD(reg, STOP_CLKFEC_FIELD, 1); in stv090x_sleep()
3971 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_sleep()
3973 reg = stv090x_read_reg(state, STV090x_STOPCLK2); in stv090x_sleep()
3975 STV090x_SETFIELD(reg, STOP_CLKSAMP1_FIELD, 1); in stv090x_sleep()
3977 STV090x_SETFIELD(reg, STOP_CLKVIT1_FIELD, 1); in stv090x_sleep()
3981 STV090x_SETFIELD(reg, STOP_CLKTS_FIELD, 1); in stv090x_sleep()
3982 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_sleep()
3988 reg = stv090x_read_reg(state, STV090x_TSTTNR3); in stv090x_sleep()
3989 STV090x_SETFIELD(reg, ADC2_PON_FIELD, 0); in stv090x_sleep()
3990 if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) in stv090x_sleep()
3993 reg = stv090x_read_reg(state, STV090x_TSTTNR4); in stv090x_sleep()
3994 STV090x_SETFIELD(reg, DISEQC2_PON_FIELD, 0); in stv090x_sleep()
3995 if (stv090x_write_reg(state, STV090x_TSTTNR4, reg) < 0) in stv090x_sleep()
4000 reg = stv090x_read_reg(state, STV090x_TSTTNR1); in stv090x_sleep()
4001 if (STV090x_GETFIELD(reg, ADC1_PON_FIELD) == 0) in stv090x_sleep()
4005 reg = stv090x_read_reg(state, STV090x_STOPCLK1); in stv090x_sleep()
4007 STV090x_SETFIELD(reg, STOP_CLKPKDT2_FIELD, 1); in stv090x_sleep()
4009 STV090x_SETFIELD(reg, STOP_CLKADCI2_FIELD, 1); in stv090x_sleep()
4013 STV090x_SETFIELD(reg, STOP_CLKFEC_FIELD, 1); in stv090x_sleep()
4014 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_sleep()
4016 reg = stv090x_read_reg(state, STV090x_STOPCLK2); in stv090x_sleep()
4018 STV090x_SETFIELD(reg, STOP_CLKSAMP2_FIELD, 1); in stv090x_sleep()
4020 STV090x_SETFIELD(reg, STOP_CLKVIT2_FIELD, 1); in stv090x_sleep()
4024 STV090x_SETFIELD(reg, STOP_CLKTS_FIELD, 1); in stv090x_sleep()
4025 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_sleep()
4036 reg = stv090x_read_reg(state, STV090x_SYNTCTRL); in stv090x_sleep()
4037 STV090x_SETFIELD(reg, STANDBY_FIELD, 0x01); in stv090x_sleep()
4038 if (stv090x_write_reg(state, STV090x_SYNTCTRL, reg) < 0) in stv090x_sleep()
4058 u32 reg; in stv090x_wakeup() local
4067 reg = stv090x_read_reg(state, STV090x_SYNTCTRL); in stv090x_wakeup()
4068 STV090x_SETFIELD(reg, STANDBY_FIELD, 0x00); in stv090x_wakeup()
4069 if (stv090x_write_reg(state, STV090x_SYNTCTRL, reg) < 0) in stv090x_wakeup()
4075 reg = stv090x_read_reg(state, STV090x_TSTTNR1); in stv090x_wakeup()
4076 STV090x_SETFIELD(reg, ADC1_PON_FIELD, 1); in stv090x_wakeup()
4077 if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) in stv090x_wakeup()
4080 reg = stv090x_read_reg(state, STV090x_TSTTNR2); in stv090x_wakeup()
4081 STV090x_SETFIELD(reg, DISEQC1_PON_FIELD, 1); in stv090x_wakeup()
4082 if (stv090x_write_reg(state, STV090x_TSTTNR2, reg) < 0) in stv090x_wakeup()
4086 reg = stv090x_read_reg(state, STV090x_STOPCLK1); in stv090x_wakeup()
4088 STV090x_SETFIELD(reg, STOP_CLKPKDT1_FIELD, 0); in stv090x_wakeup()
4090 STV090x_SETFIELD(reg, STOP_CLKADCI1_FIELD, 0); in stv090x_wakeup()
4092 STV090x_SETFIELD(reg, STOP_CLKFEC_FIELD, 0); in stv090x_wakeup()
4093 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_wakeup()
4095 reg = stv090x_read_reg(state, STV090x_STOPCLK2); in stv090x_wakeup()
4097 STV090x_SETFIELD(reg, STOP_CLKSAMP1_FIELD, 0); in stv090x_wakeup()
4099 STV090x_SETFIELD(reg, STOP_CLKVIT1_FIELD, 0); in stv090x_wakeup()
4101 STV090x_SETFIELD(reg, STOP_CLKTS_FIELD, 0); in stv090x_wakeup()
4102 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_wakeup()
4108 reg = stv090x_read_reg(state, STV090x_TSTTNR3); in stv090x_wakeup()
4109 STV090x_SETFIELD(reg, ADC2_PON_FIELD, 1); in stv090x_wakeup()
4110 if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) in stv090x_wakeup()
4113 reg = stv090x_read_reg(state, STV090x_TSTTNR4); in stv090x_wakeup()
4114 STV090x_SETFIELD(reg, DISEQC2_PON_FIELD, 1); in stv090x_wakeup()
4115 if (stv090x_write_reg(state, STV090x_TSTTNR4, reg) < 0) in stv090x_wakeup()
4119 reg = stv090x_read_reg(state, STV090x_STOPCLK1); in stv090x_wakeup()
4121 STV090x_SETFIELD(reg, STOP_CLKPKDT2_FIELD, 0); in stv090x_wakeup()
4123 STV090x_SETFIELD(reg, STOP_CLKADCI2_FIELD, 0); in stv090x_wakeup()
4125 STV090x_SETFIELD(reg, STOP_CLKFEC_FIELD, 0); in stv090x_wakeup()
4126 if (stv090x_write_reg(state, STV090x_STOPCLK1, reg) < 0) in stv090x_wakeup()
4128 reg = stv090x_read_reg(state, STV090x_STOPCLK2); in stv090x_wakeup()
4130 STV090x_SETFIELD(reg, STOP_CLKSAMP2_FIELD, 0); in stv090x_wakeup()
4132 STV090x_SETFIELD(reg, STOP_CLKVIT2_FIELD, 0); in stv090x_wakeup()
4134 STV090x_SETFIELD(reg, STOP_CLKTS_FIELD, 0); in stv090x_wakeup()
4135 if (stv090x_write_reg(state, STV090x_STOPCLK2, reg) < 0) in stv090x_wakeup()
4170 u32 reg = 0; in stv090x_ldpc_mode() local
4172 reg = stv090x_read_reg(state, STV090x_GENCFG); in stv090x_ldpc_mode()
4177 if ((state->demod_mode != STV090x_DUAL) || (STV090x_GETFIELD(reg, DDEMOD_FIELD) != 1)) { in stv090x_ldpc_mode()
4184 reg = stv090x_read_reg(state, STV090x_TSTRES0); in stv090x_ldpc_mode()
4185 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x1); in stv090x_ldpc_mode()
4186 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4188 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x0); in stv090x_ldpc_mode()
4189 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4243 reg = stv090x_read_reg(state, STV090x_TSTRES0); in stv090x_ldpc_mode()
4244 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x1); in stv090x_ldpc_mode()
4245 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4247 STV090x_SETFIELD(reg, FRESFEC_FIELD, 0x0); in stv090x_ldpc_mode()
4248 if (stv090x_write_reg(state, STV090x_TSTRES0, reg) < 0) in stv090x_ldpc_mode()
4251 reg = STV090x_READ_DEMOD(state, PDELCTRL1); in stv090x_ldpc_mode()
4252 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0x01); in stv090x_ldpc_mode()
4253 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_ldpc_mode()
4255 STV090x_SETFIELD_Px(reg, ALGOSWRST_FIELD, 0x00); in stv090x_ldpc_mode()
4256 if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0) in stv090x_ldpc_mode()
4271 u32 div, reg; in stv090x_get_mclk() local
4275 reg = stv090x_read_reg(state, STV090x_SYNTCTRL); in stv090x_get_mclk()
4276 ratio = STV090x_GETFIELD(reg, SELX1RATIO_FIELD) ? 4 : 6; in stv090x_get_mclk()
4284 u32 reg, div, clk_sel; in stv090x_set_mclk() local
4286 reg = stv090x_read_reg(state, STV090x_SYNTCTRL); in stv090x_set_mclk()
4287 clk_sel = ((STV090x_GETFIELD(reg, SELX1RATIO_FIELD) == 1) ? 4 : 6); in stv090x_set_mclk()
4291 reg = stv090x_read_reg(state, STV090x_NCOARSE); in stv090x_set_mclk()
4292 STV090x_SETFIELD(reg, M_DIV_FIELD, div); in stv090x_set_mclk()
4293 if (stv090x_write_reg(state, STV090x_NCOARSE, reg) < 0) in stv090x_set_mclk()
4313 u32 reg; in stv0900_set_tspath() local
4330 reg = stv090x_read_reg(state, STV090x_P1_TSCFGM); in stv0900_set_tspath()
4331 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3); in stv0900_set_tspath()
4332 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4334 reg = stv090x_read_reg(state, STV090x_P2_TSCFGM); in stv0900_set_tspath()
4335 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3); in stv0900_set_tspath()
4336 if (stv090x_write_reg(state, STV090x_P2_TSCFGM, reg) < 0) in stv0900_set_tspath()
4379 reg = stv090x_read_reg(state, STV090x_P1_TSCFGM); in stv0900_set_tspath()
4380 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3); in stv0900_set_tspath()
4381 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4383 reg = stv090x_read_reg(state, STV090x_P1_TSCFGM); in stv0900_set_tspath()
4384 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 0); in stv0900_set_tspath()
4385 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4416 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0900_set_tspath()
4417 STV090x_SETFIELD_Px(reg, TSFIFO_TEIUPDATE_FIELD, state->config->ts1_tei); in stv0900_set_tspath()
4418 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4419 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4420 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4425 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0900_set_tspath()
4426 STV090x_SETFIELD_Px(reg, TSFIFO_TEIUPDATE_FIELD, state->config->ts1_tei); in stv0900_set_tspath()
4427 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4428 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4429 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4434 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0900_set_tspath()
4435 STV090x_SETFIELD_Px(reg, TSFIFO_TEIUPDATE_FIELD, state->config->ts1_tei); in stv0900_set_tspath()
4436 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4437 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4438 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4443 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0900_set_tspath()
4444 STV090x_SETFIELD_Px(reg, TSFIFO_TEIUPDATE_FIELD, state->config->ts1_tei); in stv0900_set_tspath()
4445 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4446 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4447 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4457 reg = stv090x_read_reg(state, STV090x_P2_TSCFGH); in stv0900_set_tspath()
4458 STV090x_SETFIELD_Px(reg, TSFIFO_TEIUPDATE_FIELD, state->config->ts2_tei); in stv0900_set_tspath()
4459 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4460 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4461 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4466 reg = stv090x_read_reg(state, STV090x_P2_TSCFGH); in stv0900_set_tspath()
4467 STV090x_SETFIELD_Px(reg, TSFIFO_TEIUPDATE_FIELD, state->config->ts2_tei); in stv0900_set_tspath()
4468 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0900_set_tspath()
4469 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4470 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4475 reg = stv090x_read_reg(state, STV090x_P2_TSCFGH); in stv0900_set_tspath()
4476 STV090x_SETFIELD_Px(reg, TSFIFO_TEIUPDATE_FIELD, state->config->ts2_tei); in stv0900_set_tspath()
4477 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4478 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0900_set_tspath()
4479 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4484 reg = stv090x_read_reg(state, STV090x_P2_TSCFGH); in stv0900_set_tspath()
4485 STV090x_SETFIELD_Px(reg, TSFIFO_TEIUPDATE_FIELD, state->config->ts2_tei); in stv0900_set_tspath()
4486 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0900_set_tspath()
4487 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0900_set_tspath()
4488 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4520 reg = stv090x_read_reg(state, STV090x_P1_TSCFGM); in stv0900_set_tspath()
4521 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3); in stv0900_set_tspath()
4522 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0900_set_tspath()
4552 reg = stv090x_read_reg(state, STV090x_P2_TSCFGM); in stv0900_set_tspath()
4553 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3); in stv0900_set_tspath()
4554 if (stv090x_write_reg(state, STV090x_P2_TSCFGM, reg) < 0) in stv0900_set_tspath()
4560 reg = stv090x_read_reg(state, STV090x_P2_TSCFGH); in stv0900_set_tspath()
4561 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); in stv0900_set_tspath()
4562 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4564 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x00); in stv0900_set_tspath()
4565 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) in stv0900_set_tspath()
4568 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0900_set_tspath()
4569 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); in stv0900_set_tspath()
4570 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4572 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x00); in stv0900_set_tspath()
4573 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0900_set_tspath()
4584 u32 reg; in stv0903_set_tspath() local
4616 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0903_set_tspath()
4617 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0903_set_tspath()
4618 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0903_set_tspath()
4619 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4624 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0903_set_tspath()
4625 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x00); in stv0903_set_tspath()
4626 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0903_set_tspath()
4627 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4632 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0903_set_tspath()
4633 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0903_set_tspath()
4634 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x00); in stv0903_set_tspath()
4635 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4640 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0903_set_tspath()
4641 STV090x_SETFIELD_Px(reg, TSFIFO_SERIAL_FIELD, 0x01); in stv0903_set_tspath()
4642 STV090x_SETFIELD_Px(reg, TSFIFO_DVBCI_FIELD, 0x01); in stv0903_set_tspath()
4643 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4675 reg = stv090x_read_reg(state, STV090x_P1_TSCFGM); in stv0903_set_tspath()
4676 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3); in stv0903_set_tspath()
4677 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0) in stv0903_set_tspath()
4683 reg = stv090x_read_reg(state, STV090x_P1_TSCFGH); in stv0903_set_tspath()
4684 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); in stv0903_set_tspath()
4685 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4687 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x00); in stv0903_set_tspath()
4688 if (stv090x_write_reg(state, STV090x_P1_TSCFGH, reg) < 0) in stv0903_set_tspath()
4701 u32 reg; in stv090x_init() local
4734 reg = STV090x_READ_DEMOD(state, TNRCFG2); in stv090x_init()
4735 STV090x_SETFIELD_Px(reg, TUN_IQSWAP_FIELD, state->inversion); in stv090x_init()
4736 if (STV090x_WRITE_DEMOD(state, TNRCFG2, reg) < 0) in stv090x_init()
4738 reg = STV090x_READ_DEMOD(state, DEMOD); in stv090x_init()
4739 STV090x_SETFIELD_Px(reg, ROLLOFF_CONTROL_FIELD, state->rolloff); in stv090x_init()
4740 if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) in stv090x_init()
4783 u32 reg = 0; in stv090x_setup() local
4820 STV090x_SETFIELD_Px(reg, ENARPT_LEVEL_FIELD, config->repeater_level); in stv090x_setup()
4821 if (stv090x_write_reg(state, STV090x_P1_I2CRPT, reg) < 0) in stv090x_setup()
4824 if (stv090x_write_reg(state, STV090x_P2_I2CRPT, reg) < 0) in stv090x_setup()
4867 reg = stv090x_read_reg(state, STV090x_TSTTNR1); in stv090x_setup()
4868 STV090x_SETFIELD(reg, ADC1_INMODE_FIELD, in stv090x_setup()
4870 if (stv090x_write_reg(state, STV090x_TSTTNR1, reg) < 0) in stv090x_setup()
4874 reg = stv090x_read_reg(state, STV090x_TSTTNR3); in stv090x_setup()
4875 STV090x_SETFIELD(reg, ADC2_INMODE_FIELD, in stv090x_setup()
4877 if (stv090x_write_reg(state, STV090x_TSTTNR3, reg) < 0) in stv090x_setup()
4895 u8 reg = 0; in stv090x_set_gpio() local
4897 STV090x_SETFIELD(reg, GPIOx_OPD_FIELD, dir); in stv090x_set_gpio()
4898 STV090x_SETFIELD(reg, GPIOx_CONFIG_FIELD, value); in stv090x_set_gpio()
4899 STV090x_SETFIELD(reg, GPIOx_XOR_FIELD, xor_value); in stv090x_set_gpio()
4901 return stv090x_write_reg(state, STV090x_GPIOxCFG(gpio), reg); in stv090x_set_gpio()