diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2014-05-16 09:33:28 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-23 18:16:19 -0400 |
commit | f27d0f459fe55757ffb4ae521402a2428184ecfb (patch) | |
tree | e8e4959c2c8ce44e1d5248d75b7023adee99db1c /drivers/media/platform/davinci | |
parent | 1093c5905d93b9814cf80636bf2f81d2944772b5 (diff) |
[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/media/platform/davinci')
-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 f51b5bed23bf..f581e7a1c279 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, | |||
715 | 715 | ||
716 | static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) | 716 | static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) |
717 | { | 717 | { |
718 | struct vpif_display_config *config = vpif_dev->platform_data; | ||
718 | struct video_device *vdev = video_devdata(file); | 719 | struct video_device *vdev = video_devdata(file); |
719 | struct channel_obj *ch = video_get_drvdata(vdev); | 720 | struct channel_obj *ch = video_get_drvdata(vdev); |
720 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; | 721 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; |
721 | int ret = 0; | 722 | struct vpif_display_chan_config *chan_cfg; |
723 | struct v4l2_output output; | ||
724 | int ret; | ||
725 | |||
726 | if (config->chan_config[ch->channel_id].outputs == NULL) | ||
727 | return -ENODATA; | ||
728 | |||
729 | chan_cfg = &config->chan_config[ch->channel_id]; | ||
730 | output = chan_cfg->outputs[ch->output_idx].output; | ||
731 | if (output.capabilities != V4L2_OUT_CAP_STD) | ||
732 | return -ENODATA; | ||
722 | 733 | ||
723 | if (vb2_is_busy(&common->buffer_queue)) | 734 | if (vb2_is_busy(&common->buffer_queue)) |
724 | return -EBUSY; | 735 | return -EBUSY; |
725 | 736 | ||
737 | |||
726 | if (!(std_id & VPIF_V4L2_STD)) | 738 | if (!(std_id & VPIF_V4L2_STD)) |
727 | return -EINVAL; | 739 | return -EINVAL; |
728 | 740 | ||
@@ -754,8 +766,19 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) | |||
754 | 766 | ||
755 | static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std) | 767 | static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std) |
756 | { | 768 | { |
769 | struct vpif_display_config *config = vpif_dev->platform_data; | ||
757 | struct video_device *vdev = video_devdata(file); | 770 | struct video_device *vdev = video_devdata(file); |
758 | struct channel_obj *ch = video_get_drvdata(vdev); | 771 | struct channel_obj *ch = video_get_drvdata(vdev); |
772 | struct vpif_display_chan_config *chan_cfg; | ||
773 | struct v4l2_output output; | ||
774 | |||
775 | if (config->chan_config[ch->channel_id].outputs == NULL) | ||
776 | return -ENODATA; | ||
777 | |||
778 | chan_cfg = &config->chan_config[ch->channel_id]; | ||
779 | output = chan_cfg->outputs[ch->output_idx].output; | ||
780 | if (output.capabilities != V4L2_OUT_CAP_STD) | ||
781 | return -ENODATA; | ||
759 | 782 | ||
760 | *std = ch->video.stdid; | 783 | *std = ch->video.stdid; |
761 | return 0; | 784 | return 0; |