aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-irq.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-03-27 13:10:13 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:58:08 -0400
commit092501936fc128992456a086193746cf34642815 (patch)
tree6a6910b3fd4f9a1304adfb5af1a4e7a96085960d /drivers/media/video/ivtv/ivtv-irq.c
parent1bcaf4bd53872e70c4fceec6bbb76044325f337f (diff)
V4L/DVB: ivtv: support the new events API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-irq.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-irq.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c
index dbd46c5d6975..fea1ec33b0df 100644
--- a/drivers/media/video/ivtv/ivtv-irq.c
+++ b/drivers/media/video/ivtv/ivtv-irq.c
@@ -25,6 +25,7 @@
25#include "ivtv-mailbox.h" 25#include "ivtv-mailbox.h"
26#include "ivtv-vbi.h" 26#include "ivtv-vbi.h"
27#include "ivtv-yuv.h" 27#include "ivtv-yuv.h"
28#include <media/v4l2-event.h>
28 29
29#define DMA_MAGIC_COOKIE 0x000001fe 30#define DMA_MAGIC_COOKIE 0x000001fe
30 31
@@ -778,6 +779,14 @@ static void ivtv_irq_vsync(struct ivtv *itv)
778 } 779 }
779 } 780 }
780 if (frame != (itv->last_vsync_field & 1)) { 781 if (frame != (itv->last_vsync_field & 1)) {
782 static const struct v4l2_event evtop = {
783 .type = V4L2_EVENT_VSYNC,
784 .u.vsync.field = V4L2_FIELD_TOP,
785 };
786 static const struct v4l2_event evbottom = {
787 .type = V4L2_EVENT_VSYNC,
788 .u.vsync.field = V4L2_FIELD_BOTTOM,
789 };
781 struct ivtv_stream *s = ivtv_get_output_stream(itv); 790 struct ivtv_stream *s = ivtv_get_output_stream(itv);
782 791
783 itv->last_vsync_field += 1; 792 itv->last_vsync_field += 1;
@@ -791,10 +800,12 @@ static void ivtv_irq_vsync(struct ivtv *itv)
791 if (test_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags)) { 800 if (test_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags)) {
792 set_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags); 801 set_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags);
793 wake_up(&itv->event_waitq); 802 wake_up(&itv->event_waitq);
803 if (s)
804 wake_up(&s->waitq);
794 } 805 }
806 if (s && s->vdev)
807 v4l2_event_queue(s->vdev, frame ? &evtop : &evbottom);
795 wake_up(&itv->vsync_waitq); 808 wake_up(&itv->vsync_waitq);
796 if (s)
797 wake_up(&s->waitq);
798 809
799 /* Send VBI to saa7127 */ 810 /* Send VBI to saa7127 */
800 if (frame && (itv->output_mode == OUT_PASSTHROUGH || 811 if (frame && (itv->output_mode == OUT_PASSTHROUGH ||