Skip to content

Commit c15000b

Browse files
committed
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: [media] msp3400: fill in v4l2_tuner based on vt->type field [media] tuner-core.c: don't change type field in g_tuner or g_frequency [media] cx18/ivtv: fix g_tuner support [media] tuner-core: power up tuner when called with s_power(1) [media] v4l2-ioctl.c: check for valid tuner type in S_HW_FREQ_SEEK [media] tuner-core: simplify the standard fixup [media] tuner-core/v4l2-subdev: document that the type field has to be filled in [media] v4l2-subdev.h: remove unused s_mode tuner op [media] feature-removal-schedule: change in how radio device nodes are handled [media] bttv: fix s_tuner for radio [media] pvrusb2: fix g/s_tuner support [media] v4l2-ioctl.c: prefill tuner type for g_frequency and g/s_tuner [media] tuner-core: fix tuner_resume: use t->mode instead of t->type [media] tuner-core: fix s_std and s_tuner
2 parents 9ddf7f5 + ddc6ff3 commit c15000b

File tree

9 files changed

+174
-139
lines changed

9 files changed

+174
-139
lines changed

Documentation/feature-removal-schedule.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,3 +583,25 @@ Why: Superseded by the UVCIOC_CTRL_QUERY ioctl.
583583
Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
584584

585585
----------------------------
586+
587+
What: For VIDIOC_S_FREQUENCY the type field must match the device node's type.
588+
If not, return -EINVAL.
589+
When: 3.2
590+
Why: It makes no sense to switch the tuner to radio mode by calling
591+
VIDIOC_S_FREQUENCY on a video node, or to switch the tuner to tv mode by
592+
calling VIDIOC_S_FREQUENCY on a radio node. This is the first step of a
593+
move to more consistent handling of tv and radio tuners.
594+
Who: Hans Verkuil <hans.verkuil@cisco.com>
595+
596+
----------------------------
597+
598+
What: Opening a radio device node will no longer automatically switch the
599+
tuner mode from tv to radio.
600+
When: 3.3
601+
Why: Just opening a V4L device should not change the state of the hardware
602+
like that. It's very unexpected and against the V4L spec. Instead, you
603+
switch to radio mode by calling VIDIOC_S_FREQUENCY. This is the second
604+
and last step of the move to consistent handling of tv and radio tuners.
605+
Who: Hans Verkuil <hans.verkuil@cisco.com>
606+
607+
----------------------------

drivers/media/video/bt8xx/bttv-driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3474,7 +3474,7 @@ static int radio_s_tuner(struct file *file, void *priv,
34743474
if (0 != t->index)
34753475
return -EINVAL;
34763476

3477-
bttv_call_all(btv, tuner, g_tuner, t);
3477+
bttv_call_all(btv, tuner, s_tuner, t);
34783478
return 0;
34793479
}
34803480

drivers/media/video/cx18/cx18-ioctl.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,14 +695,10 @@ static int cx18_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
695695

696696
cx18_call_all(cx, tuner, g_tuner, vt);
697697

698-
if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) {
698+
if (vt->type == V4L2_TUNER_RADIO)
699699
strlcpy(vt->name, "cx18 Radio Tuner", sizeof(vt->name));
700-
vt->type = V4L2_TUNER_RADIO;
701-
} else {
700+
else
702701
strlcpy(vt->name, "cx18 TV Tuner", sizeof(vt->name));
703-
vt->type = V4L2_TUNER_ANALOG_TV;
704-
}
705-
706702
return 0;
707703
}
708704

drivers/media/video/ivtv/ivtv-ioctl.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,14 +1184,10 @@ static int ivtv_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
11841184

11851185
ivtv_call_all(itv, tuner, g_tuner, vt);
11861186

1187-
if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) {
1187+
if (vt->type == V4L2_TUNER_RADIO)
11881188
strlcpy(vt->name, "ivtv Radio Tuner", sizeof(vt->name));
1189-
vt->type = V4L2_TUNER_RADIO;
1190-
} else {
1189+
else
11911190
strlcpy(vt->name, "ivtv TV Tuner", sizeof(vt->name));
1192-
vt->type = V4L2_TUNER_ANALOG_TV;
1193-
}
1194-
11951191
return 0;
11961192
}
11971193

drivers/media/video/msp3400-driver.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,14 @@ static int msp_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
480480
struct msp_state *state = to_state(sd);
481481
struct i2c_client *client = v4l2_get_subdevdata(sd);
482482

483-
if (state->radio)
483+
if (vt->type != V4L2_TUNER_ANALOG_TV)
484484
return 0;
485-
if (state->opmode == OPMODE_AUTOSELECT)
486-
msp_detect_stereo(client);
487-
vt->audmode = state->audmode;
488-
vt->rxsubchans = state->rxsubchans;
485+
if (!state->radio) {
486+
if (state->opmode == OPMODE_AUTOSELECT)
487+
msp_detect_stereo(client);
488+
vt->rxsubchans = state->rxsubchans;
489+
}
490+
vt->audmode = state->audmode;
489491
vt->capability |= V4L2_TUNER_CAP_STEREO |
490492
V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2;
491493
return 0;

drivers/media/video/pvrusb2/pvrusb2-hdw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3046,6 +3046,8 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw)
30463046
if (hdw->input_dirty || hdw->audiomode_dirty || hdw->force_dirty) {
30473047
struct v4l2_tuner vt;
30483048
memset(&vt, 0, sizeof(vt));
3049+
vt.type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
3050+
V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
30493051
vt.audmode = hdw->audiomode_val;
30503052
v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, s_tuner, &vt);
30513053
}
@@ -5171,6 +5173,8 @@ void pvr2_hdw_status_poll(struct pvr2_hdw *hdw)
51715173
{
51725174
struct v4l2_tuner *vtp = &hdw->tuner_signal_info;
51735175
memset(vtp, 0, sizeof(*vtp));
5176+
vtp->type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
5177+
V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
51745178
hdw->tuner_signal_stale = 0;
51755179
/* Note: There apparently is no replacement for VIDIOC_CROPCAP
51765180
using v4l2-subdev - therefore we can't support that AT ALL right

0 commit comments

Comments
 (0)