From: Hoegeun Kwon Date: Mon, 18 Feb 2019 05:40:49 +0000 (+0900) Subject: drm/panel: Add error handling for write of dsi X-Git-Tag: accepted/tizen/unified/20200709.164653~196 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4921efb66c467960e549d43809fefd666b58e1f;p=platform%2Fkernel%2Flinux-rpi.git drm/panel: Add error handling for write of dsi There is a problem that dsi write timeout even when dsi interrupt is activated by adding 'ignore_lcd=1' flag to config.txt. Add error handling to write once more when timeout occurs. Change-Id: If1deb9753a02a3082e7a1ba59ee20531828447d9 Signed-off-by: Hoegeun Kwon --- diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 2aa89ea..46ec225 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -237,6 +237,7 @@ static void rpi_touchscreen_i2c_write(struct rpi_touchscreen *ts, static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val) { + int ret; u8 msg[] = { reg, reg >> 8, @@ -246,7 +247,14 @@ static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val) val >> 24, }; - mipi_dsi_generic_write(ts->dsi, msg, sizeof(msg)); + ret = mipi_dsi_generic_write(ts->dsi, msg, sizeof(msg)); + /* + * WORKAROUND: There is a problem that timeout occurs even though + * dsi interrupts occur. Add error handling to write once more + * when timeout occurs. + */ + if (ret == -ETIMEDOUT) + mipi_dsi_generic_write(ts->dsi, msg, sizeof(msg)); return 0; }