V4L/DVB (12325): Implement changing resolution on the fly for zr364xx driver
[safe/jmp/linux-2.6] / drivers / media / video / v4l1-compat.c
index d450cab..02f2a6d 100644 (file)
@@ -203,7 +203,6 @@ static int poll_one(struct file *file, struct poll_wqueues *pwq)
        table = &pwq->pt;
        for (;;) {
                int mask;
-               set_current_state(TASK_INTERRUPTIBLE);
                mask = file->f_op->poll(file, table);
                if (mask & POLLIN)
                        break;
@@ -212,9 +211,8 @@ static int poll_one(struct file *file, struct poll_wqueues *pwq)
                        retval = -ERESTARTSYS;
                        break;
                }
-               schedule();
+               poll_schedule(pwq, TASK_INTERRUPTIBLE);
        }
-       set_current_state(TASK_RUNNING);
        poll_freewait(pwq);
        return retval;
 }
@@ -577,6 +575,8 @@ static noinline long v4l1_compat_get_input_info(
                        chan->norm = VIDEO_MODE_NTSC;
                if (sid & V4L2_STD_SECAM)
                        chan->norm = VIDEO_MODE_SECAM;
+               if (sid == V4L2_STD_ALL)
+                       chan->norm = VIDEO_MODE_AUTO;
        }
 done:
        return err;
@@ -603,6 +603,9 @@ static noinline long v4l1_compat_set_input(
        case VIDEO_MODE_SECAM:
                sid = V4L2_STD_SECAM;
                break;
+       case VIDEO_MODE_AUTO:
+               sid = V4L2_STD_ALL;
+               break;
        }
        if (0 != sid) {
                err = drv(file, VIDIOC_S_STD, &sid);
@@ -806,9 +809,9 @@ static noinline long v4l1_compat_select_tuner(
 
        t.index = tun->tuner;
 
-       err = drv(file, VIDIOC_S_INPUT, &t);
+       err = drv(file, VIDIOC_S_TUNER, &t);
        if (err < 0)
-               dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %ld\n", err);
+               dprintk("VIDIOCSTUNER / VIDIOC_S_TUNER: %ld\n", err);
        return err;
 }