mirror of https://gitee.com/openkylin/linux.git
[media] media: blackfin: bfin_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> 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>
This commit is contained in:
parent
2bf34b2f09
commit
fe00b716e7
|
@ -440,6 +440,11 @@ static irqreturn_t bcap_isr(int irq, void *dev_id)
|
|||
static int bcap_querystd(struct file *file, void *priv, v4l2_std_id *std)
|
||||
{
|
||||
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_STD))
|
||||
return -ENODATA;
|
||||
|
||||
return v4l2_subdev_call(bcap_dev->sd, video, querystd, std);
|
||||
}
|
||||
|
@ -447,6 +452,11 @@ static int bcap_querystd(struct file *file, void *priv, v4l2_std_id *std)
|
|||
static int bcap_g_std(struct file *file, void *priv, v4l2_std_id *std)
|
||||
{
|
||||
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_STD))
|
||||
return -ENODATA;
|
||||
|
||||
*std = bcap_dev->std;
|
||||
return 0;
|
||||
|
@ -455,8 +465,13 @@ static int bcap_g_std(struct file *file, void *priv, v4l2_std_id *std)
|
|||
static int bcap_s_std(struct file *file, void *priv, v4l2_std_id std)
|
||||
{
|
||||
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_STD))
|
||||
return -ENODATA;
|
||||
|
||||
if (vb2_is_busy(&bcap_dev->buffer_queue))
|
||||
return -EBUSY;
|
||||
|
||||
|
|
Loading…
Reference in New Issue