Lines Matching refs:tnr_dmd

204 static int p_init1(struct cxd2880_tnrdmd *tnr_dmd)  in p_init1()  argument
209 if (!tnr_dmd) in p_init1()
212 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init1()
218 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SINGLE || in p_init1()
219 tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in p_init1()
220 switch (tnr_dmd->create_param.ts_output_if) { in p_init1()
233 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init1()
240 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in p_init1()
247 switch (tnr_dmd->chip_id) { in p_init1()
258 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init1()
264 if (tnr_dmd->create_param.en_internal_ldo) in p_init1()
269 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init1()
274 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init1()
280 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init1()
285 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init1()
291 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init1()
297 switch (tnr_dmd->chip_id) { in p_init1()
308 return tnr_dmd->io->write_reg(tnr_dmd->io, in p_init1()
313 static int p_init2(struct cxd2880_tnrdmd *tnr_dmd) in p_init2() argument
318 if (!tnr_dmd) in p_init2()
321 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init2()
326 data[0] = tnr_dmd->create_param.xosc_cap; in p_init2()
327 data[1] = tnr_dmd->create_param.xosc_i; in p_init2()
328 switch (tnr_dmd->create_param.xtal_share_type) { in p_init2()
351 return tnr_dmd->io->write_regs(tnr_dmd->io, in p_init2()
356 static int p_init3(struct cxd2880_tnrdmd *tnr_dmd) in p_init3() argument
361 if (!tnr_dmd) in p_init3()
364 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in p_init3()
370 switch (tnr_dmd->diver_mode) { in p_init3()
386 return tnr_dmd->io->write_regs(tnr_dmd->io, in p_init3()
391 static int rf_init1(struct cxd2880_tnrdmd *tnr_dmd) in rf_init1() argument
437 if (!tnr_dmd) in rf_init1()
440 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
448 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
454 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
461 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
467 if (tnr_dmd->create_param.stationary_use) { in rf_init1()
468 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
475 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init1()
483 if (tnr_dmd->create_param.is_cxd2881gg && in rf_init1()
484 tnr_dmd->create_param.xtal_share_type == in rf_init1()
490 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
496 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init1()
503 if (tnr_dmd->chip_id == CXD2880_TNRDMD_CHIP_ID_CXD2880_ES1_0X) { in rf_init1()
516 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
522 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
530 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
537 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
546 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
551 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
556 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
562 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
569 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
574 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
580 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
586 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
594 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
600 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init1()
607 if (tnr_dmd->create_param.stationary_use) { in rf_init1()
620 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
626 if (tnr_dmd->lna_thrs_tbl_air) { in rf_init1()
631 tnr_dmd->lna_thrs_tbl_air->thrs[idx].off_on; in rf_init1()
633 tnr_dmd->lna_thrs_tbl_air->thrs[idx].on_off; in rf_init1()
635 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
644 if (tnr_dmd->create_param.stationary_use) in rf_init1()
652 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
658 if (tnr_dmd->lna_thrs_tbl_cable) { in rf_init1()
663 tnr_dmd->lna_thrs_tbl_cable->thrs[idx].off_on; in rf_init1()
665 tnr_dmd->lna_thrs_tbl_cable->thrs[idx].on_off; in rf_init1()
667 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
674 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
681 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
688 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
694 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
700 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
708 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
714 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init1()
721 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
729 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
734 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in rf_init1()
742 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init1()
751 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
756 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in rf_init1()
764 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init1()
774 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
781 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
788 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init1()
794 if (tnr_dmd->create_param.stationary_use) { in rf_init1()
795 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
802 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init1()
809 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init1()
818 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init1()
823 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in rf_init1()
831 return cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init1()
837 static int rf_init2(struct cxd2880_tnrdmd *tnr_dmd) in rf_init2() argument
842 if (!tnr_dmd) in rf_init2()
845 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in rf_init2()
852 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init2()
861 if (tnr_dmd->chip_id == CXD2880_TNRDMD_CHIP_ID_CXD2880_ES1_0X) in rf_init2()
867 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in rf_init2()
873 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init2()
880 return cxd2880_io_write_multi_regs(tnr_dmd->io, in rf_init2()
886 static int x_tune1(struct cxd2880_tnrdmd *tnr_dmd, in x_tune1() argument
894 if (!tnr_dmd) in x_tune1()
897 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_tune1()
904 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune1()
912 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune1()
923 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune1()
949 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune1()
955 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_tune1()
964 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune1()
970 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune1()
1009 return tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune1()
1014 static int x_tune2(struct cxd2880_tnrdmd *tnr_dmd, in x_tune2() argument
1022 if (!tnr_dmd) in x_tune2()
1025 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune2()
1034 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune2()
1040 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_tune2()
1047 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in x_tune2()
1053 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune2()
1059 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune2()
1065 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_tune2()
1072 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_tune2()
1082 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune2()
1088 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in x_tune2()
1124 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune2()
1130 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in x_tune2()
1199 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune2()
1206 if (tnr_dmd->create_param.stationary_use) { in x_tune2()
1207 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_tune2()
1215 return cxd2880_io_write_multi_regs(tnr_dmd->io, in x_tune2()
1221 static int x_tune3(struct cxd2880_tnrdmd *tnr_dmd, in x_tune3() argument
1228 if (!tnr_dmd) in x_tune3()
1231 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_tune3()
1238 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune3()
1249 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune3()
1255 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune3()
1265 return tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune3()
1270 static int x_tune4(struct cxd2880_tnrdmd *tnr_dmd) in x_tune4() argument
1275 if (!tnr_dmd) in x_tune4()
1278 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in x_tune4()
1281 ret = tnr_dmd->diver_sub->io->write_reg(tnr_dmd->diver_sub->io, in x_tune4()
1288 ret = tnr_dmd->diver_sub->io->write_regs(tnr_dmd->diver_sub->io, in x_tune4()
1294 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune4()
1301 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune4()
1306 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_tune4()
1313 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_tune4()
1319 ret = tnr_dmd->diver_sub->io->write_reg(tnr_dmd->diver_sub->io, in x_tune4()
1326 ret = tnr_dmd->diver_sub->io->write_regs(tnr_dmd->diver_sub->io, in x_tune4()
1331 ret = tnr_dmd->diver_sub->io->write_reg(tnr_dmd->diver_sub->io, in x_tune4()
1337 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_tune4()
1344 return cxd2880_io_write_multi_regs(tnr_dmd->diver_sub->io, in x_tune4()
1350 static int x_sleep1(struct cxd2880_tnrdmd *tnr_dmd) in x_sleep1() argument
1355 if (!tnr_dmd) in x_sleep1()
1358 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in x_sleep1()
1361 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_sleep1()
1370 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in x_sleep1()
1376 ret = tnr_dmd->diver_sub->io->write_reg(tnr_dmd->diver_sub->io, in x_sleep1()
1384 ret = tnr_dmd->diver_sub->io->write_regs(tnr_dmd->diver_sub->io, in x_sleep1()
1391 ret = tnr_dmd->diver_sub->io->write_regs(tnr_dmd->diver_sub->io, in x_sleep1()
1397 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in x_sleep1()
1405 return tnr_dmd->io->write_regs(tnr_dmd->io, in x_sleep1()
1410 static int x_sleep2(struct cxd2880_tnrdmd *tnr_dmd) in x_sleep2() argument
1415 if (!tnr_dmd) in x_sleep2()
1418 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in x_sleep2()
1427 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in x_sleep2()
1436 return cxd2880_io_write_multi_regs(tnr_dmd->io, in x_sleep2()
1442 static int x_sleep3(struct cxd2880_tnrdmd *tnr_dmd) in x_sleep3() argument
1444 if (!tnr_dmd) in x_sleep3()
1447 return cxd2880_io_write_multi_regs(tnr_dmd->io, in x_sleep3()
1453 static int x_sleep4(struct cxd2880_tnrdmd *tnr_dmd) in x_sleep4() argument
1455 if (!tnr_dmd) in x_sleep4()
1458 return cxd2880_io_write_multi_regs(tnr_dmd->io, in x_sleep4()
1464 static int spll_reset(struct cxd2880_tnrdmd *tnr_dmd, in spll_reset() argument
1470 if (!tnr_dmd) in spll_reset()
1473 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in spll_reset()
1480 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in spll_reset()
1487 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in spll_reset()
1510 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in spll_reset()
1515 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in spll_reset()
1523 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in spll_reset()
1528 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in spll_reset()
1536 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in spll_reset()
1545 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in spll_reset()
1552 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in spll_reset()
1560 return tnr_dmd->io->write_regs(tnr_dmd->io, in spll_reset()
1565 static int t_power_x(struct cxd2880_tnrdmd *tnr_dmd, u8 on) in t_power_x() argument
1570 if (!tnr_dmd) in t_power_x()
1573 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in t_power_x()
1580 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in t_power_x()
1587 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in t_power_x()
1595 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in t_power_x()
1603 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in t_power_x()
1608 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in t_power_x()
1616 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in t_power_x()
1625 ret = tnr_dmd->io->write_regs(tnr_dmd->io, in t_power_x()
1633 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in t_power_x()
1638 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in t_power_x()
1647 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in t_power_x()
1656 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in t_power_x()
1661 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in t_power_x()
1669 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in t_power_x()
1678 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in t_power_x()
1685 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in t_power_x()
1693 return tnr_dmd->io->write_regs(tnr_dmd->io, in t_power_x()
1704 static int set_ts_clk_mode_and_freq(struct cxd2880_tnrdmd *tnr_dmd, in set_ts_clk_mode_and_freq() argument
1725 if (!tnr_dmd) in set_ts_clk_mode_and_freq()
1728 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in set_ts_clk_mode_and_freq()
1734 if (tnr_dmd->is_ts_backwards_compatible_mode) { in set_ts_clk_mode_and_freq()
1744 if (tnr_dmd->ts_byte_clk_manual_setting) { in set_ts_clk_mode_and_freq()
1749 ret = cxd2880_io_set_reg_bits(tnr_dmd->io, in set_ts_clk_mode_and_freq()
1755 ret = cxd2880_io_set_reg_bits(tnr_dmd->io, in set_ts_clk_mode_and_freq()
1761 ret = cxd2880_io_set_reg_bits(tnr_dmd->io, in set_ts_clk_mode_and_freq()
1767 ts_clk_cfg = srl_ts_clk_stgs[tnr_dmd->srl_ts_clk_mod_cnts] in set_ts_clk_mode_and_freq()
1768 [tnr_dmd->srl_ts_clk_frq]; in set_ts_clk_mode_and_freq()
1770 if (tnr_dmd->ts_byte_clk_manual_setting) in set_ts_clk_mode_and_freq()
1771 ts_clk_cfg.ts_clk_period = tnr_dmd->ts_byte_clk_manual_setting; in set_ts_clk_mode_and_freq()
1773 ret = cxd2880_io_set_reg_bits(tnr_dmd->io, in set_ts_clk_mode_and_freq()
1779 ret = cxd2880_io_set_reg_bits(tnr_dmd->io, in set_ts_clk_mode_and_freq()
1785 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in set_ts_clk_mode_and_freq()
1794 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in set_ts_clk_mode_and_freq()
1801 cxd2880_io_set_reg_bits(tnr_dmd->io, in set_ts_clk_mode_and_freq()
1809 static int pid_ftr_setting(struct cxd2880_tnrdmd *tnr_dmd, in pid_ftr_setting() argument
1817 if (!tnr_dmd) in pid_ftr_setting()
1820 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in pid_ftr_setting()
1827 return tnr_dmd->io->write_reg(tnr_dmd->io, in pid_ftr_setting()
1843 return tnr_dmd->io->write_regs(tnr_dmd->io, in pid_ftr_setting()
1848 static int load_cfg_mem(struct cxd2880_tnrdmd *tnr_dmd) in load_cfg_mem() argument
1853 if (!tnr_dmd) in load_cfg_mem()
1856 for (i = 0; i < tnr_dmd->cfg_mem_last_entry; i++) { in load_cfg_mem()
1857 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in load_cfg_mem()
1858 tnr_dmd->cfg_mem[i].tgt, in load_cfg_mem()
1859 0x00, tnr_dmd->cfg_mem[i].bank); in load_cfg_mem()
1863 ret = cxd2880_io_set_reg_bits(tnr_dmd->io, in load_cfg_mem()
1864 tnr_dmd->cfg_mem[i].tgt, in load_cfg_mem()
1865 tnr_dmd->cfg_mem[i].address, in load_cfg_mem()
1866 tnr_dmd->cfg_mem[i].value, in load_cfg_mem()
1867 tnr_dmd->cfg_mem[i].bit_mask); in load_cfg_mem()
1875 static int set_cfg_mem(struct cxd2880_tnrdmd *tnr_dmd, in set_cfg_mem() argument
1882 if (!tnr_dmd) in set_cfg_mem()
1885 for (i = 0; i < tnr_dmd->cfg_mem_last_entry; i++) { in set_cfg_mem()
1887 tnr_dmd->cfg_mem[i].tgt == tgt && in set_cfg_mem()
1888 tnr_dmd->cfg_mem[i].bank == bank && in set_cfg_mem()
1889 tnr_dmd->cfg_mem[i].address == address) { in set_cfg_mem()
1890 tnr_dmd->cfg_mem[i].value &= ~bit_mask; in set_cfg_mem()
1891 tnr_dmd->cfg_mem[i].value |= (value & bit_mask); in set_cfg_mem()
1893 tnr_dmd->cfg_mem[i].bit_mask |= bit_mask; in set_cfg_mem()
1902 if (tnr_dmd->cfg_mem_last_entry < CXD2880_TNRDMD_MAX_CFG_MEM_COUNT) { in set_cfg_mem()
1903 tnr_dmd->cfg_mem[tnr_dmd->cfg_mem_last_entry].tgt = tgt; in set_cfg_mem()
1904 tnr_dmd->cfg_mem[tnr_dmd->cfg_mem_last_entry].bank = bank; in set_cfg_mem()
1905 tnr_dmd->cfg_mem[tnr_dmd->cfg_mem_last_entry].address = address; in set_cfg_mem()
1906 tnr_dmd->cfg_mem[tnr_dmd->cfg_mem_last_entry].value = (value & bit_mask); in set_cfg_mem()
1907 tnr_dmd->cfg_mem[tnr_dmd->cfg_mem_last_entry].bit_mask = bit_mask; in set_cfg_mem()
1908 tnr_dmd->cfg_mem_last_entry++; in set_cfg_mem()
1916 int cxd2880_tnrdmd_create(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_create() argument
1921 if (!tnr_dmd || !io || !create_param) in cxd2880_tnrdmd_create()
1924 memset(tnr_dmd, 0, sizeof(struct cxd2880_tnrdmd)); in cxd2880_tnrdmd_create()
1926 tnr_dmd->io = io; in cxd2880_tnrdmd_create()
1927 tnr_dmd->create_param = *create_param; in cxd2880_tnrdmd_create()
1929 tnr_dmd->diver_mode = CXD2880_TNRDMD_DIVERMODE_SINGLE; in cxd2880_tnrdmd_create()
1930 tnr_dmd->diver_sub = NULL; in cxd2880_tnrdmd_create()
1932 tnr_dmd->srl_ts_clk_mod_cnts = 1; in cxd2880_tnrdmd_create()
1933 tnr_dmd->en_fef_intmtnt_base = 1; in cxd2880_tnrdmd_create()
1934 tnr_dmd->en_fef_intmtnt_lite = 1; in cxd2880_tnrdmd_create()
1935 tnr_dmd->rf_lvl_cmpstn = NULL; in cxd2880_tnrdmd_create()
1936 tnr_dmd->lna_thrs_tbl_air = NULL; in cxd2880_tnrdmd_create()
1937 tnr_dmd->lna_thrs_tbl_cable = NULL; in cxd2880_tnrdmd_create()
1938 atomic_set(&tnr_dmd->cancel, 0); in cxd2880_tnrdmd_create()
2006 int cxd2880_tnrdmd_init1(struct cxd2880_tnrdmd *tnr_dmd) in cxd2880_tnrdmd_init1() argument
2010 if (!tnr_dmd || tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_init1()
2013 tnr_dmd->chip_id = CXD2880_TNRDMD_CHIP_ID_UNKNOWN; in cxd2880_tnrdmd_init1()
2014 tnr_dmd->state = CXD2880_TNRDMD_STATE_UNKNOWN; in cxd2880_tnrdmd_init1()
2015 tnr_dmd->clk_mode = CXD2880_TNRDMD_CLOCKMODE_UNKNOWN; in cxd2880_tnrdmd_init1()
2016 tnr_dmd->frequency_khz = 0; in cxd2880_tnrdmd_init1()
2017 tnr_dmd->sys = CXD2880_DTV_SYS_UNKNOWN; in cxd2880_tnrdmd_init1()
2018 tnr_dmd->bandwidth = CXD2880_DTV_BW_UNKNOWN; in cxd2880_tnrdmd_init1()
2019 tnr_dmd->scan_mode = 0; in cxd2880_tnrdmd_init1()
2020 atomic_set(&tnr_dmd->cancel, 0); in cxd2880_tnrdmd_init1()
2022 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_init1()
2023 tnr_dmd->diver_sub->chip_id = CXD2880_TNRDMD_CHIP_ID_UNKNOWN; in cxd2880_tnrdmd_init1()
2024 tnr_dmd->diver_sub->state = CXD2880_TNRDMD_STATE_UNKNOWN; in cxd2880_tnrdmd_init1()
2025 tnr_dmd->diver_sub->clk_mode = CXD2880_TNRDMD_CLOCKMODE_UNKNOWN; in cxd2880_tnrdmd_init1()
2026 tnr_dmd->diver_sub->frequency_khz = 0; in cxd2880_tnrdmd_init1()
2027 tnr_dmd->diver_sub->sys = CXD2880_DTV_SYS_UNKNOWN; in cxd2880_tnrdmd_init1()
2028 tnr_dmd->diver_sub->bandwidth = CXD2880_DTV_BW_UNKNOWN; in cxd2880_tnrdmd_init1()
2029 tnr_dmd->diver_sub->scan_mode = 0; in cxd2880_tnrdmd_init1()
2030 atomic_set(&tnr_dmd->diver_sub->cancel, 0); in cxd2880_tnrdmd_init1()
2033 ret = cxd2880_tnrdmd_chip_id(tnr_dmd, &tnr_dmd->chip_id); in cxd2880_tnrdmd_init1()
2037 if (!CXD2880_TNRDMD_CHIP_ID_VALID(tnr_dmd->chip_id)) in cxd2880_tnrdmd_init1()
2040 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_init1()
2042 cxd2880_tnrdmd_chip_id(tnr_dmd->diver_sub, in cxd2880_tnrdmd_init1()
2043 &tnr_dmd->diver_sub->chip_id); in cxd2880_tnrdmd_init1()
2047 if (!CXD2880_TNRDMD_CHIP_ID_VALID(tnr_dmd->diver_sub->chip_id)) in cxd2880_tnrdmd_init1()
2051 ret = p_init1(tnr_dmd); in cxd2880_tnrdmd_init1()
2055 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_init1()
2056 ret = p_init1(tnr_dmd->diver_sub); in cxd2880_tnrdmd_init1()
2063 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_init1()
2064 ret = p_init2(tnr_dmd->diver_sub); in cxd2880_tnrdmd_init1()
2069 ret = p_init2(tnr_dmd); in cxd2880_tnrdmd_init1()
2075 ret = p_init3(tnr_dmd); in cxd2880_tnrdmd_init1()
2079 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_init1()
2080 ret = p_init3(tnr_dmd->diver_sub); in cxd2880_tnrdmd_init1()
2085 ret = rf_init1(tnr_dmd); in cxd2880_tnrdmd_init1()
2089 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_init1()
2090 ret = rf_init1(tnr_dmd->diver_sub); in cxd2880_tnrdmd_init1()
2095 int cxd2880_tnrdmd_init2(struct cxd2880_tnrdmd *tnr_dmd) in cxd2880_tnrdmd_init2() argument
2100 if (!tnr_dmd) in cxd2880_tnrdmd_init2()
2103 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_init2()
2106 ret = cxd2880_tnrdmd_check_internal_cpu_status(tnr_dmd, in cxd2880_tnrdmd_init2()
2114 ret = rf_init2(tnr_dmd); in cxd2880_tnrdmd_init2()
2118 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_init2()
2119 ret = rf_init2(tnr_dmd->diver_sub); in cxd2880_tnrdmd_init2()
2124 ret = load_cfg_mem(tnr_dmd); in cxd2880_tnrdmd_init2()
2128 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_init2()
2129 ret = load_cfg_mem(tnr_dmd->diver_sub); in cxd2880_tnrdmd_init2()
2134 tnr_dmd->state = CXD2880_TNRDMD_STATE_SLEEP; in cxd2880_tnrdmd_init2()
2136 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_init2()
2137 tnr_dmd->diver_sub->state = CXD2880_TNRDMD_STATE_SLEEP; in cxd2880_tnrdmd_init2()
2143 *tnr_dmd, in cxd2880_tnrdmd_check_internal_cpu_status()
2149 if (!tnr_dmd || !task_completed) in cxd2880_tnrdmd_check_internal_cpu_status()
2152 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_check_internal_cpu_status()
2155 ret = cxd2880_tnrdmd_mon_internal_cpu_status(tnr_dmd, &cpu_status); in cxd2880_tnrdmd_check_internal_cpu_status()
2159 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SINGLE) { in cxd2880_tnrdmd_check_internal_cpu_status()
2172 ret = cxd2880_tnrdmd_mon_internal_cpu_status_sub(tnr_dmd, &cpu_status); in cxd2880_tnrdmd_check_internal_cpu_status()
2184 int cxd2880_tnrdmd_common_tune_setting1(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_common_tune_setting1() argument
2198 if (!tnr_dmd) in cxd2880_tnrdmd_common_tune_setting1()
2201 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_common_tune_setting1()
2204 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_common_tune_setting1()
2205 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_common_tune_setting1()
2211 ret = cxd2880_tnrdmd_sleep(tnr_dmd); in cxd2880_tnrdmd_common_tune_setting1()
2215 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_common_tune_setting1()
2222 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_common_tune_setting1()
2233 ret = t_power_x(tnr_dmd, 1); in cxd2880_tnrdmd_common_tune_setting1()
2237 if (tnr_dmd->diver_mode == in cxd2880_tnrdmd_common_tune_setting1()
2239 ret = t_power_x(tnr_dmd->diver_sub, 1); in cxd2880_tnrdmd_common_tune_setting1()
2248 ret = t_power_x(tnr_dmd, 0); in cxd2880_tnrdmd_common_tune_setting1()
2252 if (tnr_dmd->diver_mode == in cxd2880_tnrdmd_common_tune_setting1()
2254 ret = t_power_x(tnr_dmd->diver_sub, 0); in cxd2880_tnrdmd_common_tune_setting1()
2265 ret = spll_reset(tnr_dmd, new_clk_mode); in cxd2880_tnrdmd_common_tune_setting1()
2269 tnr_dmd->clk_mode = new_clk_mode; in cxd2880_tnrdmd_common_tune_setting1()
2271 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_common_tune_setting1()
2272 ret = spll_reset(tnr_dmd->diver_sub, new_clk_mode); in cxd2880_tnrdmd_common_tune_setting1()
2276 tnr_dmd->diver_sub->clk_mode = new_clk_mode; in cxd2880_tnrdmd_common_tune_setting1()
2279 ret = load_cfg_mem(tnr_dmd); in cxd2880_tnrdmd_common_tune_setting1()
2283 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_common_tune_setting1()
2284 ret = load_cfg_mem(tnr_dmd->diver_sub); in cxd2880_tnrdmd_common_tune_setting1()
2290 if (tnr_dmd->diver_mode == in cxd2880_tnrdmd_common_tune_setting1()
2299 if (tnr_dmd->create_param.xtal_share_type == in cxd2880_tnrdmd_common_tune_setting1()
2304 if (tnr_dmd->diver_mode == in cxd2880_tnrdmd_common_tune_setting1()
2308 switch (tnr_dmd->create_param.xtal_share_type) { in cxd2880_tnrdmd_common_tune_setting1()
2325 x_tune1(tnr_dmd, sys, frequency_khz, bandwidth, in cxd2880_tnrdmd_common_tune_setting1()
2326 tnr_dmd->is_cable_input, shift_frequency_khz); in cxd2880_tnrdmd_common_tune_setting1()
2330 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_common_tune_setting1()
2332 x_tune1(tnr_dmd->diver_sub, sys, frequency_khz, in cxd2880_tnrdmd_common_tune_setting1()
2333 bandwidth, tnr_dmd->is_cable_input, in cxd2880_tnrdmd_common_tune_setting1()
2342 cxd2880_tnrdmd_check_internal_cpu_status(tnr_dmd, in cxd2880_tnrdmd_common_tune_setting1()
2351 x_tune2(tnr_dmd, bandwidth, tnr_dmd->clk_mode, in cxd2880_tnrdmd_common_tune_setting1()
2356 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_common_tune_setting1()
2358 x_tune2(tnr_dmd->diver_sub, bandwidth, in cxd2880_tnrdmd_common_tune_setting1()
2359 tnr_dmd->diver_sub->clk_mode, in cxd2880_tnrdmd_common_tune_setting1()
2365 if (tnr_dmd->create_param.ts_output_if == CXD2880_TNRDMD_TSOUT_IF_TS) { in cxd2880_tnrdmd_common_tune_setting1()
2366 ret = set_ts_clk_mode_and_freq(tnr_dmd, sys); in cxd2880_tnrdmd_common_tune_setting1()
2370 if (tnr_dmd->pid_ftr_cfg_en) in cxd2880_tnrdmd_common_tune_setting1()
2371 pid_ftr_cfg = &tnr_dmd->pid_ftr_cfg; in cxd2880_tnrdmd_common_tune_setting1()
2375 ret = pid_ftr_setting(tnr_dmd, pid_ftr_cfg); in cxd2880_tnrdmd_common_tune_setting1()
2382 *tnr_dmd, in cxd2880_tnrdmd_common_tune_setting2()
2388 if (!tnr_dmd) in cxd2880_tnrdmd_common_tune_setting2()
2391 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_common_tune_setting2()
2394 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_common_tune_setting2()
2395 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_common_tune_setting2()
2398 ret = x_tune3(tnr_dmd, sys, en_fef_intmtnt_ctrl); in cxd2880_tnrdmd_common_tune_setting2()
2402 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_common_tune_setting2()
2403 ret = x_tune3(tnr_dmd->diver_sub, sys, en_fef_intmtnt_ctrl); in cxd2880_tnrdmd_common_tune_setting2()
2406 ret = x_tune4(tnr_dmd); in cxd2880_tnrdmd_common_tune_setting2()
2411 return cxd2880_tnrdmd_set_ts_output(tnr_dmd, 1); in cxd2880_tnrdmd_common_tune_setting2()
2414 int cxd2880_tnrdmd_sleep(struct cxd2880_tnrdmd *tnr_dmd) in cxd2880_tnrdmd_sleep() argument
2418 if (!tnr_dmd) in cxd2880_tnrdmd_sleep()
2421 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_sleep()
2424 if (tnr_dmd->state == CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_sleep()
2427 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_sleep()
2430 ret = cxd2880_tnrdmd_set_ts_output(tnr_dmd, 0); in cxd2880_tnrdmd_sleep()
2434 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_sleep()
2435 ret = x_sleep1(tnr_dmd); in cxd2880_tnrdmd_sleep()
2440 ret = x_sleep2(tnr_dmd); in cxd2880_tnrdmd_sleep()
2444 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_sleep()
2445 ret = x_sleep2(tnr_dmd->diver_sub); in cxd2880_tnrdmd_sleep()
2450 switch (tnr_dmd->sys) { in cxd2880_tnrdmd_sleep()
2452 ret = cxd2880_tnrdmd_dvbt_sleep_setting(tnr_dmd); in cxd2880_tnrdmd_sleep()
2458 ret = cxd2880_tnrdmd_dvbt2_sleep_setting(tnr_dmd); in cxd2880_tnrdmd_sleep()
2467 ret = x_sleep3(tnr_dmd); in cxd2880_tnrdmd_sleep()
2471 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_sleep()
2472 ret = x_sleep3(tnr_dmd->diver_sub); in cxd2880_tnrdmd_sleep()
2477 ret = x_sleep4(tnr_dmd); in cxd2880_tnrdmd_sleep()
2481 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_sleep()
2482 ret = x_sleep4(tnr_dmd->diver_sub); in cxd2880_tnrdmd_sleep()
2487 tnr_dmd->state = CXD2880_TNRDMD_STATE_SLEEP; in cxd2880_tnrdmd_sleep()
2488 tnr_dmd->frequency_khz = 0; in cxd2880_tnrdmd_sleep()
2489 tnr_dmd->sys = CXD2880_DTV_SYS_UNKNOWN; in cxd2880_tnrdmd_sleep()
2490 tnr_dmd->bandwidth = CXD2880_DTV_BW_UNKNOWN; in cxd2880_tnrdmd_sleep()
2492 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) { in cxd2880_tnrdmd_sleep()
2493 tnr_dmd->diver_sub->state = CXD2880_TNRDMD_STATE_SLEEP; in cxd2880_tnrdmd_sleep()
2494 tnr_dmd->diver_sub->frequency_khz = 0; in cxd2880_tnrdmd_sleep()
2495 tnr_dmd->diver_sub->sys = CXD2880_DTV_SYS_UNKNOWN; in cxd2880_tnrdmd_sleep()
2496 tnr_dmd->diver_sub->bandwidth = CXD2880_DTV_BW_UNKNOWN; in cxd2880_tnrdmd_sleep()
2502 int cxd2880_tnrdmd_set_cfg(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_set_cfg() argument
2510 if (!tnr_dmd) in cxd2880_tnrdmd_set_cfg()
2513 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_set_cfg()
2514 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_set_cfg()
2519 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2523 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2533 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2537 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2547 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2551 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2561 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2565 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2575 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2579 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2589 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2592 tnr_dmd->srl_ts_clk_mod_cnts = value ? 0x01 : 0x00; in cxd2880_tnrdmd_set_cfg()
2596 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2603 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2612 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2619 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2628 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2635 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2644 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2648 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2658 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2662 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2671 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2675 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2685 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2689 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2698 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2704 tnr_dmd->srl_ts_clk_frq = in cxd2880_tnrdmd_set_cfg()
2709 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2715 tnr_dmd->ts_byte_clk_manual_setting = value; in cxd2880_tnrdmd_set_cfg()
2720 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2727 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2737 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_cfg()
2740 tnr_dmd->is_ts_backwards_compatible_mode = value ? 1 : 0; in cxd2880_tnrdmd_set_cfg()
2749 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2761 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2769 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2782 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2789 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2800 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2811 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2823 tnr_dmd->fixed_clk_mode = (enum cxd2880_tnrdmd_clockmode)value; in cxd2880_tnrdmd_set_cfg()
2827 tnr_dmd->is_cable_input = value ? 1 : 0; in cxd2880_tnrdmd_set_cfg()
2831 tnr_dmd->en_fef_intmtnt_base = value ? 1 : 0; in cxd2880_tnrdmd_set_cfg()
2835 tnr_dmd->en_fef_intmtnt_lite = value ? 1 : 0; in cxd2880_tnrdmd_set_cfg()
2842 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2849 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2861 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2868 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2880 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2887 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2896 tnr_dmd->blind_tune_dvbt2_first = value ? 1 : 0; in cxd2880_tnrdmd_set_cfg()
2904 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2917 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2930 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2943 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2956 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2969 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_set_cfg()
2982 tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_set_cfg()
2983 ret = cxd2880_tnrdmd_set_cfg(tnr_dmd->diver_sub, id, value); in cxd2880_tnrdmd_set_cfg()
2988 int cxd2880_tnrdmd_gpio_set_cfg(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_gpio_set_cfg() argument
2996 if (!tnr_dmd) in cxd2880_tnrdmd_gpio_set_cfg()
3005 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_gpio_set_cfg()
3006 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_gpio_set_cfg()
3010 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, CXD2880_IO_TGT_SYS, in cxd2880_tnrdmd_gpio_set_cfg()
3017 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, CXD2880_IO_TGT_SYS, in cxd2880_tnrdmd_gpio_set_cfg()
3025 cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, CXD2880_IO_TGT_SYS, in cxd2880_tnrdmd_gpio_set_cfg()
3032 return cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_gpio_set_cfg()
3039 int cxd2880_tnrdmd_gpio_set_cfg_sub(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_gpio_set_cfg_sub() argument
3045 if (!tnr_dmd) in cxd2880_tnrdmd_gpio_set_cfg_sub()
3048 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_gpio_set_cfg_sub()
3051 return cxd2880_tnrdmd_gpio_set_cfg(tnr_dmd->diver_sub, id, en, mode, in cxd2880_tnrdmd_gpio_set_cfg_sub()
3055 int cxd2880_tnrdmd_gpio_read(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_gpio_read() argument
3061 if (!tnr_dmd || !value) in cxd2880_tnrdmd_gpio_read()
3067 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_gpio_read()
3068 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_gpio_read()
3071 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_gpio_read()
3076 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_gpio_read()
3087 int cxd2880_tnrdmd_gpio_read_sub(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_gpio_read_sub() argument
3090 if (!tnr_dmd) in cxd2880_tnrdmd_gpio_read_sub()
3093 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_gpio_read_sub()
3096 return cxd2880_tnrdmd_gpio_read(tnr_dmd->diver_sub, id, value); in cxd2880_tnrdmd_gpio_read_sub()
3099 int cxd2880_tnrdmd_gpio_write(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_gpio_write() argument
3102 if (!tnr_dmd) in cxd2880_tnrdmd_gpio_write()
3108 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_gpio_write()
3109 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_gpio_write()
3112 return cxd2880_tnrdmd_set_and_save_reg_bits(tnr_dmd, in cxd2880_tnrdmd_gpio_write()
3119 int cxd2880_tnrdmd_gpio_write_sub(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_gpio_write_sub() argument
3122 if (!tnr_dmd) in cxd2880_tnrdmd_gpio_write_sub()
3125 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_gpio_write_sub()
3128 return cxd2880_tnrdmd_gpio_write(tnr_dmd->diver_sub, id, value); in cxd2880_tnrdmd_gpio_write_sub()
3131 int cxd2880_tnrdmd_interrupt_read(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_interrupt_read() argument
3137 if (!tnr_dmd || !value) in cxd2880_tnrdmd_interrupt_read()
3140 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_interrupt_read()
3141 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_interrupt_read()
3144 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_interrupt_read()
3149 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_interrupt_read()
3160 int cxd2880_tnrdmd_interrupt_clear(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_interrupt_clear() argument
3166 if (!tnr_dmd) in cxd2880_tnrdmd_interrupt_clear()
3169 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_interrupt_clear()
3170 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_interrupt_clear()
3173 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_interrupt_clear()
3182 return tnr_dmd->io->write_regs(tnr_dmd->io, in cxd2880_tnrdmd_interrupt_clear()
3187 int cxd2880_tnrdmd_ts_buf_clear(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_ts_buf_clear() argument
3195 if (!tnr_dmd) in cxd2880_tnrdmd_ts_buf_clear()
3198 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_ts_buf_clear()
3201 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_ts_buf_clear()
3202 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_ts_buf_clear()
3205 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_ts_buf_clear()
3215 return tnr_dmd->io->write_regs(tnr_dmd->io, in cxd2880_tnrdmd_ts_buf_clear()
3220 int cxd2880_tnrdmd_chip_id(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_chip_id() argument
3226 if (!tnr_dmd || !chip_id) in cxd2880_tnrdmd_chip_id()
3229 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_chip_id()
3234 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in cxd2880_tnrdmd_chip_id()
3246 *tnr_dmd, in cxd2880_tnrdmd_set_and_save_reg_bits()
3253 if (!tnr_dmd) in cxd2880_tnrdmd_set_and_save_reg_bits()
3256 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_set_and_save_reg_bits()
3257 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_set_and_save_reg_bits()
3260 ret = tnr_dmd->io->write_reg(tnr_dmd->io, tgt, 0x00, bank); in cxd2880_tnrdmd_set_and_save_reg_bits()
3264 ret = cxd2880_io_set_reg_bits(tnr_dmd->io, in cxd2880_tnrdmd_set_and_save_reg_bits()
3269 return set_cfg_mem(tnr_dmd, tgt, bank, address, value, bit_mask); in cxd2880_tnrdmd_set_and_save_reg_bits()
3272 int cxd2880_tnrdmd_set_scan_mode(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_set_scan_mode() argument
3276 if (!tnr_dmd) in cxd2880_tnrdmd_set_scan_mode()
3279 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_set_scan_mode()
3280 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_set_scan_mode()
3283 tnr_dmd->scan_mode = scan_mode_end; in cxd2880_tnrdmd_set_scan_mode()
3285 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_set_scan_mode()
3286 return cxd2880_tnrdmd_set_scan_mode(tnr_dmd->diver_sub, sys, in cxd2880_tnrdmd_set_scan_mode()
3292 int cxd2880_tnrdmd_set_pid_ftr(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_set_pid_ftr() argument
3296 if (!tnr_dmd) in cxd2880_tnrdmd_set_pid_ftr()
3299 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_set_pid_ftr()
3302 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_set_pid_ftr()
3303 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_set_pid_ftr()
3306 if (tnr_dmd->create_param.ts_output_if == CXD2880_TNRDMD_TSOUT_IF_TS) in cxd2880_tnrdmd_set_pid_ftr()
3310 tnr_dmd->pid_ftr_cfg = *pid_ftr_cfg; in cxd2880_tnrdmd_set_pid_ftr()
3311 tnr_dmd->pid_ftr_cfg_en = 1; in cxd2880_tnrdmd_set_pid_ftr()
3313 tnr_dmd->pid_ftr_cfg_en = 0; in cxd2880_tnrdmd_set_pid_ftr()
3316 if (tnr_dmd->state == CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_set_pid_ftr()
3317 return pid_ftr_setting(tnr_dmd, pid_ftr_cfg); in cxd2880_tnrdmd_set_pid_ftr()
3323 *tnr_dmd, in cxd2880_tnrdmd_set_rf_lvl_cmpstn()
3328 if (!tnr_dmd) in cxd2880_tnrdmd_set_rf_lvl_cmpstn()
3331 tnr_dmd->rf_lvl_cmpstn = rf_lvl_cmpstn; in cxd2880_tnrdmd_set_rf_lvl_cmpstn()
3337 *tnr_dmd, in cxd2880_tnrdmd_set_rf_lvl_cmpstn_sub()
3342 if (!tnr_dmd) in cxd2880_tnrdmd_set_rf_lvl_cmpstn_sub()
3345 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_set_rf_lvl_cmpstn_sub()
3348 return cxd2880_tnrdmd_set_rf_lvl_cmpstn(tnr_dmd->diver_sub, in cxd2880_tnrdmd_set_rf_lvl_cmpstn_sub()
3352 int cxd2880_tnrdmd_set_lna_thrs(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_set_lna_thrs() argument
3358 if (!tnr_dmd) in cxd2880_tnrdmd_set_lna_thrs()
3361 tnr_dmd->lna_thrs_tbl_air = tbl_air; in cxd2880_tnrdmd_set_lna_thrs()
3362 tnr_dmd->lna_thrs_tbl_cable = tbl_cable; in cxd2880_tnrdmd_set_lna_thrs()
3367 int cxd2880_tnrdmd_set_lna_thrs_sub(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_set_lna_thrs_sub() argument
3374 if (!tnr_dmd) in cxd2880_tnrdmd_set_lna_thrs_sub()
3377 if (tnr_dmd->diver_mode != CXD2880_TNRDMD_DIVERMODE_MAIN) in cxd2880_tnrdmd_set_lna_thrs_sub()
3380 return cxd2880_tnrdmd_set_lna_thrs(tnr_dmd->diver_sub, in cxd2880_tnrdmd_set_lna_thrs_sub()
3385 *tnr_dmd, u8 en, u8 value) in cxd2880_tnrdmd_set_ts_pin_high_low()
3389 if (!tnr_dmd) in cxd2880_tnrdmd_set_ts_pin_high_low()
3392 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_set_ts_pin_high_low()
3395 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP) in cxd2880_tnrdmd_set_ts_pin_high_low()
3398 if (tnr_dmd->create_param.ts_output_if != CXD2880_TNRDMD_TSOUT_IF_TS) in cxd2880_tnrdmd_set_ts_pin_high_low()
3401 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_set_ts_pin_high_low()
3408 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_set_ts_pin_high_low()
3414 ret = tnr_dmd->io->write_reg(tnr_dmd->io, in cxd2880_tnrdmd_set_ts_pin_high_low()
3418 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in cxd2880_tnrdmd_set_ts_pin_high_low()
3425 ret = load_cfg_mem(tnr_dmd); in cxd2880_tnrdmd_set_ts_pin_high_low()
3431 int cxd2880_tnrdmd_set_ts_output(struct cxd2880_tnrdmd *tnr_dmd, in cxd2880_tnrdmd_set_ts_output() argument
3436 if (!tnr_dmd) in cxd2880_tnrdmd_set_ts_output()
3439 if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB) in cxd2880_tnrdmd_set_ts_output()
3442 if (tnr_dmd->state != CXD2880_TNRDMD_STATE_SLEEP && in cxd2880_tnrdmd_set_ts_output()
3443 tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE) in cxd2880_tnrdmd_set_ts_output()
3446 switch (tnr_dmd->create_param.ts_output_if) { in cxd2880_tnrdmd_set_ts_output()
3449 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in cxd2880_tnrdmd_set_ts_output()
3456 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in cxd2880_tnrdmd_set_ts_output()
3463 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in cxd2880_tnrdmd_set_ts_output()
3470 ret = cxd2880_io_write_multi_regs(tnr_dmd->io, in cxd2880_tnrdmd_set_ts_output()
3492 int slvt_freeze_reg(struct cxd2880_tnrdmd *tnr_dmd) in slvt_freeze_reg() argument
3497 if (!tnr_dmd) in slvt_freeze_reg()
3500 switch (tnr_dmd->create_param.ts_output_if) { in slvt_freeze_reg()
3504 ret = tnr_dmd->io->read_regs(tnr_dmd->io, in slvt_freeze_reg()
3516 return tnr_dmd->io->write_reg(tnr_dmd->io, in slvt_freeze_reg()