diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2014-05-16 09:33:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-24 15:44:07 -0400 |
commit | d557b7d549de48e28f45214fbd51c7344a6e75ac (patch) | |
tree | 6209af0e61651ae79f80107c2a53f90df49408b3 /drivers/media/platform/davinci | |
parent | 1e8852af358d2c7f01b8ca5b7af40716f0017e69 (diff) |
[media] media: davinci: vpif_capture: 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/media/platform/davinci')
-rw-r--r-- | drivers/media/platform/davinci/vpif_capture.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 54343a3c7b73..7b53182eb069 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c | |||
@@ -887,11 +887,22 @@ static int vpif_querystd(struct file *file, void *priv, v4l2_std_id *std_id) | |||
887 | */ | 887 | */ |
888 | static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std) | 888 | static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std) |
889 | { | 889 | { |
890 | struct vpif_capture_config *config = vpif_dev->platform_data; | ||
890 | struct video_device *vdev = video_devdata(file); | 891 | struct video_device *vdev = video_devdata(file); |
891 | struct channel_obj *ch = video_get_drvdata(vdev); | 892 | struct channel_obj *ch = video_get_drvdata(vdev); |
893 | struct vpif_capture_chan_config *chan_cfg; | ||
894 | struct v4l2_input input; | ||
892 | 895 | ||
893 | vpif_dbg(2, debug, "vpif_g_std\n"); | 896 | vpif_dbg(2, debug, "vpif_g_std\n"); |
894 | 897 | ||
898 | if (config->chan_config[ch->channel_id].inputs == NULL) | ||
899 | return -ENODATA; | ||
900 | |||
901 | chan_cfg = &config->chan_config[ch->channel_id]; | ||
902 | input = chan_cfg->inputs[ch->input_idx].input; | ||
903 | if (input.capabilities != V4L2_IN_CAP_STD) | ||
904 | return -ENODATA; | ||
905 | |||
895 | *std = ch->video.stdid; | 906 | *std = ch->video.stdid; |
896 | return 0; | 907 | return 0; |
897 | } | 908 | } |
@@ -904,13 +915,24 @@ static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std) | |||
904 | */ | 915 | */ |
905 | static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) | 916 | static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) |
906 | { | 917 | { |
918 | struct vpif_capture_config *config = vpif_dev->platform_data; | ||
907 | struct video_device *vdev = video_devdata(file); | 919 | struct video_device *vdev = video_devdata(file); |
908 | struct channel_obj *ch = video_get_drvdata(vdev); | 920 | struct channel_obj *ch = video_get_drvdata(vdev); |
909 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; | 921 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; |
910 | int ret = 0; | 922 | struct vpif_capture_chan_config *chan_cfg; |
923 | struct v4l2_input input; | ||
924 | int ret; | ||
911 | 925 | ||
912 | vpif_dbg(2, debug, "vpif_s_std\n"); | 926 | vpif_dbg(2, debug, "vpif_s_std\n"); |
913 | 927 | ||
928 | if (config->chan_config[ch->channel_id].inputs == NULL) | ||
929 | return -ENODATA; | ||
930 | |||
931 | chan_cfg = &config->chan_config[ch->channel_id]; | ||
932 | input = chan_cfg->inputs[ch->input_idx].input; | ||
933 | if (input.capabilities != V4L2_IN_CAP_STD) | ||
934 | return -ENODATA; | ||
935 | |||
914 | if (vb2_is_busy(&common->buffer_queue)) | 936 | if (vb2_is_busy(&common->buffer_queue)) |
915 | return -EBUSY; | 937 | return -EBUSY; |
916 | 938 | ||