]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] ivtv: add control event support
authorHans Verkuil <hans.verkuil@cisco.com>
Tue, 28 Jun 2011 13:40:42 +0000 (10:40 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:53:20 +0000 (17:53 -0300)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/ivtv/ivtv-fileops.c
drivers/media/video/ivtv/ivtv-ioctl.c

index a7f54b010a5c705e1fd0320b1f9aaaaf8ec8f7aa..353142d014460291e62c37d5f0a546cce42a15cf 100644 (file)
@@ -750,6 +750,7 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait)
        struct ivtv *itv = id->itv;
        struct ivtv_stream *s = &itv->streams[id->type];
        int eof = test_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
+       unsigned res = 0;
 
        /* Start a capture if there is none */
        if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags)) {
@@ -769,12 +770,16 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait)
        /* add stream's waitq to the poll list */
        IVTV_DEBUG_HI_FILE("Encoder poll\n");
        poll_wait(filp, &s->waitq, wait);
+       if (v4l2_event_pending(&id->fh))
+               res |= POLLPRI;
+       else
+               poll_wait(filp, &id->fh.events->wait, wait);
 
        if (s->q_full.length || s->q_io.length)
-               return POLLIN | POLLRDNORM;
+               return res | POLLIN | POLLRDNORM;
        if (eof)
-               return POLLHUP;
-       return 0;
+               return res | POLLHUP;
+       return res;
 }
 
 void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end)
index 707399893de1a9d4554ff11cd2a26d8219596227..ff75d07097b2bc8126acea9160f0b110f18028db 100644 (file)
@@ -1451,6 +1451,8 @@ static int ivtv_subscribe_event(struct v4l2_fh *fh, struct v4l2_event_subscripti
        case V4L2_EVENT_VSYNC:
        case V4L2_EVENT_EOS:
                break;
+       case V4L2_EVENT_CTRL:
+               return v4l2_ctrl_subscribe_fh(fh, sub, 0);
        default:
                return -EINVAL;
        }