rk3368:mipi: Solve clk_unprepare error problem when plug and pull out hdmi.

Signed-off-by: xubilv <xbl@rock-chips.com>
This commit is contained in:
xubilv
2015-04-07 18:45:26 +08:00
parent 9f7e4c2ef6
commit 721f684bc0
2 changed files with 36 additions and 25 deletions

View File

@@ -501,6 +501,7 @@ static int rk312x_phy_power_down(struct dsi *dsi)
clk_disable_unprepare(dsi->phy.refclk);
clk_disable_unprepare(dsi->dsi_pclk);
clk_disable_unprepare(dsi->dsi_host_pclk);
if (dsi->ops.id == DWC_DSI_VERSION_RK312x) {
clk_disable_unprepare(dsi->h2p_hclk);
clk_disable_unprepare(dsi->dsi_pd);
@@ -1556,31 +1557,34 @@ static int dwc_phy_test_rd(struct dsi *dsi, unsigned char test_code)
static int rk32_dsi_enable(void)
{
MIPI_DBG("rk32_dsi_enable-------\n");
rk_fb_get_prmry_screen(dsi0->screen.screen);
dsi0->screen.lcdc_id = dsi0->screen.screen->lcdc_id;
rk32_init_phy_mode(dsi0->screen.lcdc_id);
if (!dsi0->clk_on) {
dsi0->clk_on = 1;
rk_fb_get_prmry_screen(dsi0->screen.screen);
dsi0->screen.lcdc_id = dsi0->screen.screen->lcdc_id;
rk32_init_phy_mode(dsi0->screen.lcdc_id);
dsi_init(0, 0);
if (rk_mipi_get_dsi_num() == 2)
dsi_init(1, 0);
dsi_init(0, 0);
if (rk_mipi_get_dsi_num() == 2)
dsi_init(1, 0);
rk_mipi_screen_standby(0);
rk_mipi_screen_standby(0);
/*
After the core reset, DPI waits for the first VSYNC active transition to start signal sampling, including
pixel data, and preventing image transmission in the middle of a frame.
/* After the core reset, DPI waits for the first VSYNC
active transition to start signal sampling, including pixel data,
and preventing image transmission in the middle of a frame.
*/
dsi_is_enable(0, 0);
if (rk_mipi_get_dsi_num() == 2)
dsi_is_enable(1, 0);
dsi_is_enable(0, 0);
if (rk_mipi_get_dsi_num() == 2)
dsi_is_enable(1, 0);
dsi_enable_video_mode(0, 1);
if (rk_mipi_get_dsi_num() == 2)
dsi_enable_video_mode(1, 1);
dsi_enable_video_mode(0, 1);
if (rk_mipi_get_dsi_num() == 2)
dsi_enable_video_mode(1, 1);
dsi_is_enable(0, 1);
if (rk_mipi_get_dsi_num() == 2)
dsi_is_enable(1, 1);
dsi_is_enable(0, 1);
if (rk_mipi_get_dsi_num() == 2)
dsi_is_enable(1, 1);
}
return 0;
}
@@ -1588,10 +1592,13 @@ static int rk32_dsi_enable(void)
static int rk32_dsi_disable(void)
{
MIPI_DBG("rk32_dsi_disable-------\n");
rk_mipi_screen_standby(1);
dsi_power_off(0);
if (rk_mipi_get_dsi_num() == 2)
dsi_power_off(1);
if (dsi0->clk_on) {
dsi0->clk_on = 0;
rk_mipi_screen_standby(1);
dsi_power_off(0);
if (rk_mipi_get_dsi_num() == 2)
dsi_power_off(1);
}
return 0;
}
@@ -1887,10 +1894,13 @@ static int rk32_mipi_dsi_probe(struct platform_device *pdev)
if (dsi->ops.id == DWC_DSI_VERSION_RK312x) {
clk_prepare_enable(dsi->dsi_host_pclk);
clk_prepare_enable(dsi->h2p_hclk);
}
} else if (dsi->ops.id == DWC_DSI_VERSION_RK3368)
clk_prepare_enable(dsi->dsi_host_pclk);
clk_prepare_enable(dsi->dsi_pd);
udelay(10);
}
dev_info(&pdev->dev, "rk mipi_dsi probe success!\n");
dev_info(&pdev->dev, "%s\n", RK_MIPI_DSI_VERSION_AND_TIME);

View File

@@ -298,6 +298,7 @@ struct dsi {
u8 dsi_id;
u8 lcdc_id;
u8 vid;
u8 clk_on;
struct dsi_phy phy;
struct dsi_host host;
struct mipi_dsi_ops ops;
@@ -308,7 +309,7 @@ struct dsi {
struct clk *h2p_hclk;
struct clk *dsi_pd;
#endif
struct dentry *debugfs_dir;
struct dentry *debugfs_dir;
struct platform_device *pdev;
};