aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/omap2/dss/dispc-compat.c30
-rw-r--r--drivers/video/omap2/dss/dispc-compat.h3
-rw-r--r--drivers/video/omap2/dss/dispc.c57
-rw-r--r--include/video/omapdss.h4
4 files changed, 33 insertions, 61 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
208int 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}
diff --git a/drivers/video/omap2/dss/dispc-compat.h b/drivers/video/omap2/dss/dispc-compat.h
index 2d4f5e77a7bf..8322d43d28c3 100644
--- a/drivers/video/omap2/dss/dispc-compat.h
+++ b/drivers/video/omap2/dss/dispc-compat.h
@@ -21,4 +21,7 @@
21void dispc_mgr_enable_sync(enum omap_channel channel); 21void dispc_mgr_enable_sync(enum omap_channel channel);
22void dispc_mgr_disable_sync(enum omap_channel channel); 22void dispc_mgr_disable_sync(enum omap_channel channel);
23 23
24int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
25 unsigned long timeout);
26
24#endif 27#endif
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 73972e99ec63..f7c734214022 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3750,63 +3750,6 @@ static void dispc_error_worker(struct work_struct *work)
3750 dispc_runtime_put(); 3750 dispc_runtime_put();
3751} 3751}
3752 3752
3753int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout)
3754{
3755 void dispc_irq_wait_handler(void *data, u32 mask)
3756 {
3757 complete((struct completion *)data);
3758 }
3759
3760 int r;
3761 DECLARE_COMPLETION_ONSTACK(completion);
3762
3763 r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
3764 irqmask);
3765
3766 if (r)
3767 return r;
3768
3769 timeout = wait_for_completion_timeout(&completion, timeout);
3770
3771 omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
3772
3773 if (timeout == 0)
3774 return -ETIMEDOUT;
3775
3776 return 0;
3777}
3778
3779int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
3780 unsigned long timeout)
3781{
3782 void dispc_irq_wait_handler(void *data, u32 mask)
3783 {
3784 complete((struct completion *)data);
3785 }
3786
3787 int r;
3788 DECLARE_COMPLETION_ONSTACK(completion);
3789
3790 r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
3791 irqmask);
3792
3793 if (r)
3794 return r;
3795
3796 timeout = wait_for_completion_interruptible_timeout(&completion,
3797 timeout);
3798
3799 omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
3800
3801 if (timeout == 0)
3802 return -ETIMEDOUT;
3803
3804 if (timeout == -ERESTARTSYS)
3805 return -ERESTARTSYS;
3806
3807 return 0;
3808}
3809
3810static void _omap_dispc_initialize_irq(void) 3753static void _omap_dispc_initialize_irq(void)
3811{ 3754{
3812 unsigned long flags; 3755 unsigned long flags;
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index a9402362d817..823a07b00fe5 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -775,10 +775,6 @@ typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
775int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); 775int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
776int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask); 776int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
777 777
778int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout);
779int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
780 unsigned long timeout);
781
782#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) 778#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
783#define to_dss_device(x) container_of((x), struct omap_dss_device, dev) 779#define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
784 780