Lines Matching +full:1 +full:v
39 #define MB86A16_NOTICE 1
59 #define TRACE_IN dprintk(verbose, MB86A16_DEBUG, 1, "-->()")
60 #define TRACE_OUT dprintk(verbose, MB86A16_DEBUG, 1, "()-->")
74 dprintk(verbose, MB86A16_DEBUG, 1, in mb86a16_write()
76 state->config->demod_address, buf[0], buf[1]); in mb86a16_write()
78 ret = i2c_transfer(state->i2c_adap, &msg, 1); in mb86a16_write()
80 return (ret != 1) ? -EREMOTEIO : 0; in mb86a16_write()
94 .len = 1 in mb86a16_read()
99 .len = 1 in mb86a16_read()
104 dprintk(verbose, MB86A16_ERROR, 1, "read error(reg=0x%02x, ret=%i)", in mb86a16_read()
130 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in CNTM_set()
140 m = 1 << state->deci; in smrt_set()
147 (state->csel << 1) | in smrt_set()
157 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in smrt_set()
158 return -1; in smrt_set()
168 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in srst()
184 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in afcex_data_set()
186 return -1; in afcex_data_set()
200 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in afcofs_data_set()
213 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in stlp_set()
226 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in Vi_set()
268 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in initial_set()
281 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in S01T_set()
298 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in EN_set()
315 AFCA = 1; in AFCEXEN_set()
323 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in AFCEXEN_set()
337 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in DAGC_data_set()
346 state->deci = 0; state->csel = 0; state->rsel = 1; in smrt_info_get()
348 state->deci = 0; state->csel = 1; state->rsel = 0; in smrt_info_get()
350 state->deci = 0; state->csel = 1; state->rsel = 1; in smrt_info_get()
352 state->deci = 1; state->csel = 0; state->rsel = 0; in smrt_info_get()
354 state->deci = 1; state->csel = 0; state->rsel = 1; in smrt_info_get()
356 state->deci = 1; state->csel = 1; state->rsel = 0; in smrt_info_get()
358 state->deci = 1; state->csel = 1; state->rsel = 1; in smrt_info_get()
362 state->deci = 2; state->csel = 0; state->rsel = 1; in smrt_info_get()
364 state->deci = 2; state->csel = 1; state->rsel = 0; in smrt_info_get()
366 state->deci = 2; state->csel = 1; state->rsel = 1; in smrt_info_get()
370 state->deci = 3; state->csel = 0; state->rsel = 1; in smrt_info_get()
372 state->deci = 3; state->csel = 1; state->rsel = 0; in smrt_info_get()
374 state->deci = 3; state->csel = 1; state->rsel = 1; in smrt_info_get()
378 state->deci = 4; state->csel = 0; state->rsel = 1; in smrt_info_get()
380 state->deci = 4; state->csel = 1; state->rsel = 0; in smrt_info_get()
382 state->deci = 4; state->csel = 1; state->rsel = 1; in smrt_info_get()
386 state->deci = 5; state->csel = 0; state->rsel = 1; in smrt_info_get()
388 state->deci = 5; state->csel = 1; state->rsel = 0; in smrt_info_get()
390 state->deci = 5; state->csel = 1; state->rsel = 1; in smrt_info_get()
410 if (CNTM_set(state, 2, 1, 2) < 0) { in signal_det()
411 dprintk(verbose, MB86A16_ERROR, 1, "CNTM set Error"); in signal_det()
412 return -1; in signal_det()
415 if (CNTM_set(state, 3, 1, 2) < 0) { in signal_det()
416 dprintk(verbose, MB86A16_ERROR, 1, "CNTM set Error"); in signal_det()
417 return -1; in signal_det()
423 else if (i == 1) in signal_det()
432 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in signal_det()
436 if ((S[1] > S[0] * 112 / 100) && (S[1] > S[2] * 112 / 100)) in signal_det()
437 ret = 1; in signal_det()
441 *SIG = S[1]; in signal_det()
443 if (CNTM_set(state, 0, 1, 2) < 0) { in signal_det()
444 dprintk(verbose, MB86A16_ERROR, 1, "CNTM set Error"); in signal_det()
445 return -1; in signal_det()
459 int ack = -1; in rf_val_set()
462 C = 1; in rf_val_set()
473 F = 1; in rf_val_set()
482 B = 1; in rf_val_set()
500 M = f * (1 << R) / 2; in rf_val_set()
502 rf_val[0] = 0x01 | (C << 3) | (F << 1); in rf_val_set()
503 rf_val[1] = (R << 5) | ((M & 0x1f000) >> 12); in rf_val_set()
510 if (mb86a16_write(state, 0x22, rf_val[1]) < 0) in rf_val_set()
519 dprintk(verbose, MB86A16_ERROR, 1, "RF Setup - I2C transfer error"); in rf_val_set()
548 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in afcerr_chk()
567 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in dagcm_val_get()
604 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_read_status()
617 dprintk(verbose, MB86A16_INFO, 1, "Status = %02x,", val); in sync_chk()
623 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in sync_chk()
661 if (afcen == 1) { in freqerr_chk()
666 } else if (afcexen == 1) { in freqerr_chk()
672 if ((afcen == 1) || (afcexen == 1)) { in freqerr_chk()
711 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in freqerr_chk()
722 R = 1; in vco_dev_get()
730 int v, int R, in swp_info_get() argument
740 crnt_swp_freq = fOSC_start * 1000 + v * swp_ofs; in swp_info_get()
758 static int swp_freq_calcuation(struct mb86a16_state *state, int i, int v, int *V, int vmax, int vm… in swp_freq_calcuation() argument
763 if ((i % 2 == 1) && (v <= vmax)) { in swp_freq_calcuation()
764 /* positive v (case 1) */ in swp_freq_calcuation()
765 if ((v - 1 == vmin) && in swp_freq_calcuation()
766 (*(V + 30 + v) >= 0) && in swp_freq_calcuation()
767 (*(V + 30 + v - 1) >= 0) && in swp_freq_calcuation()
768 (*(V + 30 + v - 1) > *(V + 30 + v)) && in swp_freq_calcuation()
769 (*(V + 30 + v - 1) > SIGMIN)) { in swp_freq_calcuation()
772 *SIG1 = *(V + 30 + v - 1); in swp_freq_calcuation()
773 } else if ((v == vmax) && in swp_freq_calcuation()
774 (*(V + 30 + v) >= 0) && in swp_freq_calcuation()
775 (*(V + 30 + v - 1) >= 0) && in swp_freq_calcuation()
776 (*(V + 30 + v) > *(V + 30 + v - 1)) && in swp_freq_calcuation()
777 (*(V + 30 + v) > SIGMIN)) { in swp_freq_calcuation()
780 *SIG1 = *(V + 30 + v); in swp_freq_calcuation()
781 } else if ((*(V + 30 + v) > 0) && in swp_freq_calcuation()
782 (*(V + 30 + v - 1) > 0) && in swp_freq_calcuation()
783 (*(V + 30 + v - 2) > 0) && in swp_freq_calcuation()
784 (*(V + 30 + v - 3) > 0) && in swp_freq_calcuation()
785 (*(V + 30 + v - 1) > *(V + 30 + v)) && in swp_freq_calcuation()
786 (*(V + 30 + v - 2) > *(V + 30 + v - 3)) && in swp_freq_calcuation()
787 ((*(V + 30 + v - 1) > SIGMIN) || in swp_freq_calcuation()
788 (*(V + 30 + v - 2) > SIGMIN))) { in swp_freq_calcuation()
790 if (*(V + 30 + v - 1) >= *(V + 30 + v - 2)) { in swp_freq_calcuation()
792 *SIG1 = *(V + 30 + v - 1); in swp_freq_calcuation()
795 *SIG1 = *(V + 30 + v - 2); in swp_freq_calcuation()
797 } else if ((v == vmax) && in swp_freq_calcuation()
798 (*(V + 30 + v) >= 0) && in swp_freq_calcuation()
799 (*(V + 30 + v - 1) >= 0) && in swp_freq_calcuation()
800 (*(V + 30 + v - 2) >= 0) && in swp_freq_calcuation()
801 (*(V + 30 + v) > *(V + 30 + v - 2)) && in swp_freq_calcuation()
802 (*(V + 30 + v - 1) > *(V + 30 + v - 2)) && in swp_freq_calcuation()
803 ((*(V + 30 + v) > SIGMIN) || in swp_freq_calcuation()
804 (*(V + 30 + v - 1) > SIGMIN))) { in swp_freq_calcuation()
806 if (*(V + 30 + v) >= *(V + 30 + v - 1)) { in swp_freq_calcuation()
808 *SIG1 = *(V + 30 + v); in swp_freq_calcuation()
811 *SIG1 = *(V + 30 + v - 1); in swp_freq_calcuation()
814 swp_freq = -1 ; in swp_freq_calcuation()
816 } else if ((i % 2 == 0) && (v >= vmin)) { in swp_freq_calcuation()
817 /* Negative v (case 1) */ in swp_freq_calcuation()
818 if ((*(V + 30 + v) > 0) && in swp_freq_calcuation()
819 (*(V + 30 + v + 1) > 0) && in swp_freq_calcuation()
820 (*(V + 30 + v + 2) > 0) && in swp_freq_calcuation()
821 (*(V + 30 + v + 1) > *(V + 30 + v)) && in swp_freq_calcuation()
822 (*(V + 30 + v + 1) > *(V + 30 + v + 2)) && in swp_freq_calcuation()
823 (*(V + 30 + v + 1) > SIGMIN)) { in swp_freq_calcuation()
826 *SIG1 = *(V + 30 + v + 1); in swp_freq_calcuation()
827 } else if ((v + 1 == vmax) && in swp_freq_calcuation()
828 (*(V + 30 + v) >= 0) && in swp_freq_calcuation()
829 (*(V + 30 + v + 1) >= 0) && in swp_freq_calcuation()
830 (*(V + 30 + v + 1) > *(V + 30 + v)) && in swp_freq_calcuation()
831 (*(V + 30 + v + 1) > SIGMIN)) { in swp_freq_calcuation()
834 *SIG1 = *(V + 30 + v); in swp_freq_calcuation()
835 } else if ((v == vmin) && in swp_freq_calcuation()
836 (*(V + 30 + v) > 0) && in swp_freq_calcuation()
837 (*(V + 30 + v + 1) > 0) && in swp_freq_calcuation()
838 (*(V + 30 + v + 2) > 0) && in swp_freq_calcuation()
839 (*(V + 30 + v) > *(V + 30 + v + 1)) && in swp_freq_calcuation()
840 (*(V + 30 + v) > *(V + 30 + v + 2)) && in swp_freq_calcuation()
841 (*(V + 30 + v) > SIGMIN)) { in swp_freq_calcuation()
844 *SIG1 = *(V + 30 + v); in swp_freq_calcuation()
845 } else if ((*(V + 30 + v) >= 0) && in swp_freq_calcuation()
846 (*(V + 30 + v + 1) >= 0) && in swp_freq_calcuation()
847 (*(V + 30 + v + 2) >= 0) && in swp_freq_calcuation()
848 (*(V + 30 + v + 3) >= 0) && in swp_freq_calcuation()
849 (*(V + 30 + v + 1) > *(V + 30 + v)) && in swp_freq_calcuation()
850 (*(V + 30 + v + 2) > *(V + 30 + v + 3)) && in swp_freq_calcuation()
851 ((*(V + 30 + v + 1) > SIGMIN) || in swp_freq_calcuation()
852 (*(V + 30 + v + 2) > SIGMIN))) { in swp_freq_calcuation()
854 if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) { in swp_freq_calcuation()
856 *SIG1 = *(V + 30 + v + 1); in swp_freq_calcuation()
859 *SIG1 = *(V + 30 + v + 2); in swp_freq_calcuation()
861 } else if ((*(V + 30 + v) >= 0) && in swp_freq_calcuation()
862 (*(V + 30 + v + 1) >= 0) && in swp_freq_calcuation()
863 (*(V + 30 + v + 2) >= 0) && in swp_freq_calcuation()
864 (*(V + 30 + v + 3) >= 0) && in swp_freq_calcuation()
865 (*(V + 30 + v) > *(V + 30 + v + 2)) && in swp_freq_calcuation()
866 (*(V + 30 + v + 1) > *(V + 30 + v + 2)) && in swp_freq_calcuation()
867 (*(V + 30 + v) > *(V + 30 + v + 3)) && in swp_freq_calcuation()
868 (*(V + 30 + v + 1) > *(V + 30 + v + 3)) && in swp_freq_calcuation()
869 ((*(V + 30 + v) > SIGMIN) || in swp_freq_calcuation()
870 (*(V + 30 + v + 1) > SIGMIN))) { in swp_freq_calcuation()
872 if (*(V + 30 + v) >= *(V + 30 + v + 1)) { in swp_freq_calcuation()
874 *SIG1 = *(V + 30 + v); in swp_freq_calcuation()
877 *SIG1 = *(V + 30 + v + 1); in swp_freq_calcuation()
879 } else if ((v + 2 == vmin) && in swp_freq_calcuation()
880 (*(V + 30 + v) >= 0) && in swp_freq_calcuation()
881 (*(V + 30 + v + 1) >= 0) && in swp_freq_calcuation()
882 (*(V + 30 + v + 2) >= 0) && in swp_freq_calcuation()
883 (*(V + 30 + v + 1) > *(V + 30 + v)) && in swp_freq_calcuation()
884 (*(V + 30 + v + 2) > *(V + 30 + v)) && in swp_freq_calcuation()
885 ((*(V + 30 + v + 1) > SIGMIN) || in swp_freq_calcuation()
886 (*(V + 30 + v + 2) > SIGMIN))) { in swp_freq_calcuation()
888 if (*(V + 30 + v + 1) >= *(V + 30 + v + 2)) { in swp_freq_calcuation()
890 *SIG1 = *(V + 30 + v + 1); in swp_freq_calcuation()
893 *SIG1 = *(V + 30 + v + 2); in swp_freq_calcuation()
895 } else if ((vmax == 0) && (vmin == 0) && (*(V + 30 + v) > SIGMIN)) { in swp_freq_calcuation()
897 *SIG1 = *(V + 30 + v); in swp_freq_calcuation()
899 swp_freq = -1; in swp_freq_calcuation()
901 swp_freq = -1; in swp_freq_calcuation()
948 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in SEQ_set()
959 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in iq_vt_set()
969 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in FEC_srst()
979 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in S2T_set()
989 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in S45T_set()
1007 int V[60]; in mb86a16_set_fe() local
1025 int v, vmax, vmin; in mb86a16_set_fe() local
1038 int ret = -1; in mb86a16_set_fe()
1041 dprintk(verbose, MB86A16_INFO, 1, "freq=%d Mhz, symbrt=%d Ksps", state->frequency, state->srate); in mb86a16_set_fe()
1047 V[i] = -1; in mb86a16_set_fe()
1054 for (n = 0; ((n < 3) && (ret == -1)); n++) { in mb86a16_set_fe()
1060 AFCEXEN = 1; in mb86a16_set_fe()
1062 TIMINT2 = 1; in mb86a16_set_fe()
1068 dprintk(verbose, MB86A16_ERROR, 1, "initial set failed"); in mb86a16_set_fe()
1069 return -1; in mb86a16_set_fe()
1072 dprintk(verbose, MB86A16_ERROR, 1, "DAGC data set error"); in mb86a16_set_fe()
1073 return -1; in mb86a16_set_fe()
1076 dprintk(verbose, MB86A16_ERROR, 1, "EN set error"); in mb86a16_set_fe()
1077 return -1; /* (0, 0) */ in mb86a16_set_fe()
1080 dprintk(verbose, MB86A16_ERROR, 1, "AFCEXEN set error"); in mb86a16_set_fe()
1081 return -1; /* (1, smrt) = (1, symbolrate) */ in mb86a16_set_fe()
1084 dprintk(verbose, MB86A16_ERROR, 1, "CNTM set error"); in mb86a16_set_fe()
1085 return -1; /* (0, 1, 2) */ in mb86a16_set_fe()
1088 dprintk(verbose, MB86A16_ERROR, 1, "S01T set error"); in mb86a16_set_fe()
1089 return -1; /* (0, 0) */ in mb86a16_set_fe()
1093 dprintk(verbose, MB86A16_ERROR, 1, "smrt info get error"); in mb86a16_set_fe()
1094 return -1; in mb86a16_set_fe()
1098 if (R == 1) in mb86a16_set_fe()
1105 fOSC_start = state->frequency + 1; in mb86a16_set_fe()
1107 fOSC_start = state->frequency - 1; in mb86a16_set_fe()
1110 loop = 1; in mb86a16_set_fe()
1113 while (loop == 1) { in mb86a16_set_fe()
1128 loop = 1; in mb86a16_set_fe()
1131 while (loop == 1) { in mb86a16_set_fe()
1148 wait_t = 1; in mb86a16_set_fe()
1153 loop = 1; in mb86a16_set_fe()
1157 v = 0; in mb86a16_set_fe()
1159 while (loop == 1) { in mb86a16_set_fe()
1161 v, R, swp_ofs, &fOSC, in mb86a16_set_fe()
1166 dprintk(verbose, MB86A16_ERROR, 1, "rf val set error"); in mb86a16_set_fe()
1167 return -1; in mb86a16_set_fe()
1171 dprintk(verbose, MB86A16_ERROR, 1, "afcex data set error"); in mb86a16_set_fe()
1172 return -1; in mb86a16_set_fe()
1175 dprintk(verbose, MB86A16_ERROR, 1, "srst error"); in mb86a16_set_fe()
1176 return -1; in mb86a16_set_fe()
1181 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_set_fe()
1182 return -1; in mb86a16_set_fe()
1184 V[30 + v] = SIG1 ; in mb86a16_set_fe()
1185 swp_freq = swp_freq_calcuation(state, i, v, V, vmax, vmin, in mb86a16_set_fe()
1192 signal_dupl = 1; in mb86a16_set_fe()
1193 dprintk(verbose, MB86A16_INFO, 1, "Probably Duplicate Signal, j = %d", j); in mb86a16_set_fe()
1197 …dprintk(verbose, MB86A16_DEBUG, 1, "------ Signal detect ------ [swp_freq=[%07d, srate=%05d]]", sw… in mb86a16_set_fe()
1205 dprintk(verbose, MB86A16_ERROR, 1, "rf val set error"); in mb86a16_set_fe()
1206 return -1; in mb86a16_set_fe()
1209 dprintk(verbose, MB86A16_ERROR, 1, "afcex data set error"); in mb86a16_set_fe()
1210 return -1; in mb86a16_set_fe()
1213 if (signal == 1) { in mb86a16_set_fe()
1214 dprintk(verbose, MB86A16_ERROR, 1, "***** Signal Found *****"); in mb86a16_set_fe()
1217 dprintk(verbose, MB86A16_ERROR, 1, "!!!!! No signal !!!!!, try again..."); in mb86a16_set_fe()
1220 dprintk(verbose, MB86A16_ERROR, 1, "smrt set error"); in mb86a16_set_fe()
1221 return -1; in mb86a16_set_fe()
1225 if (v > vmax) in mb86a16_set_fe()
1226 vmax_his = 1 ; in mb86a16_set_fe()
1227 if (v < vmin) in mb86a16_set_fe()
1228 vmin_his = 1 ; in mb86a16_set_fe()
1231 if ((i % 2 == 1) && (vmax_his == 1)) in mb86a16_set_fe()
1233 if ((i % 2 == 0) && (vmin_his == 1)) in mb86a16_set_fe()
1236 if (i % 2 == 1) in mb86a16_set_fe()
1237 v = (i + 1) / 2; in mb86a16_set_fe()
1239 v = -i / 2; in mb86a16_set_fe()
1241 if ((vmax_his == 1) && (vmin_his == 1)) in mb86a16_set_fe()
1245 if (signal == 1) { in mb86a16_set_fe()
1246 dprintk(verbose, MB86A16_INFO, 1, " Start Freq Error Check"); in mb86a16_set_fe()
1248 S0T = 1 ; in mb86a16_set_fe()
1250 AFCEN = 1 ; in mb86a16_set_fe()
1254 dprintk(verbose, MB86A16_ERROR, 1, "S01T set error"); in mb86a16_set_fe()
1255 return -1; in mb86a16_set_fe()
1259 dprintk(verbose, MB86A16_ERROR, 1, "smrt set error"); in mb86a16_set_fe()
1260 return -1; in mb86a16_set_fe()
1263 dprintk(verbose, MB86A16_ERROR, 1, "EN set error"); in mb86a16_set_fe()
1264 return -1; in mb86a16_set_fe()
1267 dprintk(verbose, MB86A16_ERROR, 1, "AFCEXEN set error"); in mb86a16_set_fe()
1268 return -1; in mb86a16_set_fe()
1272 dprintk(verbose, MB86A16_ERROR, 1, "AFCOFS data set error"); in mb86a16_set_fe()
1273 return -1; in mb86a16_set_fe()
1276 dprintk(verbose, MB86A16_ERROR, 1, "srst error"); in mb86a16_set_fe()
1277 return -1; in mb86a16_set_fe()
1283 if (afcerr == -1) in mb86a16_set_fe()
1284 return -1; in mb86a16_set_fe()
1287 AFCEXEN = 1 ; in mb86a16_set_fe()
1294 dprintk(verbose, MB86A16_ERROR, 1, "smrt set error"); in mb86a16_set_fe()
1295 return -1; in mb86a16_set_fe()
1298 dprintk(verbose, MB86A16_ERROR, 1, "AFCEXEN set error"); in mb86a16_set_fe()
1299 return -1; in mb86a16_set_fe()
1303 dprintk(verbose, MB86A16_ERROR, 1, "DAGC data set error"); in mb86a16_set_fe()
1304 return -1; in mb86a16_set_fe()
1307 temp_freq = swp_freq + (i - 1) * state->srate / 8; in mb86a16_set_fe()
1310 dprintk(verbose, MB86A16_ERROR, 1, "rf val set error"); in mb86a16_set_fe()
1311 return -1; in mb86a16_set_fe()
1314 dprintk(verbose, MB86A16_ERROR, 1, "afcex data set error"); in mb86a16_set_fe()
1315 return -1; in mb86a16_set_fe()
1321 if ((dagcm[0] > dagcm[1]) && in mb86a16_set_fe()
1323 (dagcm[0] - dagcm[1] > 2 * (dagcm[2] - dagcm[1]))) { in mb86a16_set_fe()
1328 dprintk(verbose, MB86A16_ERROR, 1, "rf val set error"); in mb86a16_set_fe()
1329 return -1; in mb86a16_set_fe()
1332 dprintk(verbose, MB86A16_ERROR, 1, "afcex data set"); in mb86a16_set_fe()
1333 return -1; in mb86a16_set_fe()
1338 if (dagcm[3] > dagcm[1]) in mb86a16_set_fe()
1339 delta_freq = (dagcm[2] - dagcm[0] + dagcm[1] - dagcm[3]) * state->srate / 300; in mb86a16_set_fe()
1342 } else if ((dagcm[2] > dagcm[1]) && in mb86a16_set_fe()
1344 (dagcm[2] - dagcm[1] > 2 * (dagcm[0] - dagcm[1]))) { in mb86a16_set_fe()
1349 dprintk(verbose, MB86A16_ERROR, 1, "rf val set"); in mb86a16_set_fe()
1350 return -1; in mb86a16_set_fe()
1353 dprintk(verbose, MB86A16_ERROR, 1, "afcex data set"); in mb86a16_set_fe()
1354 return -1; in mb86a16_set_fe()
1359 if (dagcm[3] > dagcm[1]) in mb86a16_set_fe()
1360 delta_freq = (dagcm[2] - dagcm[0] + dagcm[3] - dagcm[1]) * state->srate / 300; in mb86a16_set_fe()
1367 dprintk(verbose, MB86A16_INFO, 1, "SWEEP Frequency = %d", swp_freq); in mb86a16_set_fe()
1369 …dprintk(verbose, MB86A16_INFO, 1, "Adjusting .., DELTA Freq = %d, SWEEP Freq=%d", delta_freq, swp_… in mb86a16_set_fe()
1371 dprintk(verbose, MB86A16_INFO, 1, "NO -- SIGNAL !"); in mb86a16_set_fe()
1376 CREN = 1; in mb86a16_set_fe()
1378 AFCEXEN = 1; in mb86a16_set_fe()
1381 dprintk(verbose, MB86A16_ERROR, 1, "S01T set error"); in mb86a16_set_fe()
1382 return -1; in mb86a16_set_fe()
1385 dprintk(verbose, MB86A16_ERROR, 1, "DAGC data set error"); in mb86a16_set_fe()
1386 return -1; in mb86a16_set_fe()
1391 dprintk(verbose, MB86A16_ERROR, 1, "smrt set error"); in mb86a16_set_fe()
1392 return -1; in mb86a16_set_fe()
1395 dprintk(verbose, MB86A16_ERROR, 1, "EN set error"); in mb86a16_set_fe()
1396 return -1; in mb86a16_set_fe()
1399 dprintk(verbose, MB86A16_ERROR, 1, "AFCEXEN set error"); in mb86a16_set_fe()
1400 return -1; in mb86a16_set_fe()
1404 dprintk(verbose, MB86A16_ERROR, 1, "rf val set error"); in mb86a16_set_fe()
1405 return -1; in mb86a16_set_fe()
1408 dprintk(verbose, MB86A16_ERROR, 1, "afcex data set error"); in mb86a16_set_fe()
1409 return -1; in mb86a16_set_fe()
1412 dprintk(verbose, MB86A16_ERROR, 1, "srst error"); in mb86a16_set_fe()
1413 return -1; in mb86a16_set_fe()
1417 wait_t = 1; in mb86a16_set_fe()
1420 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_set_fe()
1425 S2T = 4; S4T = 1; S5T = 6; ETH = 4; VIA = 6; in mb86a16_set_fe()
1447 dprintk(verbose, MB86A16_INFO, 1, "-------- Viterbi=[%d] SYNC=[%d] ---------", VIRM, sync); in mb86a16_set_fe()
1459 iq_vt_set(state, 1); in mb86a16_set_fe()
1463 /* 1/2, 2/3, 3/4, 7/8 */ in mb86a16_set_fe()
1469 SEQ_set(state, 1); in mb86a16_set_fe()
1471 dprintk(verbose, MB86A16_INFO, 1, "NO -- SYNC"); in mb86a16_set_fe()
1472 SEQ_set(state, 1); in mb86a16_set_fe()
1473 ret = -1; in mb86a16_set_fe()
1477 dprintk(verbose, MB86A16_INFO, 1, "NO -- SIGNAL"); in mb86a16_set_fe()
1478 ret = -1; in mb86a16_set_fe()
1483 dprintk(verbose, MB86A16_INFO, 1, "******* SYNC *******"); in mb86a16_set_fe()
1484 freqerr_chk(state, state->frequency, state->srate, 1); in mb86a16_set_fe()
1491 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_set_fe()
1494 dprintk(verbose, MB86A16_INFO, 1, "AGC = %02x CNM = %02x", agcval, cnmval); in mb86a16_set_fe()
1539 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_send_diseqc_msg()
1568 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_send_diseqc_burst()
1601 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_set_tone()
1614 dprintk(verbose, MB86A16_ERROR, 1, "Successfully acquired LOCK"); in mb86a16_search()
1618 dprintk(verbose, MB86A16_ERROR, 1, "Lock acquisition failed!"); in mb86a16_search()
1660 dprintk(verbose, MB86A16_DEBUG, 1, "BER coarse=[0x%02x]", *ber); in mb86a16_read_ber()
1663 * BER_SEL = 1, The monitored BER is the estimated in mb86a16_read_ber()
1672 else if (ber_rst == 1) in mb86a16_read_ber()
1680 dprintk(verbose, MB86A16_DEBUG, 1, "BER fine=[0x%02x]", *ber); in mb86a16_read_ber()
1688 ber_tim = (ber_mon >> 1) & 0x01; in mb86a16_read_ber()
1692 else /* ber_tim == 1 */ in mb86a16_read_ber()
1696 dprintk(verbose, MB86A16_DEBUG, 1, "BER fine=[0x%02x]", *ber); in mb86a16_read_ber()
1701 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_read_ber()
1712 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_read_signal_strength()
1717 dprintk(verbose, MB86A16_DEBUG, 1, "Signal strength=[%d %%]", (u8) *strength); in mb86a16_read_signal_strength()
1761 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_read_snr()
1772 dprintk(verbose, MB86A16_ERROR, 1, "SNR (Quality) = [%d dB], Level=%d %%", *snr, q_level); in mb86a16_read_snr()
1784 dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); in mb86a16_read_ucblocks()