summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-10-28 11:47:30 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-01-13 12:19:52 +0200
commit91b53e6a96aa9a6d06f55abfc52440945fc1d82e (patch)
treee9b110600fe9fef84df659e3a032886ef1e6e02e /drivers/video
parentbe07dcd7e239a854ae92041b3eb17863062e52e4 (diff)
downloadop-kernel-dev-91b53e6a96aa9a6d06f55abfc52440945fc1d82e.zip
op-kernel-dev-91b53e6a96aa9a6d06f55abfc52440945fc1d82e.tar.gz
OMAPDSS: HDMI: fix hdmi_wait_for_bit_change
hdmi_wait_for_bit_change() has two issues: The register index was passed as u16, even if the register index may be u32. Fix the index to u32. The function was copied from wait_for_bit_change() which waits for a single bit to change, but the hdmi version was changed to wait for a bit field. This change was not done correctly. The function is supposed to return the (last) value of the bit field, but it returned !val in case of timeout. This was correct for the single bit version, but not for the hdmi version. Fix the function to return the actual value in the register. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/hdmi.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/video/omap2/dss/hdmi.h b/drivers/video/omap2/dss/hdmi.h
index b049376..855b6b0 100644
--- a/drivers/video/omap2/dss/hdmi.h
+++ b/drivers/video/omap2/dss/hdmi.h
@@ -378,15 +378,15 @@ static inline u32 hdmi_read_reg(void __iomem *base_addr, const u16 idx)
FLD_GET(hdmi_read_reg(base, idx), start, end)
static inline int hdmi_wait_for_bit_change(void __iomem *base_addr,
- const u16 idx, int b2, int b1, u32 val)
+ const u32 idx, int b2, int b1, u32 val)
{
- u32 t = 0;
- while (val != REG_GET(base_addr, idx, b2, b1)) {
- udelay(1);
+ u32 t = 0, v;
+ while (val != (v = REG_GET(base_addr, idx, b2, b1))) {
if (t++ > 10000)
- return !val;
+ return v;
+ udelay(1);
}
- return val;
+ return v;
}
/* HDMI wrapper funcs */
OpenPOWER on IntegriCloud