Lines Matching refs:kmb_dsi
176 static void kmb_dsi_clk_disable(struct kmb_dsi *kmb_dsi) in kmb_dsi_clk_disable() argument
178 clk_disable_unprepare(kmb_dsi->clk_mipi); in kmb_dsi_clk_disable()
179 clk_disable_unprepare(kmb_dsi->clk_mipi_ecfg); in kmb_dsi_clk_disable()
180 clk_disable_unprepare(kmb_dsi->clk_mipi_cfg); in kmb_dsi_clk_disable()
183 void kmb_dsi_host_unregister(struct kmb_dsi *kmb_dsi) in kmb_dsi_host_unregister() argument
185 kmb_dsi_clk_disable(kmb_dsi); in kmb_dsi_host_unregister()
186 mipi_dsi_host_unregister(kmb_dsi->host); in kmb_dsi_host_unregister()
385 static u32 mipi_tx_fg_section_cfg_regs(struct kmb_dsi *kmb_dsi, in mipi_tx_fg_section_cfg_regs() argument
412 dev_dbg(kmb_dsi->dev, in mipi_tx_fg_section_cfg_regs()
415 kmb_write_mipi(kmb_dsi, in mipi_tx_fg_section_cfg_regs()
430 kmb_write_bits_mipi(kmb_dsi, reg_adr, (section % 2) * 16, 16, in mipi_tx_fg_section_cfg_regs()
432 dev_dbg(kmb_dsi->dev, in mipi_tx_fg_section_cfg_regs()
438 kmb_write_mipi(kmb_dsi, reg_adr, height_lines); in mipi_tx_fg_section_cfg_regs()
442 static u32 mipi_tx_fg_section_cfg(struct kmb_dsi *kmb_dsi, in mipi_tx_fg_section_cfg() argument
476 mipi_tx_fg_section_cfg_regs(kmb_dsi, frame_id, section, in mipi_tx_fg_section_cfg()
490 static void mipi_tx_fg_cfg_regs(struct kmb_dsi *kmb_dsi, u8 frame_gen, in mipi_tx_fg_cfg_regs() argument
500 if (kmb_dsi->sys_clk_mhz == SYSCLK_500) { in mipi_tx_fg_cfg_regs()
501 sysclk = kmb_dsi->sys_clk_mhz - CLK_DIFF_LOW; in mipi_tx_fg_cfg_regs()
504 sysclk = kmb_dsi->sys_clk_mhz - CLK_DIFF_HI; in mipi_tx_fg_cfg_regs()
517 dev_dbg(kmb_dsi->dev, "ppl_llp_ratio=%d\n", ppl_llp_ratio); in mipi_tx_fg_cfg_regs()
518 dev_dbg(kmb_dsi->dev, "bpp=%d sysclk=%d lane-rate=%d active-lanes=%d\n", in mipi_tx_fg_cfg_regs()
524 kmb_write_mipi(kmb_dsi, reg_adr, fg_cfg->v_active); in mipi_tx_fg_cfg_regs()
534 kmb_write_bits_mipi(kmb_dsi, reg_adr, offset, 16, fg_cfg->vsync_width); in mipi_tx_fg_cfg_regs()
538 kmb_write_bits_mipi(kmb_dsi, reg_adr, offset, 16, fg_cfg->v_backporch); in mipi_tx_fg_cfg_regs()
542 kmb_write_bits_mipi(kmb_dsi, reg_adr, offset, 16, fg_cfg->v_frontporch); in mipi_tx_fg_cfg_regs()
546 kmb_write_bits_mipi(kmb_dsi, reg_adr, offset, 16, fg_cfg->v_active); in mipi_tx_fg_cfg_regs()
550 kmb_write_mipi(kmb_dsi, reg_adr, in mipi_tx_fg_cfg_regs()
555 kmb_write_mipi(kmb_dsi, reg_adr, in mipi_tx_fg_cfg_regs()
560 kmb_write_mipi(kmb_dsi, reg_adr, in mipi_tx_fg_cfg_regs()
570 kmb_write_mipi(kmb_dsi, reg_adr, val); in mipi_tx_fg_cfg_regs()
574 kmb_write_mipi(kmb_dsi, reg_adr, fg_cfg->hsync_width * (fg_cfg->bpp / 8)); in mipi_tx_fg_cfg_regs()
578 kmb_write_mipi(kmb_dsi, reg_adr, fg_cfg->h_backporch * (fg_cfg->bpp / 8)); in mipi_tx_fg_cfg_regs()
582 kmb_write_mipi(kmb_dsi, reg_adr, in mipi_tx_fg_cfg_regs()
586 static void mipi_tx_fg_cfg(struct kmb_dsi *kmb_dsi, u8 frame_gen, in mipi_tx_fg_cfg() argument
614 mipi_tx_fg_cfg_regs(kmb_dsi, frame_gen, &fg_t_cfg); in mipi_tx_fg_cfg()
617 static void mipi_tx_multichannel_fifo_cfg(struct kmb_dsi *kmb_dsi, in mipi_tx_multichannel_fifo_cfg() argument
624 kmb_write_mipi(kmb_dsi, MIPI_TX_HS_MC_FIFO_CTRL_EN, 0); in mipi_tx_multichannel_fifo_cfg()
625 kmb_write_mipi(kmb_dsi, MIPI_TX_HS_MC_FIFO_CHAN_ALLOC0, 0); in mipi_tx_multichannel_fifo_cfg()
626 kmb_write_mipi(kmb_dsi, MIPI_TX_HS_MC_FIFO_CHAN_ALLOC1, 0); in mipi_tx_multichannel_fifo_cfg()
627 kmb_write_mipi(kmb_dsi, MIPI_TX_HS_MC_FIFO_RTHRESHOLD0, 0); in mipi_tx_multichannel_fifo_cfg()
628 kmb_write_mipi(kmb_dsi, MIPI_TX_HS_MC_FIFO_RTHRESHOLD1, 0); in mipi_tx_multichannel_fifo_cfg()
638 SET_MC_FIFO_CHAN_ALLOC(kmb_dsi, ctrl_no, vchannel_id, fifo_size); in mipi_tx_multichannel_fifo_cfg()
642 SET_MC_FIFO_RTHRESHOLD(kmb_dsi, ctrl_no, vchannel_id, fifo_rthreshold); in mipi_tx_multichannel_fifo_cfg()
645 kmb_set_bit_mipi(kmb_dsi, MIPI_TXm_HS_MC_FIFO_CTRL_EN(ctrl_no), in mipi_tx_multichannel_fifo_cfg()
649 static void mipi_tx_ctrl_cfg(struct kmb_dsi *kmb_dsi, u8 fg_id, in mipi_tx_ctrl_cfg() argument
686 dev_dbg(kmb_dsi->dev, "sync_cfg=%d fg_en=%d\n", sync_cfg, fg_en); in mipi_tx_ctrl_cfg()
702 kmb_write_mipi(kmb_dsi, MIPI_TXm_HS_SYNC_CFG(ctrl_no), sync_cfg); in mipi_tx_ctrl_cfg()
703 kmb_write_mipi(kmb_dsi, MIPI_TXm_HS_CTRL(ctrl_no), ctrl); in mipi_tx_ctrl_cfg()
706 static u32 mipi_tx_init_cntrl(struct kmb_dsi *kmb_dsi, in mipi_tx_init_cntrl() argument
739 ret = mipi_tx_fg_section_cfg(kmb_dsi, frame_id, sect, in mipi_tx_init_cntrl()
748 mipi_tx_fg_cfg(kmb_dsi, frame_id, ctrl_cfg->active_lanes, in mipi_tx_init_cntrl()
763 mipi_tx_multichannel_fifo_cfg(kmb_dsi, ctrl_cfg->active_lanes, frame_id); in mipi_tx_init_cntrl()
766 mipi_tx_ctrl_cfg(kmb_dsi, frame_id, ctrl_cfg); in mipi_tx_init_cntrl()
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()
812 kmb_write_mipi(kmb_dsi, in test_mode_send()
817 SET_DPHY_TEST_CTRL1_CLK(kmb_dsi, dphy_no); in test_mode_send()
822 set_test_mode_src_osc_freq_target_low_bits(struct kmb_dsi *kmb_dsi, 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()
834 set_test_mode_src_osc_freq_target_hi_bits(struct kmb_dsi *kmb_dsi, 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()
936 dev_dbg(kmb_dsi->dev, "m = %d n = %d\n", best_m, best_n); 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()
1092 kmb_write_bits_mipi(kmb_dsi, DPHY_INIT_CTRL1, PLL_CLKSEL_0, 2, 0x01); in setup_pll()
1095 kmb_set_bit_mipi(kmb_dsi, DPHY_INIT_CTRL1, PLL_SHADOW_CTRL); 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()
1118 static void dphy_init_sequence(struct kmb_dsi *kmb_dsi, 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()
1130 val = kmb_read_mipi(kmb_dsi, DPHY_INIT_CTRL0); 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()
1191 kmb_write_bits_mipi(kmb_dsi, DPHY_INIT_CTRL2, 0, 9, 0x03f); 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()
1234 dev_dbg(kmb_dsi->dev, "* DPHY %d WAIT_FSM %s *", 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()
1255 dev_dbg(kmb_dsi->dev, in wait_init_done()
1257 kmb_read_mipi(kmb_dsi, MIPI_DPHY_ERR_STAT6_7)); in wait_init_done()
1262 dev_dbg(kmb_dsi->dev, "* DPHY %d INIT - %s *", in wait_init_done()
1266 static void wait_pll_lock(struct kmb_dsi *kmb_dsi, u32 dphy_no) in wait_pll_lock() argument
1276 dev_dbg(kmb_dsi->dev, "%s: timing out", __func__); in wait_pll_lock()
1279 } while (!GET_PLL_LOCK(kmb_dsi, dphy_no)); in wait_pll_lock()
1281 dev_dbg(kmb_dsi->dev, "* PLL Locked for DPHY %d - %s *", in wait_pll_lock()
1285 static u32 mipi_tx_init_dphy(struct kmb_dsi *kmb_dsi, in mipi_tx_init_dphy() argument
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()
1335 static void connect_lcd_to_mipi(struct kmb_dsi *kmb_dsi, in connect_lcd_to_mipi() argument
1342 dev_dbg(kmb_dsi->dev, "failed to get msscam syscon"); in connect_lcd_to_mipi()
1355 int kmb_dsi_mode_set(struct kmb_dsi *kmb_dsi, struct drm_display_mode *mode, in kmb_dsi_mode_set() argument
1360 kmb_dsi->sys_clk_mhz = sys_clk_mhz; in kmb_dsi_mode_set()
1385 dev_dbg(kmb_dsi->dev, "data_rate=%u active_lanes=%d\n", in kmb_dsi_mode_set()
1399 mipi_tx_init_cntrl(kmb_dsi, &mipi_tx_init_cfg); in kmb_dsi_mode_set()
1402 mipi_tx_init_dphy(kmb_dsi, &mipi_tx_init_cfg); in kmb_dsi_mode_set()
1404 connect_lcd_to_mipi(kmb_dsi, old_state); in kmb_dsi_mode_set()
1405 dev_info(kmb_dsi->dev, "mipi hw initialized"); in kmb_dsi_mode_set()
1410 struct kmb_dsi *kmb_dsi_init(struct platform_device *pdev) in kmb_dsi_init()
1412 struct kmb_dsi *kmb_dsi; in kmb_dsi_init() local
1415 kmb_dsi = devm_kzalloc(dev, sizeof(*kmb_dsi), GFP_KERNEL); in kmb_dsi_init()
1416 if (!kmb_dsi) { in kmb_dsi_init()
1421 kmb_dsi->host = dsi_host; in kmb_dsi_init()
1422 kmb_dsi->host->ops = &kmb_dsi_host_ops; in kmb_dsi_init()
1424 dsi_device->host = kmb_dsi->host; in kmb_dsi_init()
1425 kmb_dsi->device = dsi_device; in kmb_dsi_init()
1427 return kmb_dsi; in kmb_dsi_init()
1430 int kmb_dsi_encoder_init(struct drm_device *dev, struct kmb_dsi *kmb_dsi) in kmb_dsi_encoder_init() argument
1436 encoder = &kmb_dsi->base; in kmb_dsi_encoder_init()
1442 dev_err(kmb_dsi->dev, "Failed to init encoder %d\n", ret); in kmb_dsi_encoder_init()
1464 int kmb_dsi_map_mmio(struct kmb_dsi *kmb_dsi) in kmb_dsi_map_mmio() argument
1467 struct device *dev = kmb_dsi->dev; in kmb_dsi_map_mmio()
1469 res = platform_get_resource_byname(kmb_dsi->pdev, IORESOURCE_MEM, in kmb_dsi_map_mmio()
1475 kmb_dsi->mipi_mmio = devm_ioremap_resource(dev, res); in kmb_dsi_map_mmio()
1476 if (IS_ERR(kmb_dsi->mipi_mmio)) { in kmb_dsi_map_mmio()
1478 return PTR_ERR(kmb_dsi->mipi_mmio); in kmb_dsi_map_mmio()
1483 static int kmb_dsi_clk_enable(struct kmb_dsi *kmb_dsi) in kmb_dsi_clk_enable() argument
1486 struct device *dev = kmb_dsi->dev; in kmb_dsi_clk_enable()
1488 ret = clk_prepare_enable(kmb_dsi->clk_mipi); in kmb_dsi_clk_enable()
1494 ret = clk_prepare_enable(kmb_dsi->clk_mipi_ecfg); in kmb_dsi_clk_enable()
1500 ret = clk_prepare_enable(kmb_dsi->clk_mipi_cfg); in kmb_dsi_clk_enable()
1510 int kmb_dsi_clk_init(struct kmb_dsi *kmb_dsi) in kmb_dsi_clk_init() argument
1512 struct device *dev = kmb_dsi->dev; in kmb_dsi_clk_init()
1515 kmb_dsi->clk_mipi = devm_clk_get(dev, "clk_mipi"); in kmb_dsi_clk_init()
1516 if (IS_ERR(kmb_dsi->clk_mipi)) { in kmb_dsi_clk_init()
1518 return PTR_ERR(kmb_dsi->clk_mipi); in kmb_dsi_clk_init()
1521 kmb_dsi->clk_mipi_ecfg = devm_clk_get(dev, "clk_mipi_ecfg"); in kmb_dsi_clk_init()
1522 if (IS_ERR(kmb_dsi->clk_mipi_ecfg)) { in kmb_dsi_clk_init()
1524 return PTR_ERR(kmb_dsi->clk_mipi_ecfg); in kmb_dsi_clk_init()
1527 kmb_dsi->clk_mipi_cfg = devm_clk_get(dev, "clk_mipi_cfg"); in kmb_dsi_clk_init()
1528 if (IS_ERR(kmb_dsi->clk_mipi_cfg)) { in kmb_dsi_clk_init()
1530 return PTR_ERR(kmb_dsi->clk_mipi_cfg); in kmb_dsi_clk_init()
1533 clk_set_rate(kmb_dsi->clk_mipi, KMB_MIPI_DEFAULT_CLK); in kmb_dsi_clk_init()
1534 if (clk_get_rate(kmb_dsi->clk_mipi) != KMB_MIPI_DEFAULT_CLK) { in kmb_dsi_clk_init()
1539 dev_dbg(dev, "clk_mipi = %ld\n", clk_get_rate(kmb_dsi->clk_mipi)); in kmb_dsi_clk_init()
1541 clk = clk_get_rate(kmb_dsi->clk_mipi_ecfg); in kmb_dsi_clk_init()
1544 clk_set_rate(kmb_dsi->clk_mipi_ecfg, KMB_MIPI_DEFAULT_CFG_CLK); in kmb_dsi_clk_init()
1545 clk = clk_get_rate(kmb_dsi->clk_mipi_ecfg); in kmb_dsi_clk_init()
1553 clk = clk_get_rate(kmb_dsi->clk_mipi_cfg); in kmb_dsi_clk_init()
1556 clk_set_rate(kmb_dsi->clk_mipi_cfg, 24000000); in kmb_dsi_clk_init()
1557 clk = clk_get_rate(kmb_dsi->clk_mipi_cfg); in kmb_dsi_clk_init()
1565 return kmb_dsi_clk_enable(kmb_dsi); in kmb_dsi_clk_init()