Commit f9cc70bf authored by Prabhakar Lad's avatar Prabhakar Lad Committed by Mauro Carvalho Chehab

[media] media: davinci: vpbe: return -ENODATA for *dv_timings/*_std calls

this patch adds support for returning -ENODATA if the current
output doesn't support it.
Signed-off-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent a8afe381
...@@ -341,7 +341,7 @@ static int vpbe_s_dv_timings(struct vpbe_device *vpbe_dev, ...@@ -341,7 +341,7 @@ static int vpbe_s_dv_timings(struct vpbe_device *vpbe_dev,
if (!(cfg->outputs[out_index].output.capabilities & if (!(cfg->outputs[out_index].output.capabilities &
V4L2_OUT_CAP_DV_TIMINGS)) V4L2_OUT_CAP_DV_TIMINGS))
return -EINVAL; return -ENODATA;
for (i = 0; i < output->num_modes; i++) { for (i = 0; i < output->num_modes; i++) {
if (output->modes[i].timings_type == VPBE_ENC_DV_TIMINGS && if (output->modes[i].timings_type == VPBE_ENC_DV_TIMINGS &&
...@@ -384,6 +384,13 @@ static int vpbe_s_dv_timings(struct vpbe_device *vpbe_dev, ...@@ -384,6 +384,13 @@ static int vpbe_s_dv_timings(struct vpbe_device *vpbe_dev,
static int vpbe_g_dv_timings(struct vpbe_device *vpbe_dev, static int vpbe_g_dv_timings(struct vpbe_device *vpbe_dev,
struct v4l2_dv_timings *dv_timings) struct v4l2_dv_timings *dv_timings)
{ {
struct vpbe_config *cfg = vpbe_dev->cfg;
int out_index = vpbe_dev->current_out_index;
if (!(cfg->outputs[out_index].output.capabilities &
V4L2_OUT_CAP_DV_TIMINGS))
return -ENODATA;
if (vpbe_dev->current_timings.timings_type & if (vpbe_dev->current_timings.timings_type &
VPBE_ENC_DV_TIMINGS) { VPBE_ENC_DV_TIMINGS) {
*dv_timings = vpbe_dev->current_timings.dv_timings; *dv_timings = vpbe_dev->current_timings.dv_timings;
...@@ -409,7 +416,7 @@ static int vpbe_enum_dv_timings(struct vpbe_device *vpbe_dev, ...@@ -409,7 +416,7 @@ static int vpbe_enum_dv_timings(struct vpbe_device *vpbe_dev,
int i; int i;
if (!(output->output.capabilities & V4L2_OUT_CAP_DV_TIMINGS)) if (!(output->output.capabilities & V4L2_OUT_CAP_DV_TIMINGS))
return -EINVAL; return -ENODATA;
for (i = 0; i < output->num_modes; i++) { for (i = 0; i < output->num_modes; i++) {
if (output->modes[i].timings_type == VPBE_ENC_DV_TIMINGS) { if (output->modes[i].timings_type == VPBE_ENC_DV_TIMINGS) {
...@@ -440,7 +447,7 @@ static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id std_id) ...@@ -440,7 +447,7 @@ static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id std_id)
if (!(cfg->outputs[out_index].output.capabilities & if (!(cfg->outputs[out_index].output.capabilities &
V4L2_OUT_CAP_STD)) V4L2_OUT_CAP_STD))
return -EINVAL; return -ENODATA;
ret = vpbe_get_std_info(vpbe_dev, std_id); ret = vpbe_get_std_info(vpbe_dev, std_id);
if (ret) if (ret)
...@@ -473,6 +480,11 @@ static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id std_id) ...@@ -473,6 +480,11 @@ static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id std_id)
static int vpbe_g_std(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id) static int vpbe_g_std(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id)
{ {
struct vpbe_enc_mode_info *cur_timings = &vpbe_dev->current_timings; struct vpbe_enc_mode_info *cur_timings = &vpbe_dev->current_timings;
struct vpbe_config *cfg = vpbe_dev->cfg;
int out_index = vpbe_dev->current_out_index;
if (!(cfg->outputs[out_index].output.capabilities & V4L2_OUT_CAP_STD))
return -ENODATA;
if (cur_timings->timings_type & VPBE_ENC_STD) { if (cur_timings->timings_type & VPBE_ENC_STD) {
*std_id = cur_timings->std_id; *std_id = cur_timings->std_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment