From 863981e96738983919de841ec669e157e6bdaeb0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sun, 11 Sep 2016 04:34:46 -0300 Subject: Linux-libre 4.7.1-gnu --- drivers/media/pci/sta2x11/sta2x11_vip.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'drivers/media/pci/sta2x11') diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c index 753411cbb..1fc195f89 100644 --- a/drivers/media/pci/sta2x11/sta2x11_vip.c +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c @@ -444,27 +444,19 @@ 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; - 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 -- cgit v1.2.3-54-g00ecf