Lines Matching refs:dphy_no

771 static void test_mode_send(struct kmb_dsi *kmb_dsi, u32 dphy_no,  in test_mode_send()  argument
783 SET_DPHY_TEST_CTRL1_CLK(kmb_dsi, dphy_no); in test_mode_send()
786 SET_TEST_DIN0_3(kmb_dsi, dphy_no, test_code); in test_mode_send()
789 SET_DPHY_TEST_CTRL1_EN(kmb_dsi, dphy_no); in test_mode_send()
792 CLR_DPHY_TEST_CTRL1_CLK(kmb_dsi, dphy_no); in test_mode_send()
795 CLR_DPHY_TEST_CTRL1_EN(kmb_dsi, dphy_no); in test_mode_send()
806 CLR_DPHY_TEST_CTRL1_EN(kmb_dsi, dphy_no); in test_mode_send()
809 CLR_DPHY_TEST_CTRL1_CLK(kmb_dsi, dphy_no); in test_mode_send()
813 DPHY_TEST_DIN0_3 + ((dphy_no / 0x4) * 0x4), in test_mode_send()
814 test_data << ((dphy_no % 4) * 8)); in test_mode_send()
817 SET_DPHY_TEST_CTRL1_CLK(kmb_dsi, dphy_no); in test_mode_send()
823 u32 dphy_no, in set_test_mode_src_osc_freq_target_low_bits() argument
829 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_SLEW_RATE_DDL_CYCLES, in set_test_mode_src_osc_freq_target_low_bits()
835 u32 dphy_no, in set_test_mode_src_osc_freq_target_hi_bits() argument
846 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_SLEW_RATE_DDL_CYCLES, data); in set_test_mode_src_osc_freq_target_hi_bits()
863 static void mipi_tx_pll_setup(struct kmb_dsi *kmb_dsi, u32 dphy_no, in mipi_tx_pll_setup() argument
932 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_VCO_CTRL, (vco_p.range in mipi_tx_pll_setup()
939 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_INPUT_DIVIDER, in mipi_tx_pll_setup()
945 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_FEEDBACK_DIVIDER, in mipi_tx_pll_setup()
951 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_FEEDBACK_DIVIDER, in mipi_tx_pll_setup()
955 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_OUTPUT_CLK_SEL, in mipi_tx_pll_setup()
962 test_mode_send(kmb_dsi, dphy_no, in mipi_tx_pll_setup()
967 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_INTEGRAL_CHARGE_PUMP_CTRL, in mipi_tx_pll_setup()
971 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_GMP_CTRL, 0x10); in mipi_tx_pll_setup()
974 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_CHARGE_PUMP_BIAS, 0x10); in mipi_tx_pll_setup()
979 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_PHASE_ERR_CTRL, 0x02); in mipi_tx_pll_setup()
984 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_LOCK_FILTER, 0x60); in mipi_tx_pll_setup()
987 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_UNLOCK_FILTER, 0x03); in mipi_tx_pll_setup()
992 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_PLL_LOCK_DETECTOR, 0x02); in mipi_tx_pll_setup()
995 static void set_slewrate_gt_1500(struct kmb_dsi *kmb_dsi, u32 dphy_no) in set_slewrate_gt_1500() argument
1003 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_gt_1500()
1008 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_gt_1500()
1011 static void set_slewrate_gt_1000(struct kmb_dsi *kmb_dsi, u32 dphy_no) in set_slewrate_gt_1000() argument
1024 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_gt_1000()
1029 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_gt_1000()
1036 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_gt_1000()
1043 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_gt_1000()
1046 static void set_slewrate_lt_1000(struct kmb_dsi *kmb_dsi, u32 dphy_no) in set_slewrate_lt_1000() argument
1059 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_lt_1000()
1064 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_lt_1000()
1069 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_lt_1000()
1074 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_slewrate_lt_1000()
1077 static void setup_pll(struct kmb_dsi *kmb_dsi, u32 dphy_no, in setup_pll() argument
1085 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in setup_pll()
1088 mipi_tx_pll_setup(kmb_dsi, dphy_no, cfg->ref_clk_khz / 1000, in setup_pll()
1098 static void set_lane_data_rate(struct kmb_dsi *kmb_dsi, u32 dphy_no, in set_lane_data_rate() argument
1113 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in set_lane_data_rate()
1119 struct mipi_ctrl_cfg *cfg, u32 dphy_no, in dphy_init_sequence() argument
1126 CLR_DPHY_INIT_CTRL0(kmb_dsi, dphy_no, RESETZ); in dphy_init_sequence()
1129 CLR_DPHY_INIT_CTRL0(kmb_dsi, dphy_no, SHUTDOWNZ); in dphy_init_sequence()
1136 CLR_DPHY_TEST_CTRL0(kmb_dsi, dphy_no); in dphy_init_sequence()
1138 SET_DPHY_TEST_CTRL0(kmb_dsi, dphy_no); in dphy_init_sequence()
1140 CLR_DPHY_TEST_CTRL0(kmb_dsi, dphy_no); in dphy_init_sequence()
1153 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in dphy_init_sequence()
1156 set_lane_data_rate(kmb_dsi, dphy_no, cfg); in dphy_init_sequence()
1162 set_slewrate_gt_1500(kmb_dsi, dphy_no); in dphy_init_sequence()
1164 set_slewrate_gt_1000(kmb_dsi, dphy_no); in dphy_init_sequence()
1166 set_slewrate_lt_1000(kmb_dsi, dphy_no); in dphy_init_sequence()
1170 SET_DPHY_FREQ_CTRL0_3(kmb_dsi, dphy_no, val); in dphy_init_sequence()
1173 kmb_set_bit_mipi(kmb_dsi, DPHY_CFG_CLK_EN, dphy_no); in dphy_init_sequence()
1177 setup_pll(kmb_dsi, dphy_no, cfg); in dphy_init_sequence()
1182 test_mode_send(kmb_dsi, dphy_no, test_code, test_data); in dphy_init_sequence()
1198 kmb_set_bit_mipi(kmb_dsi, DPHY_INIT_CTRL2, 12 + dphy_no); in dphy_init_sequence()
1201 kmb_write_bits_mipi(kmb_dsi, DPHY_ENABLE, dphy_no * 2, 2, in dphy_init_sequence()
1208 SET_DPHY_INIT_CTRL0(kmb_dsi, dphy_no, SHUTDOWNZ); in dphy_init_sequence()
1212 SET_DPHY_INIT_CTRL0(kmb_dsi, dphy_no, RESETZ); in dphy_init_sequence()
1215 static void dphy_wait_fsm(struct kmb_dsi *kmb_dsi, u32 dphy_no, in dphy_wait_fsm() argument
1223 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_FSM_CONTROL, 0x80); in dphy_wait_fsm()
1225 val = GET_TEST_DOUT4_7(kmb_dsi, dphy_no); in dphy_wait_fsm()
1233 dev_dbg(kmb_dsi->dev, "%s: dphy %d val = %x", __func__, dphy_no, val); in dphy_wait_fsm()
1235 dphy_no, status ? "SUCCESS" : "FAILED"); in dphy_wait_fsm()
1238 static void wait_init_done(struct kmb_dsi *kmb_dsi, u32 dphy_no, in wait_init_done() argument
1247 stopstatedata = GET_STOPSTATE_DATA(kmb_dsi, dphy_no) in wait_init_done()
1263 dphy_no, status ? "SUCCESS" : "FAILED"); in wait_init_done()
1266 static void wait_pll_lock(struct kmb_dsi *kmb_dsi, u32 dphy_no) in wait_pll_lock() argument
1279 } while (!GET_PLL_LOCK(kmb_dsi, dphy_no)); in wait_pll_lock()
1282 dphy_no, status ? "SUCCESS" : "FAILED"); in wait_pll_lock()
1288 u32 dphy_no = MIPI_DPHY6; in mipi_tx_init_dphy() local
1308 dphy_init_sequence(kmb_dsi, cfg, dphy_no + 1, in mipi_tx_init_dphy()
1311 dphy_wait_fsm(kmb_dsi, dphy_no + 1, DPHY_TX_LOCK); in mipi_tx_init_dphy()
1314 dphy_init_sequence(kmb_dsi, cfg, dphy_no, MIPI_DPHY_D_LANES, in mipi_tx_init_dphy()
1318 wait_init_done(kmb_dsi, dphy_no, MIPI_DPHY_D_LANES); in mipi_tx_init_dphy()
1319 wait_init_done(kmb_dsi, dphy_no + 1, in mipi_tx_init_dphy()
1321 wait_pll_lock(kmb_dsi, dphy_no); in mipi_tx_init_dphy()
1322 wait_pll_lock(kmb_dsi, dphy_no + 1); in mipi_tx_init_dphy()
1323 dphy_wait_fsm(kmb_dsi, dphy_no, DPHY_TX_IDLE); in mipi_tx_init_dphy()
1325 dphy_init_sequence(kmb_dsi, cfg, dphy_no, cfg->active_lanes, in mipi_tx_init_dphy()
1327 dphy_wait_fsm(kmb_dsi, dphy_no, DPHY_TX_IDLE); in mipi_tx_init_dphy()
1328 wait_init_done(kmb_dsi, dphy_no, cfg->active_lanes); in mipi_tx_init_dphy()
1329 wait_pll_lock(kmb_dsi, dphy_no); in mipi_tx_init_dphy()