diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2014-05-16 10:33:28 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-23 19:16:19 -0300 |
commit | f27d0f459fe55757ffb4ae521402a2428184ecfb (patch) | |
tree | e8e4959c2c8ce44e1d5248d75b7023adee99db1c /drivers | |
parent | 1093c5905d93b9814cf80636bf2f81d2944772b5 (diff) | |
download | op-kernel-dev-f27d0f459fe55757ffb4ae521402a2428184ecfb.zip op-kernel-dev-f27d0f459fe55757ffb4ae521402a2428184ecfb.tar.gz |
[media] media: davinci: vpif_display: return -ENODATA for *std calls
this patch adds supports to return -ENODATA to *std calls
if the selected output does not support it.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/platform/davinci/vpif_display.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index f51b5be..f581e7a 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -715,14 +715,26 @@ static int vpif_try_fmt_vid_out(struct file *file, void *priv, static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) { + struct vpif_display_config *config = vpif_dev->platform_data; struct video_device *vdev = video_devdata(file); struct channel_obj *ch = video_get_drvdata(vdev); struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; - int ret = 0; + struct vpif_display_chan_config *chan_cfg; + struct v4l2_output output; + int ret; + + if (config->chan_config[ch->channel_id].outputs == NULL) + return -ENODATA; + + chan_cfg = &config->chan_config[ch->channel_id]; + output = chan_cfg->outputs[ch->output_idx].output; + if (output.capabilities != V4L2_OUT_CAP_STD) + return -ENODATA; if (vb2_is_busy(&common->buffer_queue)) return -EBUSY; + if (!(std_id & VPIF_V4L2_STD)) return -EINVAL; @@ -754,8 +766,19 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std) { + struct vpif_display_config *config = vpif_dev->platform_data; struct video_device *vdev = video_devdata(file); struct channel_obj *ch = video_get_drvdata(vdev); + struct vpif_display_chan_config *chan_cfg; + struct v4l2_output output; + + if (config->chan_config[ch->channel_id].outputs == NULL) + return -ENODATA; + + chan_cfg = &config->chan_config[ch->channel_id]; + output = chan_cfg->outputs[ch->output_idx].output; + if (output.capabilities != V4L2_OUT_CAP_STD) + return -ENODATA; *std = ch->video.stdid; return 0; |