diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-04-22 15:03:38 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-04-25 13:09:29 +0200 |
commit | 7b9f31f3b3cab9bc367ba4da45af129ff858ce52 (patch) | |
tree | b07eee2fd392a8af2b1c4b51ea46d8bda21269d5 /drivers/media/pci | |
parent | [media] adv7180: fix broken standards handling (diff) | |
download | linux-7b9f31f3b3cab9bc367ba4da45af129ff858ce52.tar.xz linux-7b9f31f3b3cab9bc367ba4da45af129ff858ce52.zip |
[media] sta2x11_vip: fix s_std
The s_std ioctl was broken in this driver, partially due to the
changes to the adv7180 driver (this affected the handling of
V4L2_STD_ALL) and partially because the new standard was never
stored in vip->std.
The handling of V4L2_STD_ALL has been rewritten to just call querystd
and the new standard is now stored correctly.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/sta2x11/sta2x11_vip.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c index 753411cbbc9a..c79623ca5fc3 100644 --- a/drivers/media/pci/sta2x11/sta2x11_vip.c +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c @@ -444,27 +444,21 @@ static int vidioc_querycap(struct file *file, void *priv, static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id std) { struct sta2x11_vip *vip = video_drvdata(file); - v4l2_std_id oldstd = vip->std, newstd; + v4l2_std_id oldstd = vip->std; int status; - if (V4L2_STD_ALL == std) { - v4l2_subdev_call(vip->decoder, video, s_std, std); - ssleep(2); - v4l2_subdev_call(vip->decoder, video, querystd, &newstd); - v4l2_subdev_call(vip->decoder, video, g_input_status, &status); - if (status & V4L2_IN_ST_NO_SIGNAL) + /* + * This is here for backwards compatibility only. + * The use of V4L2_STD_ALL to trigger a querystd is non-standard. + */ + if (std == V4L2_STD_ALL) { + v4l2_subdev_call(vip->decoder, video, querystd, &std); + if (std == V4L2_STD_UNKNOWN) return -EIO; - std = vip->std = newstd; - if (oldstd != std) { - if (V4L2_STD_525_60 & std) - vip->format = formats_60[0]; - else - vip->format = formats_50[0]; - } - return 0; } - if (oldstd != std) { + if (vip->std != std) { + vip->std = std; if (V4L2_STD_525_60 & std) vip->format = formats_60[0]; else |