diff options
Diffstat (limited to 'drivers/video/omap2/dss/dispc-compat.c')
-rw-r--r-- | drivers/video/omap2/dss/dispc-compat.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dispc-compat.c b/drivers/video/omap2/dss/dispc-compat.c index cca38488ab27..24e1d5e974eb 100644 --- a/drivers/video/omap2/dss/dispc-compat.c +++ b/drivers/video/omap2/dss/dispc-compat.c | |||
@@ -205,3 +205,33 @@ void dispc_mgr_disable_sync(enum omap_channel channel) | |||
205 | WARN_ON(1); | 205 | WARN_ON(1); |
206 | } | 206 | } |
207 | 207 | ||
208 | int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, | ||
209 | unsigned long timeout) | ||
210 | { | ||
211 | void dispc_irq_wait_handler(void *data, u32 mask) | ||
212 | { | ||
213 | complete((struct completion *)data); | ||
214 | } | ||
215 | |||
216 | int r; | ||
217 | DECLARE_COMPLETION_ONSTACK(completion); | ||
218 | |||
219 | r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion, | ||
220 | irqmask); | ||
221 | |||
222 | if (r) | ||
223 | return r; | ||
224 | |||
225 | timeout = wait_for_completion_interruptible_timeout(&completion, | ||
226 | timeout); | ||
227 | |||
228 | omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask); | ||
229 | |||
230 | if (timeout == 0) | ||
231 | return -ETIMEDOUT; | ||
232 | |||
233 | if (timeout == -ERESTARTSYS) | ||
234 | return -ERESTARTSYS; | ||
235 | |||
236 | return 0; | ||
237 | } | ||