static int32_t dsi_dpi_init(struct panel_spec* panel) { dsih_dpi_video_t dpi_param; dsih_error_t result; struct info_mipi * mipi = panel->info.mipi; dpi_param.no_of_lanes = mipi->lan_number; dpi_param.byte_clock = mipi->phy_feq / 8; dpi_param.pixel_clock = 384*1000/11;//DSI_PHY_REF_CLOCK / 4; switch(mipi->video_bus_width){ case 16: dpi_param.color_coding = COLOR_CODE_16BIT_CONFIG1; break; case 18: dpi_param.color_coding = COLOR_CODE_18BIT_CONFIG1; break; case 24: dpi_param.color_coding = COLOR_CODE_24BIT; break; default: FB_PRINT("sprdfb:[%s] fail, invalid video_bus_width\n", __FUNCTION__); break; } if(SPRDFB_POLARITY_POS == mipi ->h_sync_pol){ dpi_param.h_polarity = 1; } if(SPRDFB_POLARITY_POS == mipi ->v_sync_pol){ dpi_param.v_polarity = 1; } if(SPRDFB_POLARITY_POS == mipi ->de_pol){ dpi_param.data_en_polarity = 1; } dpi_param.h_active_pixels = panel->width; dpi_param.h_sync_pixels = mipi->timing->hsync; dpi_param.h_back_porch_pixels = mipi->timing->hbp; dpi_param.h_total_pixels = panel->width + mipi->timing->hsync + mipi->timing->hbp + mipi->timing->hfp; dpi_param.v_active_lines = panel->height; dpi_param.v_sync_lines = mipi->timing->vsync; dpi_param.v_back_porch_lines = mipi->timing->vbp; dpi_param.v_total_lines = panel->height + mipi->timing->vsync + mipi->timing->vbp + mipi->timing->vfp; dpi_param.receive_ack_packets = 0; dpi_param.video_mode = VIDEO_BURST_WITH_SYNC_PULSES; dpi_param.virtual_channel = 0; dpi_param.is_18_loosely = 0; result = mipi_dsih_dpi_video(&(dsi_ctx.dsi_inst), &dpi_param); if(result != OK){ FB_PRINT("sprdfb: [%s] mipi_dsih_dpi_video fail (%d)!\n", __FUNCTION__, result); return -1; } return 0; }
static int32_t dsi_dpi_init(struct panel_spec* panel) { dsih_dpi_video_t dpi_param; dsih_error_t result; struct info_mipi * mipi = panel->info.mipi; dpi_param.no_of_lanes = mipi->lan_number; dpi_param.byte_clock = mipi->phy_feq / 8; dpi_param.pixel_clock = DISPC_DPI_CLOCK / 1000; #ifdef FB_DSIH_VERSION_1P21A dpi_param.max_hs_to_lp_cycles = 4;//110; dpi_param.max_lp_to_hs_cycles = 15;//10; #endif switch(mipi->video_bus_width){ case 16: dpi_param.color_coding = COLOR_CODE_16BIT_CONFIG1; break; case 18: dpi_param.color_coding = COLOR_CODE_18BIT_CONFIG1; break; case 24: dpi_param.color_coding = COLOR_CODE_24BIT; break; default: printk(KERN_ERR "autotst_dsi:[%s] fail, invalid video_bus_width\n", __FUNCTION__); break; } if(SPRDFB_POLARITY_POS == mipi ->h_sync_pol){ dpi_param.h_polarity = 1; } if(SPRDFB_POLARITY_POS == mipi ->v_sync_pol){ dpi_param.v_polarity = 1; } if(SPRDFB_POLARITY_POS == mipi ->de_pol){ dpi_param.data_en_polarity = 1; } dpi_param.h_active_pixels = panel->width; dpi_param.h_sync_pixels = mipi->timing->hsync; dpi_param.h_back_porch_pixels = mipi->timing->hbp; dpi_param.h_total_pixels = panel->width + mipi->timing->hsync + mipi->timing->hbp + mipi->timing->hfp; dpi_param.v_active_lines = panel->height; dpi_param.v_sync_lines = mipi->timing->vsync; dpi_param.v_back_porch_lines = mipi->timing->vbp; dpi_param.v_total_lines = panel->height + mipi->timing->vsync + mipi->timing->vbp + mipi->timing->vfp; dpi_param.receive_ack_packets = 0; dpi_param.video_mode = VIDEO_BURST_WITH_SYNC_PULSES; dpi_param.virtual_channel = 0; dpi_param.is_18_loosely = 0; result = mipi_dsih_dpi_video(&(autotst_dsi_ctx.dsi_inst), &dpi_param); if(result != OK){ printk(KERN_ERR "autotst_dsi: [%s] mipi_dsih_dpi_video fail (%d)!\n", __FUNCTION__, result); return -1; } return 0; }