aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-06-08 22:17:00 -0400
committerDave Airlie <airlied@redhat.com>2017-06-08 22:17:00 -0400
commit97f607fe0d4e8c49e4ee3251bda853f7b6aa75d0 (patch)
treec223d532b6dd5b414867ec91cd1a4853878e7e58
parentdd44c95739dffafac0e52076dd750911180295d4 (diff)
parent014580ffab654bb83256783a2b185cf6c06dffaa (diff)
Merge branch 'mediatek-drm-fixes-4.12-rc1' of https://github.com/ckhu-mediatek/linux.git-tags into drm-fixes
mediatek fixes * 'mediatek-drm-fixes-4.12-rc1' of https://github.com/ckhu-mediatek/linux.git-tags: drm/mediatek: fix mtk_hdmi_setup_vendor_specific_infoframe mistake drm/mediatek: fix a timeout loop
-rw-r--r--drivers/gpu/drm/mediatek/mtk_dsi.c15
-rw-r--r--drivers/gpu/drm/mediatek/mtk_hdmi.c2
2 files changed, 7 insertions, 10 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 @@
19#include <drm/drm_of.h> 19#include <drm/drm_of.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/component.h> 21#include <linux/component.h>
22#include <linux/iopoll.h>
22#include <linux/irq.h> 23#include <linux/irq.h>
23#include <linux/of.h> 24#include <linux/of.h>
24#include <linux/of_platform.h> 25#include <linux/of_platform.h>
@@ -900,16 +901,12 @@ static int mtk_dsi_host_detach(struct mipi_dsi_host *host,
900 901
901static void mtk_dsi_wait_for_idle(struct mtk_dsi *dsi) 902static void mtk_dsi_wait_for_idle(struct mtk_dsi *dsi)
902{ 903{
903 u32 timeout_ms = 500000; /* total 1s ~ 2s timeout */ 904 int ret;
904 905 u32 val;
905 while (timeout_ms--) {
906 if (!(readl(dsi->regs + DSI_INTSTA) & DSI_BUSY))
907 break;
908
909 usleep_range(2, 4);
910 }
911 906
912 if (timeout_ms == 0) { 907 ret = readl_poll_timeout(dsi->regs + DSI_INTSTA, val, !(val & DSI_BUSY),
908 4, 2000000);
909 if (ret) {
913 DRM_WARN("polling dsi wait not busy timeout!\n"); 910 DRM_WARN("polling dsi wait not busy timeout!\n");
914 911
915 mtk_dsi_enable(dsi); 912 mtk_dsi_enable(dsi);
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 41a1c03b0347..0a4ffd724146 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -1062,7 +1062,7 @@ static int mtk_hdmi_setup_vendor_specific_infoframe(struct mtk_hdmi *hdmi,
1062 } 1062 }
1063 1063
1064 err = hdmi_vendor_infoframe_pack(&frame, buffer, sizeof(buffer)); 1064 err = hdmi_vendor_infoframe_pack(&frame, buffer, sizeof(buffer));
1065 if (err) { 1065 if (err < 0) {
1066 dev_err(hdmi->dev, "Failed to pack vendor infoframe: %zd\n", 1066 dev_err(hdmi->dev, "Failed to pack vendor infoframe: %zd\n",
1067 err); 1067 err);
1068 return err; 1068 return err;