From b4921efb66c467960e549d43809fefd666b58e1f Mon Sep 17 00:00:00 2001 From: Hoegeun Kwon Date: Mon, 18 Feb 2019 14:40:49 +0900 Subject: [PATCH] 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 --- drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; } -- 2.7.4