diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2015-03-08 11:40:47 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-02 18:11:43 -0300 |
commit | 116a6488d32ac62336b9c1a1dd989fdbfab128bd (patch) | |
tree | acbf6d7b0b30a236e1ec98a9e9433240b786970f /drivers/media/platform | |
parent | fe00b716e75f78cb9f90328b6a5f18cc88089050 (diff) | |
download | blackbird-op-linux-116a6488d32ac62336b9c1a1dd989fdbfab128bd.tar.gz blackbird-op-linux-116a6488d32ac62336b9c1a1dd989fdbfab128bd.zip |
[media] media: blackfin: bfin_capture: return -ENODATA for *dv_timings calls
this patch adds support to return -ENODATA for *dv_timings calls
if the current output does not support it.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@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/platform')
-rw-r--r-- | drivers/media/platform/blackfin/bfin_capture.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index f97d94d9e778..2dead84b2d7a 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c @@ -487,6 +487,11 @@ static int bcap_enum_dv_timings(struct file *file, void *priv, struct v4l2_enum_dv_timings *timings) { struct bcap_device *bcap_dev = video_drvdata(file); + struct v4l2_input input; + + input = bcap_dev->cfg->inputs[bcap_dev->cur_input]; + if (!(input.capabilities & V4L2_IN_CAP_DV_TIMINGS)) + return -ENODATA; timings->pad = 0; @@ -498,6 +503,11 @@ static int bcap_query_dv_timings(struct file *file, void *priv, struct v4l2_dv_timings *timings) { struct bcap_device *bcap_dev = video_drvdata(file); + struct v4l2_input input; + + input = bcap_dev->cfg->inputs[bcap_dev->cur_input]; + if (!(input.capabilities & V4L2_IN_CAP_DV_TIMINGS)) + return -ENODATA; return v4l2_subdev_call(bcap_dev->sd, video, query_dv_timings, timings); @@ -507,6 +517,11 @@ static int bcap_g_dv_timings(struct file *file, void *priv, struct v4l2_dv_timings *timings) { struct bcap_device *bcap_dev = video_drvdata(file); + struct v4l2_input input; + + input = bcap_dev->cfg->inputs[bcap_dev->cur_input]; + if (!(input.capabilities & V4L2_IN_CAP_DV_TIMINGS)) + return -ENODATA; *timings = bcap_dev->dv_timings; return 0; @@ -516,7 +531,13 @@ static int bcap_s_dv_timings(struct file *file, void *priv, struct v4l2_dv_timings *timings) { struct bcap_device *bcap_dev = video_drvdata(file); + struct v4l2_input input; int ret; + + input = bcap_dev->cfg->inputs[bcap_dev->cur_input]; + if (!(input.capabilities & V4L2_IN_CAP_DV_TIMINGS)) + return -ENODATA; + if (vb2_is_busy(&bcap_dev->buffer_queue)) return -EBUSY; |