diff options
author | Jimmy Rubin <jimmy.rubin@stericsson.com> | 2011-09-29 07:31:01 +0200 |
---|---|---|
committer | Jonas ABERG <jonas.aberg@stericsson.com> | 2011-10-11 07:56:19 +0200 |
commit | 0e3e5a025588ae5b428dbb384aba0a7508c74b4d (patch) | |
tree | c50ecf41fa68c6c28f94a12ec73dc54f83de5b99 /drivers/video/mcde | |
parent | 53df4634cc20677cd638b13b43560599f00f03c7 (diff) |
video: mcde: Handle ACKNOWLEDGE_WITH_ERR in read
If an DCS read command is sent to the panel.
The panel can aknowledge the command with an error.
In this case the read command is resent to the panel.
ST-Ericsson ID: 321190
ST-Ericsson Linux Next: NA
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I7c2d472cbf7acb9cbf880d162f3e20ab07c86398
Signed-off-by: Jimmy Rubin <jimmy.rubin@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32594
Reviewed-by: Marcus LORENTZON <marcus.xm.lorentzon@stericsson.com>
Diffstat (limited to 'drivers/video/mcde')
-rw-r--r-- | drivers/video/mcde/mcde_hw.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/video/mcde/mcde_hw.c b/drivers/video/mcde/mcde_hw.c index c9b4a9f3165..97c10612663 100644 --- a/drivers/video/mcde/mcde_hw.c +++ b/drivers/video/mcde/mcde_hw.c @@ -86,6 +86,7 @@ static void wait_for_flow_disabled(struct mcde_chnl_state *chnl); #define DSI_READ_TIMEOUT 200 #define DSI_WRITE_CMD_TIMEOUT 1000 #define DSI_READ_DELAY 5 +#define DSI_READ_NBR_OF_RETRIES 2 #define MCDE_FLOWEN_MAX_TRIAL 60 static u8 *mcdeio; @@ -2224,8 +2225,9 @@ int mcde_dsi_dcs_read(struct mcde_chnl_state *chnl, u8 link = chnl->port.link; u8 virt_id = chnl->port.phy.dsi.virt_id; u32 settings; - int wait = 100; - bool error, ok; + bool ok = false; + bool error, ack_with_err; + u8 nbr_of_retries = DSI_READ_NBR_OF_RETRIES; if (*len > MCDE_MAX_DCS_READ || chnl->port.type != MCDE_PORTTYPE_DSI) return -EINVAL; @@ -2252,15 +2254,26 @@ int mcde_dsi_dcs_read(struct mcde_chnl_state *chnl, DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_ENUM(DCS_READ); dsi_wreg(link, DSI_DIRECT_CMD_MAIN_SETTINGS, settings); dsi_wreg(link, DSI_DIRECT_CMD_WRDAT0, cmd); - dsi_wreg(link, DSI_DIRECT_CMD_STS_CLR, ~0); - dsi_wreg(link, DSI_DIRECT_CMD_RD_STS_CLR, ~0); - dsi_wreg(link, DSI_DIRECT_CMD_SEND, true); - /* TODO */ - while (wait-- && !(error = dsi_rfld(link, DSI_DIRECT_CMD_STS, - READ_COMPLETED_WITH_ERR)) && !(ok = dsi_rfld(link, - DSI_DIRECT_CMD_STS, READ_COMPLETED))) - mdelay(10); + do { + u8 wait = DSI_READ_TIMEOUT; + dsi_wreg(link, DSI_DIRECT_CMD_STS_CLR, ~0); + dsi_wreg(link, DSI_DIRECT_CMD_RD_STS_CLR, ~0); + dsi_wreg(link, DSI_DIRECT_CMD_SEND, true); + + while (wait-- && !(error = dsi_rfld(link, DSI_DIRECT_CMD_STS, + READ_COMPLETED_WITH_ERR)) && + !(ok = dsi_rfld(link, DSI_DIRECT_CMD_STS, + READ_COMPLETED))) + udelay(DSI_READ_DELAY); + + ack_with_err = dsi_rfld(link, DSI_DIRECT_CMD_STS, + ACKNOWLEDGE_WITH_ERR_RECEIVED); + if (ack_with_err) + dev_warn(&mcde_dev->dev, + "DCS Acknowledge Error Report %.4X\n", + dsi_rfld(link, DSI_DIRECT_CMD_STS, ACK_VAL)); + } while (--nbr_of_retries && ack_with_err); if (ok) { int rdsize; |