diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-04-30 04:24:33 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-08-05 09:52:01 -0400 |
commit | 9ecd96842bc6312fdb2f84b6379a6f92686e2fd0 (patch) | |
tree | b96e69d5f3317cbafe60eac2cef59a42cb2b2914 /drivers/video/omap2 | |
parent | d73701044b70924f450fc6b161d952b38b7d0182 (diff) |
OMAP: DSS2: DSI: change dsi_vc_config_l4/vp()
Change dsi_vc_config_l4/vp() to loop for the VC_BUSY flag to change, and
return an error if it fails.
Busy looping is bad, but there's no interrupt that can be used for all the
cases where VC can be busy. So the caller should first try to make sure
that the VC is not busy, if possible, and then call dsi_vc_config_l4/vp().
Most notable case when the caller cannot be sure if the VC is busy is
after frame has been sent. Usually DSI buffers have been emptied until we
need to reconfig the VC, but in some rare cases the VC can still be busy,
and this patch will handle that case.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 20291570f7a7..bbed3a13f9a4 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -1743,42 +1743,52 @@ static void dsi_vc_initial_config(int channel) | |||
1743 | dsi.vc[channel].mode = DSI_VC_MODE_L4; | 1743 | dsi.vc[channel].mode = DSI_VC_MODE_L4; |
1744 | } | 1744 | } |
1745 | 1745 | ||
1746 | static void dsi_vc_config_l4(int channel) | 1746 | static int dsi_vc_config_l4(int channel) |
1747 | { | 1747 | { |
1748 | if (dsi.vc[channel].mode == DSI_VC_MODE_L4) | 1748 | if (dsi.vc[channel].mode == DSI_VC_MODE_L4) |
1749 | return; | 1749 | return 0; |
1750 | 1750 | ||
1751 | DSSDBGF("%d", channel); | 1751 | DSSDBGF("%d", channel); |
1752 | 1752 | ||
1753 | dsi_vc_enable(channel, 0); | 1753 | dsi_vc_enable(channel, 0); |
1754 | 1754 | ||
1755 | if (REG_GET(DSI_VC_CTRL(channel), 15, 15)) /* VC_BUSY */ | 1755 | /* VC_BUSY */ |
1756 | if (wait_for_bit_change(DSI_VC_CTRL(channel), 15, 0) != 0) { | ||
1756 | DSSERR("vc(%d) busy when trying to config for L4\n", channel); | 1757 | DSSERR("vc(%d) busy when trying to config for L4\n", channel); |
1758 | return -EIO; | ||
1759 | } | ||
1757 | 1760 | ||
1758 | REG_FLD_MOD(DSI_VC_CTRL(channel), 0, 1, 1); /* SOURCE, 0 = L4 */ | 1761 | REG_FLD_MOD(DSI_VC_CTRL(channel), 0, 1, 1); /* SOURCE, 0 = L4 */ |
1759 | 1762 | ||
1760 | dsi_vc_enable(channel, 1); | 1763 | dsi_vc_enable(channel, 1); |
1761 | 1764 | ||
1762 | dsi.vc[channel].mode = DSI_VC_MODE_L4; | 1765 | dsi.vc[channel].mode = DSI_VC_MODE_L4; |
1766 | |||
1767 | return 0; | ||
1763 | } | 1768 | } |
1764 | 1769 | ||
1765 | static void dsi_vc_config_vp(int channel) | 1770 | static int dsi_vc_config_vp(int channel) |
1766 | { | 1771 | { |
1767 | if (dsi.vc[channel].mode == DSI_VC_MODE_VP) | 1772 | if (dsi.vc[channel].mode == DSI_VC_MODE_VP) |
1768 | return; | 1773 | return 0; |
1769 | 1774 | ||
1770 | DSSDBGF("%d", channel); | 1775 | DSSDBGF("%d", channel); |
1771 | 1776 | ||
1772 | dsi_vc_enable(channel, 0); | 1777 | dsi_vc_enable(channel, 0); |
1773 | 1778 | ||
1774 | if (REG_GET(DSI_VC_CTRL(channel), 15, 15)) /* VC_BUSY */ | 1779 | /* VC_BUSY */ |
1780 | if (wait_for_bit_change(DSI_VC_CTRL(channel), 15, 0) != 0) { | ||
1775 | DSSERR("vc(%d) busy when trying to config for VP\n", channel); | 1781 | DSSERR("vc(%d) busy when trying to config for VP\n", channel); |
1782 | return -EIO; | ||
1783 | } | ||
1776 | 1784 | ||
1777 | REG_FLD_MOD(DSI_VC_CTRL(channel), 1, 1, 1); /* SOURCE, 1 = video port */ | 1785 | REG_FLD_MOD(DSI_VC_CTRL(channel), 1, 1, 1); /* SOURCE, 1 = video port */ |
1778 | 1786 | ||
1779 | dsi_vc_enable(channel, 1); | 1787 | dsi_vc_enable(channel, 1); |
1780 | 1788 | ||
1781 | dsi.vc[channel].mode = DSI_VC_MODE_VP; | 1789 | dsi.vc[channel].mode = DSI_VC_MODE_VP; |
1790 | |||
1791 | return 0; | ||
1782 | } | 1792 | } |
1783 | 1793 | ||
1784 | 1794 | ||