Lines Matching refs:rc
355 int rc, size, pos = 0; in r820t_write() local
370 rc = tuner_i2c_xfer_send(&priv->i2c_props, priv->buf, size + 1); in r820t_write()
371 if (rc != size + 1) { in r820t_write()
373 __func__, rc, reg, size, size, &priv->buf[1]); in r820t_write()
374 if (rc < 0) in r820t_write()
375 return rc; in r820t_write()
410 int rc = r820t_read_cache_reg(priv, reg); in r820t_write_reg_mask() local
412 if (rc < 0) in r820t_write_reg_mask()
413 return rc; in r820t_write_reg_mask()
415 tmp = (rc & ~bit_mask) | (tmp & bit_mask); in r820t_write_reg_mask()
422 int rc, i; in r820t_read() local
427 rc = tuner_i2c_xfer_send_recv(&priv->i2c_props, priv->buf, 1, p, len); in r820t_read()
428 if (rc != len) { in r820t_read()
430 __func__, rc, reg, len, len, p); in r820t_read()
431 if (rc < 0) in r820t_read()
432 return rc; in r820t_read()
453 int i, rc; in r820t_set_mux() local
467 rc = r820t_write_reg_mask(priv, 0x17, range->open_d, 0x08); in r820t_set_mux()
468 if (rc < 0) in r820t_set_mux()
469 return rc; in r820t_set_mux()
472 rc = r820t_write_reg_mask(priv, 0x1a, range->rf_mux_ploy, 0xc3); in r820t_set_mux()
473 if (rc < 0) in r820t_set_mux()
474 return rc; in r820t_set_mux()
477 rc = r820t_write_reg(priv, 0x1b, range->tf_c); in r820t_set_mux()
478 if (rc < 0) in r820t_set_mux()
479 return rc; in r820t_set_mux()
498 rc = r820t_write_reg_mask(priv, 0x10, val, 0x0b); in r820t_set_mux()
499 if (rc < 0) in r820t_set_mux()
500 return rc; in r820t_set_mux()
509 rc = r820t_write_reg_mask(priv, 0x08, reg08, 0x3f); in r820t_set_mux()
510 if (rc < 0) in r820t_set_mux()
511 return rc; in r820t_set_mux()
513 rc = r820t_write_reg_mask(priv, 0x09, reg09, 0x3f); in r820t_set_mux()
515 return rc; in r820t_set_mux()
522 int rc, i; in r820t_set_pll() local
560 rc = r820t_write_reg_mask(priv, 0x10, refdiv2, 0x10); in r820t_set_pll()
561 if (rc < 0) in r820t_set_pll()
562 return rc; in r820t_set_pll()
565 rc = r820t_write_reg_mask(priv, 0x1a, 0x00, 0x0c); in r820t_set_pll()
566 if (rc < 0) in r820t_set_pll()
567 return rc; in r820t_set_pll()
570 rc = r820t_write_reg_mask(priv, 0x12, 0x80, 0xe0); in r820t_set_pll()
571 if (rc < 0) in r820t_set_pll()
572 return rc; in r820t_set_pll()
588 rc = r820t_read(priv, 0x00, data, sizeof(data)); in r820t_set_pll()
589 if (rc < 0) in r820t_set_pll()
590 return rc; in r820t_set_pll()
608 rc = r820t_write_reg_mask(priv, 0x10, div_num << 5, 0xe0); in r820t_set_pll()
609 if (rc < 0) in r820t_set_pll()
610 return rc; in r820t_set_pll()
631 rc = r820t_write_reg(priv, 0x14, ni + (si << 6)); in r820t_set_pll()
632 if (rc < 0) in r820t_set_pll()
633 return rc; in r820t_set_pll()
641 rc = r820t_write_reg_mask(priv, 0x12, val, 0x08); in r820t_set_pll()
642 if (rc < 0) in r820t_set_pll()
643 return rc; in r820t_set_pll()
659 rc = r820t_write_reg(priv, 0x16, sdm >> 8); in r820t_set_pll()
660 if (rc < 0) in r820t_set_pll()
661 return rc; in r820t_set_pll()
662 rc = r820t_write_reg(priv, 0x15, sdm & 0xff); in r820t_set_pll()
663 if (rc < 0) in r820t_set_pll()
664 return rc; in r820t_set_pll()
670 rc = r820t_read(priv, 0x00, data, 3); in r820t_set_pll()
671 if (rc < 0) in r820t_set_pll()
672 return rc; in r820t_set_pll()
678 rc = r820t_write_reg_mask(priv, 0x12, 0x60, 0xe0); in r820t_set_pll()
679 if (rc < 0) in r820t_set_pll()
680 return rc; in r820t_set_pll()
693 rc = r820t_write_reg_mask(priv, 0x1a, 0x08, 0x08); in r820t_set_pll()
695 return rc; in r820t_set_pll()
703 int rc; in r820t_sysfreq_sel() local
798 rc = r820t_write_reg_mask(priv, 0x06, pre_dect, 0x40); in r820t_sysfreq_sel()
799 if (rc < 0) in r820t_sysfreq_sel()
800 return rc; in r820t_sysfreq_sel()
803 rc = r820t_write_reg_mask(priv, 0x1d, lna_top, 0xc7); in r820t_sysfreq_sel()
804 if (rc < 0) in r820t_sysfreq_sel()
805 return rc; in r820t_sysfreq_sel()
806 rc = r820t_write_reg_mask(priv, 0x1c, mixer_top, 0xf8); in r820t_sysfreq_sel()
807 if (rc < 0) in r820t_sysfreq_sel()
808 return rc; in r820t_sysfreq_sel()
809 rc = r820t_write_reg(priv, 0x0d, lna_vth_l); in r820t_sysfreq_sel()
810 if (rc < 0) in r820t_sysfreq_sel()
811 return rc; in r820t_sysfreq_sel()
812 rc = r820t_write_reg(priv, 0x0e, mixer_vth_l); in r820t_sysfreq_sel()
813 if (rc < 0) in r820t_sysfreq_sel()
814 return rc; in r820t_sysfreq_sel()
817 rc = r820t_write_reg_mask(priv, 0x05, air_cable1_in, 0x60); in r820t_sysfreq_sel()
818 if (rc < 0) in r820t_sysfreq_sel()
819 return rc; in r820t_sysfreq_sel()
820 rc = r820t_write_reg_mask(priv, 0x06, cable2_in, 0x08); in r820t_sysfreq_sel()
821 if (rc < 0) in r820t_sysfreq_sel()
822 return rc; in r820t_sysfreq_sel()
824 rc = r820t_write_reg_mask(priv, 0x11, cp_cur, 0x38); in r820t_sysfreq_sel()
825 if (rc < 0) in r820t_sysfreq_sel()
826 return rc; in r820t_sysfreq_sel()
827 rc = r820t_write_reg_mask(priv, 0x17, div_buf_cur, 0x30); in r820t_sysfreq_sel()
828 if (rc < 0) in r820t_sysfreq_sel()
829 return rc; in r820t_sysfreq_sel()
830 rc = r820t_write_reg_mask(priv, 0x0a, filter_cur, 0x60); in r820t_sysfreq_sel()
831 if (rc < 0) in r820t_sysfreq_sel()
832 return rc; in r820t_sysfreq_sel()
846 rc = r820t_write_reg_mask(priv, 0x1d, 0, 0x38); in r820t_sysfreq_sel()
847 if (rc < 0) in r820t_sysfreq_sel()
848 return rc; in r820t_sysfreq_sel()
851 rc = r820t_write_reg_mask(priv, 0x1c, 0, 0x04); in r820t_sysfreq_sel()
852 if (rc < 0) in r820t_sysfreq_sel()
853 return rc; in r820t_sysfreq_sel()
856 rc = r820t_write_reg_mask(priv, 0x06, 0, 0x40); in r820t_sysfreq_sel()
857 if (rc < 0) in r820t_sysfreq_sel()
858 return rc; in r820t_sysfreq_sel()
861 rc = r820t_write_reg_mask(priv, 0x1a, 0x30, 0x30); in r820t_sysfreq_sel()
862 if (rc < 0) in r820t_sysfreq_sel()
863 return rc; in r820t_sysfreq_sel()
868 rc = r820t_write_reg_mask(priv, 0x1d, 0x18, 0x38); in r820t_sysfreq_sel()
869 if (rc < 0) in r820t_sysfreq_sel()
870 return rc; in r820t_sysfreq_sel()
877 rc = r820t_write_reg_mask(priv, 0x1c, mixer_top, 0x04); in r820t_sysfreq_sel()
878 if (rc < 0) in r820t_sysfreq_sel()
879 return rc; in r820t_sysfreq_sel()
882 rc = r820t_write_reg_mask(priv, 0x1e, lna_discharge, 0x1f); in r820t_sysfreq_sel()
883 if (rc < 0) in r820t_sysfreq_sel()
884 return rc; in r820t_sysfreq_sel()
887 rc = r820t_write_reg_mask(priv, 0x1a, 0x20, 0x30); in r820t_sysfreq_sel()
888 if (rc < 0) in r820t_sysfreq_sel()
889 return rc; in r820t_sysfreq_sel()
892 rc = r820t_write_reg_mask(priv, 0x06, 0, 0x40); in r820t_sysfreq_sel()
893 if (rc < 0) in r820t_sysfreq_sel()
894 return rc; in r820t_sysfreq_sel()
897 rc = r820t_write_reg_mask(priv, 0x1d, lna_top, 0x38); in r820t_sysfreq_sel()
898 if (rc < 0) in r820t_sysfreq_sel()
899 return rc; in r820t_sysfreq_sel()
906 rc = r820t_write_reg_mask(priv, 0x1c, mixer_top, 0x04); in r820t_sysfreq_sel()
907 if (rc < 0) in r820t_sysfreq_sel()
908 return rc; in r820t_sysfreq_sel()
911 rc = r820t_write_reg_mask(priv, 0x1e, lna_discharge, 0x1f); in r820t_sysfreq_sel()
912 if (rc < 0) in r820t_sysfreq_sel()
913 return rc; in r820t_sysfreq_sel()
916 rc = r820t_write_reg_mask(priv, 0x1a, 0x00, 0x30); in r820t_sysfreq_sel()
917 if (rc < 0) in r820t_sysfreq_sel()
918 return rc; in r820t_sysfreq_sel()
920 rc = r820t_write_reg_mask(priv, 0x10, 0x00, 0x04); in r820t_sysfreq_sel()
921 if (rc < 0) in r820t_sysfreq_sel()
922 return rc; in r820t_sysfreq_sel()
933 int rc, i; in r820t_set_tv_standard() local
1047 rc = r820t_write_reg_mask(priv, 0x0c, val, 0x0f); in r820t_set_tv_standard()
1048 if (rc < 0) in r820t_set_tv_standard()
1049 return rc; in r820t_set_tv_standard()
1052 rc = r820t_write_reg_mask(priv, 0x13, VER_NUM, 0x3f); in r820t_set_tv_standard()
1053 if (rc < 0) in r820t_set_tv_standard()
1054 return rc; in r820t_set_tv_standard()
1058 rc = r820t_write_reg_mask(priv, 0x1d, 0x00, 0x38); in r820t_set_tv_standard()
1059 if (rc < 0) in r820t_set_tv_standard()
1060 return rc; in r820t_set_tv_standard()
1080 rc = r820t_write_reg_mask(priv, 0x0b, hp_cor, 0x60); in r820t_set_tv_standard()
1081 if (rc < 0) in r820t_set_tv_standard()
1082 return rc; in r820t_set_tv_standard()
1085 rc = r820t_write_reg_mask(priv, 0x0f, 0x04, 0x04); in r820t_set_tv_standard()
1086 if (rc < 0) in r820t_set_tv_standard()
1087 return rc; in r820t_set_tv_standard()
1090 rc = r820t_write_reg_mask(priv, 0x10, 0x00, 0x03); in r820t_set_tv_standard()
1091 if (rc < 0) in r820t_set_tv_standard()
1092 return rc; in r820t_set_tv_standard()
1094 rc = r820t_set_pll(priv, type, filt_cal_lo * 1000); in r820t_set_tv_standard()
1095 if (rc < 0 || !priv->has_lock) in r820t_set_tv_standard()
1096 return rc; in r820t_set_tv_standard()
1099 rc = r820t_write_reg_mask(priv, 0x0b, 0x10, 0x10); in r820t_set_tv_standard()
1100 if (rc < 0) in r820t_set_tv_standard()
1101 return rc; in r820t_set_tv_standard()
1106 rc = r820t_write_reg_mask(priv, 0x0b, 0x00, 0x10); in r820t_set_tv_standard()
1107 if (rc < 0) in r820t_set_tv_standard()
1108 return rc; in r820t_set_tv_standard()
1111 rc = r820t_write_reg_mask(priv, 0x0f, 0x00, 0x04); in r820t_set_tv_standard()
1112 if (rc < 0) in r820t_set_tv_standard()
1113 return rc; in r820t_set_tv_standard()
1116 rc = r820t_read(priv, 0x00, data, sizeof(data)); in r820t_set_tv_standard()
1117 if (rc < 0) in r820t_set_tv_standard()
1118 return rc; in r820t_set_tv_standard()
1129 rc = r820t_write_reg_mask(priv, 0x0a, in r820t_set_tv_standard()
1131 if (rc < 0) in r820t_set_tv_standard()
1132 return rc; in r820t_set_tv_standard()
1135 rc = r820t_write_reg_mask(priv, 0x0b, hp_cor, 0xef); in r820t_set_tv_standard()
1136 if (rc < 0) in r820t_set_tv_standard()
1137 return rc; in r820t_set_tv_standard()
1141 rc = r820t_write_reg_mask(priv, 0x07, img_r, 0x80); in r820t_set_tv_standard()
1142 if (rc < 0) in r820t_set_tv_standard()
1143 return rc; in r820t_set_tv_standard()
1146 rc = r820t_write_reg_mask(priv, 0x06, filt_gain, 0x30); in r820t_set_tv_standard()
1147 if (rc < 0) in r820t_set_tv_standard()
1148 return rc; in r820t_set_tv_standard()
1151 rc = r820t_write_reg_mask(priv, 0x1e, ext_enable, 0x60); in r820t_set_tv_standard()
1152 if (rc < 0) in r820t_set_tv_standard()
1153 return rc; in r820t_set_tv_standard()
1156 rc = r820t_write_reg_mask(priv, 0x05, loop_through, 0x80); in r820t_set_tv_standard()
1157 if (rc < 0) in r820t_set_tv_standard()
1158 return rc; in r820t_set_tv_standard()
1161 rc = r820t_write_reg_mask(priv, 0x1f, lt_att, 0x80); in r820t_set_tv_standard()
1162 if (rc < 0) in r820t_set_tv_standard()
1163 return rc; in r820t_set_tv_standard()
1166 rc = r820t_write_reg_mask(priv, 0x0f, flt_ext_widest, 0x80); in r820t_set_tv_standard()
1167 if (rc < 0) in r820t_set_tv_standard()
1168 return rc; in r820t_set_tv_standard()
1171 rc = r820t_write_reg_mask(priv, 0x19, polyfil_cur, 0x60); in r820t_set_tv_standard()
1172 if (rc < 0) in r820t_set_tv_standard()
1173 return rc; in r820t_set_tv_standard()
1187 int rc; in r820t_read_gain() local
1189 rc = r820t_read(priv, 0x00, data, sizeof(data)); in r820t_read_gain()
1190 if (rc < 0) in r820t_read_gain()
1191 return rc; in r820t_read_gain()
1217 int rc;
1225 rc = r820t_write_reg_mask(priv, 0x05, 0x10, 0x10);
1226 if (rc < 0)
1227 return rc;
1230 rc = r820t_write_reg_mask(priv, 0x07, 0, 0x10);
1231 if (rc < 0)
1232 return rc;
1234 rc = r820t_read(priv, 0x00, data, sizeof(data));
1235 if (rc < 0)
1236 return rc;
1239 rc = r820t_write_reg_mask(priv, 0x0c, 0x08, 0x9f);
1240 if (rc < 0)
1241 return rc;
1256 rc = r820t_write_reg_mask(priv, 0x05, lna_index, 0x0f);
1257 if (rc < 0)
1258 return rc;
1261 rc = r820t_write_reg_mask(priv, 0x07, mix_index, 0x0f);
1262 if (rc < 0)
1263 return rc;
1266 rc = r820t_write_reg_mask(priv, 0x05, 0, 0x10);
1267 if (rc < 0)
1268 return rc;
1271 rc = r820t_write_reg_mask(priv, 0x07, 0x10, 0x10);
1272 if (rc < 0)
1273 return rc;
1276 rc = r820t_write_reg_mask(priv, 0x0c, 0x0b, 0x9f);
1277 if (rc < 0)
1278 return rc;
1292 int rc; in generic_set_freq() local
1298 rc = r820t_set_tv_standard(priv, bw, type, std, delsys); in generic_set_freq()
1299 if (rc < 0) in generic_set_freq()
1307 rc = r820t_set_mux(priv, lo_freq); in generic_set_freq()
1308 if (rc < 0) in generic_set_freq()
1311 rc = r820t_set_pll(priv, type, lo_freq); in generic_set_freq()
1312 if (rc < 0 || !priv->has_lock) in generic_set_freq()
1315 rc = r820t_sysfreq_sel(priv, freq, type, std, delsys); in generic_set_freq()
1316 if (rc < 0) in generic_set_freq()
1324 if (rc < 0) in generic_set_freq()
1325 tuner_dbg("%s: failed=%d\n", __func__, rc); in generic_set_freq()
1326 return rc; in generic_set_freq()
1335 int rc; in r820t_standby() local
1341 rc = r820t_write_reg(priv, 0x06, 0xb1); in r820t_standby()
1342 if (rc < 0) in r820t_standby()
1343 return rc; in r820t_standby()
1344 rc = r820t_write_reg(priv, 0x05, 0x03); in r820t_standby()
1345 if (rc < 0) in r820t_standby()
1346 return rc; in r820t_standby()
1347 rc = r820t_write_reg(priv, 0x07, 0x3a); in r820t_standby()
1348 if (rc < 0) in r820t_standby()
1349 return rc; in r820t_standby()
1350 rc = r820t_write_reg(priv, 0x08, 0x40); in r820t_standby()
1351 if (rc < 0) in r820t_standby()
1352 return rc; in r820t_standby()
1353 rc = r820t_write_reg(priv, 0x09, 0xc0); in r820t_standby()
1354 if (rc < 0) in r820t_standby()
1355 return rc; in r820t_standby()
1356 rc = r820t_write_reg(priv, 0x0a, 0x36); in r820t_standby()
1357 if (rc < 0) in r820t_standby()
1358 return rc; in r820t_standby()
1359 rc = r820t_write_reg(priv, 0x0c, 0x35); in r820t_standby()
1360 if (rc < 0) in r820t_standby()
1361 return rc; in r820t_standby()
1362 rc = r820t_write_reg(priv, 0x0f, 0x68); in r820t_standby()
1363 if (rc < 0) in r820t_standby()
1364 return rc; in r820t_standby()
1365 rc = r820t_write_reg(priv, 0x11, 0x03); in r820t_standby()
1366 if (rc < 0) in r820t_standby()
1367 return rc; in r820t_standby()
1368 rc = r820t_write_reg(priv, 0x17, 0xf4); in r820t_standby()
1369 if (rc < 0) in r820t_standby()
1370 return rc; in r820t_standby()
1371 rc = r820t_write_reg(priv, 0x19, 0x0c); in r820t_standby()
1376 return rc; in r820t_standby()
1385 int rc, i; in r820t_xtal_check() local
1392 rc = r820t_write_reg_mask(priv, 0x10, 0x0b, 0x0b); in r820t_xtal_check()
1393 if (rc < 0) in r820t_xtal_check()
1394 return rc; in r820t_xtal_check()
1397 rc = r820t_write_reg_mask(priv, 0x1a, 0x00, 0x0c); in r820t_xtal_check()
1398 if (rc < 0) in r820t_xtal_check()
1399 return rc; in r820t_xtal_check()
1402 rc = r820t_write_reg_mask(priv, 0x13, 0x7f, 0x7f); in r820t_xtal_check()
1403 if (rc < 0) in r820t_xtal_check()
1404 return rc; in r820t_xtal_check()
1407 rc = r820t_write_reg_mask(priv, 0x13, 0x00, 0x40); in r820t_xtal_check()
1408 if (rc < 0) in r820t_xtal_check()
1409 return rc; in r820t_xtal_check()
1413 rc = r820t_write_reg_mask(priv, 0x10, in r820t_xtal_check()
1415 if (rc < 0) in r820t_xtal_check()
1416 return rc; in r820t_xtal_check()
1420 rc = r820t_read(priv, 0x00, data, sizeof(data)); in r820t_xtal_check()
1421 if (rc < 0) in r820t_xtal_check()
1422 return rc; in r820t_xtal_check()
1443 int rc; in r820t_imr_prepare() local
1449 rc = r820t_write_reg_mask(priv, 0x05, 0x20, 0x20); in r820t_imr_prepare()
1450 if (rc < 0) in r820t_imr_prepare()
1451 return rc; in r820t_imr_prepare()
1454 rc = r820t_write_reg_mask(priv, 0x07, 0, 0x10); in r820t_imr_prepare()
1455 if (rc < 0) in r820t_imr_prepare()
1456 return rc; in r820t_imr_prepare()
1459 rc = r820t_write_reg_mask(priv, 0x0a, 0x0f, 0x0f); in r820t_imr_prepare()
1460 if (rc < 0) in r820t_imr_prepare()
1461 return rc; in r820t_imr_prepare()
1464 rc = r820t_write_reg_mask(priv, 0x0b, 0x60, 0x6f); in r820t_imr_prepare()
1465 if (rc < 0) in r820t_imr_prepare()
1466 return rc; in r820t_imr_prepare()
1469 rc = r820t_write_reg_mask(priv, 0x0c, 0x0b, 0x9f); in r820t_imr_prepare()
1470 if (rc < 0) in r820t_imr_prepare()
1471 return rc; in r820t_imr_prepare()
1474 rc = r820t_write_reg_mask(priv, 0x0f, 0, 0x08); in r820t_imr_prepare()
1475 if (rc < 0) in r820t_imr_prepare()
1476 return rc; in r820t_imr_prepare()
1479 rc = r820t_write_reg_mask(priv, 0x18, 0x10, 0x10); in r820t_imr_prepare()
1480 if (rc < 0) in r820t_imr_prepare()
1481 return rc; in r820t_imr_prepare()
1484 rc = r820t_write_reg_mask(priv, 0x1c, 0x02, 0x02); in r820t_imr_prepare()
1485 if (rc < 0) in r820t_imr_prepare()
1486 return rc; in r820t_imr_prepare()
1489 rc = r820t_write_reg_mask(priv, 0x1e, 0x80, 0x80); in r820t_imr_prepare()
1490 if (rc < 0) in r820t_imr_prepare()
1491 return rc; in r820t_imr_prepare()
1494 rc = r820t_write_reg_mask(priv, 0x06, 0x20, 0x20); in r820t_imr_prepare()
1496 return rc; in r820t_imr_prepare()
1501 int rc, i; in r820t_multi_read() local
1508 rc = r820t_read(priv, 0x00, data, sizeof(data)); in r820t_multi_read()
1509 if (rc < 0) in r820t_multi_read()
1510 return rc; in r820t_multi_read()
1520 rc = sum - max - min; in r820t_multi_read()
1522 return rc; in r820t_multi_read()
1531 int i, rc; in r820t_imr_cross() local
1564 rc = r820t_write_reg(priv, 0x08, cross[i].gain_x); in r820t_imr_cross()
1565 if (rc < 0) in r820t_imr_cross()
1566 return rc; in r820t_imr_cross()
1568 rc = r820t_write_reg(priv, 0x09, cross[i].phase_y); in r820t_imr_cross()
1569 if (rc < 0) in r820t_imr_cross()
1570 return rc; in r820t_imr_cross()
1572 rc = r820t_multi_read(priv); in r820t_imr_cross()
1573 if (rc < 0) in r820t_imr_cross()
1574 return rc; in r820t_imr_cross()
1576 cross[i].value = rc; in r820t_imr_cross()
1611 int rc; in r820t_compre_step() local
1632 rc = r820t_write_reg(priv, 0x08, tmp.gain_x); in r820t_compre_step()
1633 if (rc < 0) in r820t_compre_step()
1634 return rc; in r820t_compre_step()
1636 rc = r820t_write_reg(priv, 0x09, tmp.phase_y); in r820t_compre_step()
1637 if (rc < 0) in r820t_compre_step()
1638 return rc; in r820t_compre_step()
1640 rc = r820t_multi_read(priv); in r820t_compre_step()
1641 if (rc < 0) in r820t_compre_step()
1642 return rc; in r820t_compre_step()
1643 tmp.value = rc; in r820t_compre_step()
1662 int rc, i; in r820t_iq_tree() local
1677 rc = r820t_write_reg(priv, fix_reg, fix_val); in r820t_iq_tree()
1678 if (rc < 0) in r820t_iq_tree()
1679 return rc; in r820t_iq_tree()
1681 rc = r820t_write_reg(priv, var_reg, var_val); in r820t_iq_tree()
1682 if (rc < 0) in r820t_iq_tree()
1683 return rc; in r820t_iq_tree()
1685 rc = r820t_multi_read(priv); in r820t_iq_tree()
1686 if (rc < 0) in r820t_iq_tree()
1687 return rc; in r820t_iq_tree()
1688 iq[i].value = rc; in r820t_iq_tree()
1724 int rc; in r820t_section() local
1735 rc = r820t_iq_tree(priv, compare_iq, compare_iq[0].gain_x, in r820t_section()
1737 if (rc < 0) in r820t_section()
1738 return rc; in r820t_section()
1748 rc = r820t_iq_tree(priv, compare_iq, compare_iq[0].gain_x, in r820t_section()
1750 if (rc < 0) in r820t_section()
1751 return rc; in r820t_section()
1764 rc = r820t_iq_tree(priv, compare_iq, compare_iq[0].gain_x, in r820t_section()
1766 if (rc < 0) in r820t_section()
1767 return rc; in r820t_section()
1782 int rc; in r820t_vga_adjust() local
1787 rc = r820t_write_reg_mask(priv, 0x0c, vga_count, 0x0f); in r820t_vga_adjust()
1788 if (rc < 0) in r820t_vga_adjust()
1789 return rc; in r820t_vga_adjust()
1793 rc = r820t_multi_read(priv); in r820t_vga_adjust()
1794 if (rc < 0) in r820t_vga_adjust()
1795 return rc; in r820t_vga_adjust()
1797 if (rc > 40 * 4) in r820t_vga_adjust()
1807 int rc; in r820t_iq() local
1813 rc = r820t_imr_cross(priv, compare_iq, &x_direction); in r820t_iq()
1814 if (rc < 0) in r820t_iq()
1815 return rc; in r820t_iq()
1829 rc = r820t_compre_step(priv, compare_iq, dir_reg); in r820t_iq()
1830 if (rc < 0) in r820t_iq()
1831 return rc; in r820t_iq()
1834 rc = r820t_iq_tree(priv, compare_iq, compare_iq[0].gain_x, in r820t_iq()
1836 if (rc < 0) in r820t_iq()
1837 return rc; in r820t_iq()
1843 rc = r820t_compre_step(priv, compare_iq, other_reg); in r820t_iq()
1844 if (rc < 0) in r820t_iq()
1845 return rc; in r820t_iq()
1848 rc = r820t_iq_tree(priv, compare_iq, compare_iq[0].gain_x, in r820t_iq()
1850 if (rc < 0) in r820t_iq()
1851 return rc; in r820t_iq()
1856 rc = r820t_section(priv, compare_iq); in r820t_iq()
1861 rc = r820t_write_reg_mask(priv, 0x08, 0, 0x3f); in r820t_iq()
1862 if (rc < 0) in r820t_iq()
1863 return rc; in r820t_iq()
1865 rc = r820t_write_reg_mask(priv, 0x09, 0, 0x3f); in r820t_iq()
1867 return rc; in r820t_iq()
1872 int rc; in r820t_f_imr() local
1880 rc = r820t_section(priv, iq_pont); in r820t_f_imr()
1881 if (rc < 0) in r820t_f_imr()
1882 return rc; in r820t_f_imr()
1890 int rc; in r820t_imr() local
1964 rc = r820t_write_reg(priv, 0x18, reg18); in r820t_imr()
1965 if (rc < 0) in r820t_imr()
1966 return rc; in r820t_imr()
1969 rc = r820t_write_reg(priv, 0x19, reg19); in r820t_imr()
1970 if (rc < 0) in r820t_imr()
1971 return rc; in r820t_imr()
1974 rc = r820t_write_reg(priv, 0x1f, reg1f); in r820t_imr()
1975 if (rc < 0) in r820t_imr()
1976 return rc; in r820t_imr()
1979 rc = r820t_set_mux(priv, (ring_freq - 5300) * 1000); in r820t_imr()
1980 if (rc < 0) in r820t_imr()
1981 return rc; in r820t_imr()
1983 rc = r820t_set_pll(priv, V4L2_TUNER_DIGITAL_TV, in r820t_imr()
1986 rc = -EINVAL; in r820t_imr()
1987 if (rc < 0) in r820t_imr()
1988 return rc; in r820t_imr()
1991 rc = r820t_iq(priv, &imr_point); in r820t_imr()
1997 rc = r820t_f_imr(priv, &imr_point); in r820t_imr()
1999 if (rc < 0) in r820t_imr()
2000 return rc; in r820t_imr()
2041 int rc, i; in r820t_imr_callibrate() local
2054 rc = r820t_write(priv, 0x05, in r820t_imr_callibrate()
2056 if (rc < 0) in r820t_imr_callibrate()
2057 return rc; in r820t_imr_callibrate()
2059 rc = r820t_xtal_check(priv); in r820t_imr_callibrate()
2060 if (rc < 0) in r820t_imr_callibrate()
2061 return rc; in r820t_imr_callibrate()
2062 if (!i || rc > xtal_cap) in r820t_imr_callibrate()
2063 xtal_cap = rc; in r820t_imr_callibrate()
2079 rc = r820t_write(priv, 0x05, in r820t_imr_callibrate()
2081 if (rc < 0) in r820t_imr_callibrate()
2082 return rc; in r820t_imr_callibrate()
2084 rc = r820t_imr_prepare(priv); in r820t_imr_callibrate()
2085 if (rc < 0) in r820t_imr_callibrate()
2086 return rc; in r820t_imr_callibrate()
2088 rc = r820t_imr(priv, 3, true); in r820t_imr_callibrate()
2089 if (rc < 0) in r820t_imr_callibrate()
2090 return rc; in r820t_imr_callibrate()
2091 rc = r820t_imr(priv, 1, false); in r820t_imr_callibrate()
2092 if (rc < 0) in r820t_imr_callibrate()
2093 return rc; in r820t_imr_callibrate()
2094 rc = r820t_imr(priv, 0, false); in r820t_imr_callibrate()
2095 if (rc < 0) in r820t_imr_callibrate()
2096 return rc; in r820t_imr_callibrate()
2097 rc = r820t_imr(priv, 2, false); in r820t_imr_callibrate()
2098 if (rc < 0) in r820t_imr_callibrate()
2099 return rc; in r820t_imr_callibrate()
2100 rc = r820t_imr(priv, 4, false); in r820t_imr_callibrate()
2101 if (rc < 0) in r820t_imr_callibrate()
2102 return rc; in r820t_imr_callibrate()
2127 int rc; in r820t_init() local
2135 rc = r820t_imr_callibrate(priv); in r820t_init()
2136 if (rc < 0) in r820t_init()
2140 rc = r820t_write(priv, 0x05, in r820t_init()
2148 if (rc < 0) in r820t_init()
2149 tuner_dbg("%s: failed=%d\n", __func__, rc); in r820t_init()
2150 return rc; in r820t_init()
2156 int rc; in r820t_sleep() local
2164 rc = r820t_standby(priv); in r820t_sleep()
2170 tuner_dbg("%s: failed=%d\n", __func__, rc); in r820t_sleep()
2171 return rc; in r820t_sleep()
2179 int rc; in r820t_set_analog_freq() local
2196 rc = generic_set_freq(fe, 62500l * p->frequency, bw, in r820t_set_analog_freq()
2203 return rc; in r820t_set_analog_freq()
2210 int rc; in r820t_set_params() local
2224 rc = generic_set_freq(fe, c->frequency, bw, in r820t_set_params()
2231 if (rc) in r820t_set_params()
2232 tuner_dbg("%s: failed=%d\n", __func__, rc); in r820t_set_params()
2233 return rc; in r820t_set_params()
2239 int rc = 0; in r820t_signal() local
2246 rc = r820t_read_gain(priv); in r820t_signal()
2247 if (rc < 0) in r820t_signal()
2251 *strength = (45 - rc) << 4 | 0xff; in r820t_signal()
2266 rc, *strength); in r820t_signal()
2318 int rc = -ENODEV; in r820t_attach() local
2350 rc = r820t_read(priv, 0x00, data, sizeof(data)); in r820t_attach()
2351 if (rc < 0) in r820t_attach()
2354 rc = r820t_sleep(fe); in r820t_attach()
2355 if (rc < 0) in r820t_attach()
2376 pr_info("%s: failed=%d\n", __func__, rc); in r820t_attach()