summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2013-06-23 12:26:37 +0100
committerRussell King <rmk@arm.linux.org.uk>2013-06-23 12:26:37 +0100
commita2643f5dc00f96b5370d721215bec309013c4e0b (patch)
treedb7de40393b7d4640f0ff3dc6107f25150368f57
parentd33ca77beb2abc7ef012570044c7a471a6544f3b (diff)
Clean up vmeta IRQ control
Rather than having two functions, one to enable and another to disable, we can combine the two and take an argument to indicate what action is required. As these aren't part of the library API, we're free to make this change.
-rw-r--r--vmeta_lib.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/vmeta_lib.c b/vmeta_lib.c
index c483754..6959a1f 100644
--- a/vmeta_lib.c
+++ b/vmeta_lib.c
@@ -261,24 +261,13 @@ static int vmeta_ioctl_ulong(unsigned cmd, unsigned long arg)
return ioctl(vdec->fd, cmd, arg);
}
-// enable vmeta interrupt
-static void vdec_os_api_irq_enable(void)
+// control vmeta interrupt
+static void vdec_os_api_irq_ctrl(int state)
{
vdec_os_driver_cb_t *vdec = vdec_iface;
- int irq_on = 1;
- write(vdec->fd, &irq_on, sizeof(int));
+ write(vdec->fd, &state, sizeof(state));
}
-#if 0 // Not used
-// disable vmeta interrupt
-static void vdec_os_api_irq_disable(void)
-{
- vdec_os_driver_cb_t *vdec = vdec_iface;
- int irq_on = 0;
- write(vdec->fd, &irq_on, sizeof(int));
-}
-#endif
-
SIGN32 vdec_os_api_set_sync_timeout_isr(UNSG32 timeout)
{
syncTimeout = timeout;
@@ -294,7 +283,7 @@ SIGN32 vdec_os_api_sync_event()
ufds.fd = vdec->fd;
ufds.events = POLLIN;
- vdec_os_api_irq_enable();
+ vdec_os_api_irq_ctrl(1);
result = poll(&ufds, 1, syncTimeout);
if(result > 0)
return VDEC_OS_DRIVER_OK;