Skip to content

Commit 6d82179

Browse files
xubilvrkhuangtao
authored andcommitted
drm/rockchip: dw-mipi-dsi: only request HS clock when required
Requesting the HS clock from the PHY before we initialize it causes an invalid signal to be sent out since the input clock is not yet configured. The PHY databook suggests only asserting this signal when performing HS transfers, so let's do that. Change-Id: I7006f81d8c620dc84e84f99383c7b5414d6ac12d Signed-off-by: xubilv <xbl@rock-chips.com>
1 parent f797759 commit 6d82179

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/gpu/drm/rockchip/dw-mipi-dsi.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ static int dw_mipi_dsi_phy_init(struct dw_mipi_dsi *dsi)
515515
dsi_write(dsi, DSI_PHY_RSTZ, PHY_ENFORCEPLL | PHY_ENABLECLK |
516516
PHY_UNRSTZ | PHY_UNSHUTDOWNZ);
517517

518-
519518
ret = readx_poll_timeout(readl, dsi->base + DSI_PHY_STATUS,
520519
val, val & LOCK, 1000, PHY_STATUS_TIMEOUT_US);
521520
if (ret < 0) {
@@ -646,10 +645,13 @@ static int dw_mipi_dsi_host_detach(struct mipi_dsi_host *host,
646645

647646
static void rockchip_set_transfer_mode(struct dw_mipi_dsi *dsi, int flags)
648647
{
649-
if (flags & MIPI_DSI_MSG_USE_LPM)
648+
if (flags & MIPI_DSI_MSG_USE_LPM) {
650649
dsi_write(dsi, DSI_CMD_MODE_CFG, CMD_MODE_ALL_LP);
651-
else
650+
dsi_write(dsi, DSI_LPCLK_CTRL, 0);
651+
} else {
652652
dsi_write(dsi, DSI_CMD_MODE_CFG, 0);
653+
dsi_write(dsi, DSI_LPCLK_CTRL, PHY_TXREQUESTCLKHS);
654+
}
653655
}
654656

655657
static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
@@ -752,7 +754,6 @@ static void dw_mipi_dsi_init(struct dw_mipi_dsi *dsi)
752754
| PHY_RSTZ | PHY_SHUTDOWNZ);
753755
dsi_write(dsi, DSI_CLKMGR_CFG, TO_CLK_DIVIDSION(10) |
754756
TX_ESC_CLK_DIVIDSION(7));
755-
dsi_write(dsi, DSI_LPCLK_CTRL, PHY_TXREQUESTCLKHS);
756757
}
757758

758759
static void dw_mipi_dsi_dpi_config(struct dw_mipi_dsi *dsi,
@@ -1009,6 +1010,7 @@ static void rockchip_dsi_init(struct dw_mipi_dsi *dsi)
10091010

10101011
static void rockchip_dsi_enable(struct dw_mipi_dsi *dsi)
10111012
{
1013+
dsi_write(dsi, DSI_LPCLK_CTRL, PHY_TXREQUESTCLKHS);
10121014
dw_mipi_dsi_set_mode(dsi, DSI_VIDEO_MODE);
10131015
clk_disable_unprepare(dsi->pllref_clk);
10141016
clk_disable_unprepare(dsi->pclk);

0 commit comments

Comments
 (0)