[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>
This commit is contained in:
parent
1e8852af35
commit
d557b7d549
1 changed files with 23 additions and 1 deletions
|
@ -887,11 +887,22 @@ static int vpif_querystd(struct file *file, void *priv, v4l2_std_id *std_id)
|
||||||
*/
|
*/
|
||||||
static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std)
|
static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std)
|
||||||
{
|
{
|
||||||
|
struct vpif_capture_config *config = vpif_dev->platform_data;
|
||||||
struct video_device *vdev = video_devdata(file);
|
struct video_device *vdev = video_devdata(file);
|
||||||
struct channel_obj *ch = video_get_drvdata(vdev);
|
struct channel_obj *ch = video_get_drvdata(vdev);
|
||||||
|
struct vpif_capture_chan_config *chan_cfg;
|
||||||
|
struct v4l2_input input;
|
||||||
|
|
||||||
vpif_dbg(2, debug, "vpif_g_std\n");
|
vpif_dbg(2, debug, "vpif_g_std\n");
|
||||||
|
|
||||||
|
if (config->chan_config[ch->channel_id].inputs == NULL)
|
||||||
|
return -ENODATA;
|
||||||
|
|
||||||
|
chan_cfg = &config->chan_config[ch->channel_id];
|
||||||
|
input = chan_cfg->inputs[ch->input_idx].input;
|
||||||
|
if (input.capabilities != V4L2_IN_CAP_STD)
|
||||||
|
return -ENODATA;
|
||||||
|
|
||||||
*std = ch->video.stdid;
|
*std = ch->video.stdid;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -904,13 +915,24 @@ static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std)
|
||||||
*/
|
*/
|
||||||
static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id)
|
static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id)
|
||||||
{
|
{
|
||||||
|
struct vpif_capture_config *config = vpif_dev->platform_data;
|
||||||
struct video_device *vdev = video_devdata(file);
|
struct video_device *vdev = video_devdata(file);
|
||||||
struct channel_obj *ch = video_get_drvdata(vdev);
|
struct channel_obj *ch = video_get_drvdata(vdev);
|
||||||
struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
|
struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
|
||||||
int ret = 0;
|
struct vpif_capture_chan_config *chan_cfg;
|
||||||
|
struct v4l2_input input;
|
||||||
|
int ret;
|
||||||
|
|
||||||
vpif_dbg(2, debug, "vpif_s_std\n");
|
vpif_dbg(2, debug, "vpif_s_std\n");
|
||||||
|
|
||||||
|
if (config->chan_config[ch->channel_id].inputs == NULL)
|
||||||
|
return -ENODATA;
|
||||||
|
|
||||||
|
chan_cfg = &config->chan_config[ch->channel_id];
|
||||||
|
input = chan_cfg->inputs[ch->input_idx].input;
|
||||||
|
if (input.capabilities != V4L2_IN_CAP_STD)
|
||||||
|
return -ENODATA;
|
||||||
|
|
||||||
if (vb2_is_busy(&common->buffer_queue))
|
if (vb2_is_busy(&common->buffer_queue))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue