diff options
| author | Dmitry Torokhov <[email protected]> | 2017-09-04 09:22:54 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2017-09-04 09:22:54 -0700 | 
| commit | a6cbfa1e6d38c4b3ab0ce7e3aea4bb4e744f24b8 (patch) | |
| tree | 8960e571a398b5d32e72bdb9c89ce965daa870ab /drivers/gpu/drm/mediatek/mtk_dsi.c | |
| parent | f5308d1b83eba20e69df5e0926ba7257c8dd9074 (diff) | |
| parent | 08d6ac9ee5fedd82040bc878705981b67a116a3f (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 4.14 merge window.
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_dsi.c')
| -rw-r--r-- | drivers/gpu/drm/mediatek/mtk_dsi.c | 15 | 
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 808b995a990f..b5cc6e12334c 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -19,6 +19,7 @@  #include <drm/drm_of.h>  #include <linux/clk.h>  #include <linux/component.h> +#include <linux/iopoll.h>  #include <linux/irq.h>  #include <linux/of.h>  #include <linux/of_platform.h> @@ -900,16 +901,12 @@ static int mtk_dsi_host_detach(struct mipi_dsi_host *host,  static void mtk_dsi_wait_for_idle(struct mtk_dsi *dsi)  { -	u32 timeout_ms = 500000; /* total 1s ~ 2s timeout */ - -	while (timeout_ms--) { -		if (!(readl(dsi->regs + DSI_INTSTA) & DSI_BUSY)) -			break; - -		usleep_range(2, 4); -	} +	int ret; +	u32 val; -	if (timeout_ms == 0) { +	ret = readl_poll_timeout(dsi->regs + DSI_INTSTA, val, !(val & DSI_BUSY), +				 4, 2000000); +	if (ret) {  		DRM_WARN("polling dsi wait not busy timeout!\n");  		mtk_dsi_enable(dsi);  |