aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-10 07:03:11 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-07 10:05:56 -0500
commit549acbe7a3380dd3bd2ac71698549148ecc0d17e (patch)
treee4a01389256fafada273ad2637313fbe04b7fe32 /drivers/video
parentbb39813413db782cc77b94d55cb5d044f42079df (diff)
OMAPDSS: move omap_dispc_wait_for_irq_interruptible_timeout to dispc-compat.c
We have two functions to wait for a dispc interrupt: int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout); int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, Of these, the former is not used at all, and can be removed. The latter is only used by the compat layer, and can be moved to the compat layer code. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-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
3 files changed, 33 insertions, 57 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;