static void init_dpi(BOOL isDpiPoweredOn) { const LCM_DPI_PARAMS *dpi = &(lcm_params->dpi); UINT32 i; DPI_CHECK_RET(DPI_Init(isDpiPoweredOn)); DPI_CHECK_RET(DPI_EnableSeqOutput(FALSE)); DPI_CHECK_RET(DPI_ConfigPixelClk((DPI_POLARITY)dpi->clk_pol, dpi->dpi_clk_div, dpi->dpi_clk_duty)); DPI_CHECK_RET(DPI_ConfigDataEnable((DPI_POLARITY)dpi->de_pol)); DPI_CHECK_RET(DPI_ConfigHsync((DPI_POLARITY)dpi->hsync_pol, dpi->hsync_pulse_width, dpi->hsync_back_porch, dpi->hsync_front_porch)); DPI_CHECK_RET(DPI_ConfigVsync((DPI_POLARITY)dpi->vsync_pol, dpi->vsync_pulse_width, dpi->vsync_back_porch, dpi->vsync_front_porch)); #ifdef MT65XX_NEW_DISP DPI_CHECK_RET(DPI_ConfigLVDS(lcm_params)); #endif DPI_CHECK_RET(DPI_FBSetSize(DISP_GetScreenWidth(), DISP_GetScreenHeight())); for (i = 0; i < dpi->intermediat_buffer_num; ++ i) { DPI_CHECK_RET(DPI_FBSetAddress(DPI_FB_0 + i, s_tmpBuffers[i].pa)); DPI_CHECK_RET(DPI_FBSetPitch(DPI_FB_0 + i, s_tmpBuffers[i].pitchInBytes)); DPI_CHECK_RET(DPI_FBEnable(DPI_FB_0 + i, TRUE)); } DPI_CHECK_RET(DPI_FBSetFormat(dpiTmpBufFormat)); DPI_CHECK_RET(DPI_FBSyncFlipWithLCD(TRUE)); if (LCM_COLOR_ORDER_BGR == dpi->rgb_order) { DPI_CHECK_RET(DPI_SetRGBOrder(DPI_RGB_ORDER_RGB, DPI_RGB_ORDER_BGR)); } else { DPI_CHECK_RET(DPI_SetRGBOrder(DPI_RGB_ORDER_RGB, DPI_RGB_ORDER_RGB)); } DPI_CHECK_RET(DPI_EnableClk()); }
static void init_dpi(BOOL isDpiPoweredOn) { const LCM_DPI_PARAMS *dpi = &(lcm_params->dpi); UINT32 i; DPI_CHECK_RET(DPI_Init(isDpiPoweredOn)); DPI_CHECK_RET(DPI_ConfigHsync((DPI_POLARITY)dpi->hsync_pol, dpi->hsync_pulse_width, dpi->hsync_back_porch, dpi->hsync_front_porch)); DPI_CHECK_RET(DPI_ConfigVsync((DPI_POLARITY)dpi->vsync_pol, dpi->vsync_pulse_width, dpi->vsync_back_porch, dpi->vsync_front_porch)); DPI_CHECK_RET(DPI_FBSetSize(DISP_GetScreenWidth(), DISP_GetScreenHeight())); DPI_CHECK_RET(DPI_OutputSetting()); DPI_CHECK_RET(DPI_EnableClk()); }
/* Will only be used in hdmi_drv_init(), this means that will only be use in ioctl(MTK_HDMI_AUDIO_VIDEO_ENABLE) */ /*static*/ void hdmi_dpi_config_clock(void) { int ret = 0; RET_VOID_IF(p->output_mode == HDMI_OUTPUT_MODE_DPI_BYPASS); ret = enable_pll(TVDPLL, "HDMI"); if(ret) { HDMI_LOG("enable_pll fail!!\n"); } printk("[hdmi]720p 60Hz\n"); //ret = pll_fsel(TVDPLL, 0x800B6C4E); OUTREG32(TVDPLL_CON1, 0x800B6C4E); //148.5MHz OUTREG32(TVDPLL_CON0, 0x80000081); //OUTREG32(TVDPLL_CON0, 0x80000081); //OUTREG32(DISPSYS_BASE+0x038, 0x1); // rdma0_out_sel, 2 for DPI0 //OUTREG32(DISPSYS_BASE+0x05c, 0x1); // DPI0_SEL, 0 is from rdma0 ASSERT(!ret); clk_pol = HDMI_POLARITY_FALLING; de_pol = HDMI_POLARITY_RISING; hsync_pol = HDMI_POLARITY_RISING; vsync_pol = HDMI_POLARITY_RISING;; hsync_front_porch = 110; hsync_pulse_width = 40; hsync_back_porch = 220; vsync_front_porch = 5; vsync_pulse_width = 5; vsync_back_porch = 20; dpi_clk_div = 2; dpi_clk_duty = 1; rgb_order = hdmi_params->rgb_order; intermediat_buffer_num = 4; // dpi clock configuration using MIPITX //if(hdmi_params->dpi_port == HDMI_DPI_OUTPUT_PORT_0) { DPI_CHECK_RET(DPI_Init(FALSE)); DPI_CHECK_RET(DPI_ConfigPixelClk(clk_pol, dpi_clk_div, dpi_clk_duty)); DPI_CHECK_RET(DPI_ConfigDataEnable(de_pol)); DPI_CHECK_RET(DPI_ConfigHsync(hsync_pol, hsync_pulse_width, hsync_back_porch, hsync_front_porch)); DPI_CHECK_RET(DPI_ConfigVsync(vsync_pol, vsync_pulse_width, vsync_back_porch, vsync_front_porch)); DPI_CHECK_RET(DPI_FBSetSize(1280, 720)); //if (LCM_COLOR_ORDER_BGR == rgb_order) if (HDMI_COLOR_ORDER_BGR == rgb_order) { DPI_CHECK_RET(DPI_SetRGBOrder(DPI_RGB_ORDER_RGB, DPI_RGB_ORDER_BGR)); } else { DPI_CHECK_RET(DPI_SetRGBOrder(DPI_RGB_ORDER_RGB, DPI_RGB_ORDER_RGB)); } //DPI_Internal_Pattern(1, 5); DPI_CHECK_RET(DPI_EnableClk()); p->is_clock_on = true; } }