diff options
author | Prabhakar Lad <prabhakar.csengg@gmail.com> | 2014-10-12 16:40:45 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-10-28 14:12:26 -0400 |
commit | f9cc70bfa4ab40b95aa49e9e7e4bb166364d07e6 (patch) | |
tree | 3e31460a4fbe7283d8704834febc1eee625b186d | |
parent | a8afe3817d61f26728d8ced8d646fb1322aebd7e (diff) |
[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: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/platform/davinci/vpbe.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c index 33b9660b7f77..49d2de0eea2d 100644 --- a/drivers/media/platform/davinci/vpbe.c +++ b/drivers/media/platform/davinci/vpbe.c | |||
@@ -341,7 +341,7 @@ static int vpbe_s_dv_timings(struct vpbe_device *vpbe_dev, | |||
341 | 341 | ||
342 | if (!(cfg->outputs[out_index].output.capabilities & | 342 | if (!(cfg->outputs[out_index].output.capabilities & |
343 | V4L2_OUT_CAP_DV_TIMINGS)) | 343 | V4L2_OUT_CAP_DV_TIMINGS)) |
344 | return -EINVAL; | 344 | return -ENODATA; |
345 | 345 | ||
346 | for (i = 0; i < output->num_modes; i++) { | 346 | for (i = 0; i < output->num_modes; i++) { |
347 | if (output->modes[i].timings_type == VPBE_ENC_DV_TIMINGS && | 347 | 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 | static int vpbe_g_dv_timings(struct vpbe_device *vpbe_dev, | 384 | static int vpbe_g_dv_timings(struct vpbe_device *vpbe_dev, |
385 | struct v4l2_dv_timings *dv_timings) | 385 | struct v4l2_dv_timings *dv_timings) |
386 | { | 386 | { |
387 | struct vpbe_config *cfg = vpbe_dev->cfg; | ||
388 | int out_index = vpbe_dev->current_out_index; | ||
389 | |||
390 | if (!(cfg->outputs[out_index].output.capabilities & | ||
391 | V4L2_OUT_CAP_DV_TIMINGS)) | ||
392 | return -ENODATA; | ||
393 | |||
387 | if (vpbe_dev->current_timings.timings_type & | 394 | if (vpbe_dev->current_timings.timings_type & |
388 | VPBE_ENC_DV_TIMINGS) { | 395 | VPBE_ENC_DV_TIMINGS) { |
389 | *dv_timings = vpbe_dev->current_timings.dv_timings; | 396 | *dv_timings = vpbe_dev->current_timings.dv_timings; |
@@ -409,7 +416,7 @@ static int vpbe_enum_dv_timings(struct vpbe_device *vpbe_dev, | |||
409 | int i; | 416 | int i; |
410 | 417 | ||
411 | if (!(output->output.capabilities & V4L2_OUT_CAP_DV_TIMINGS)) | 418 | if (!(output->output.capabilities & V4L2_OUT_CAP_DV_TIMINGS)) |
412 | return -EINVAL; | 419 | return -ENODATA; |
413 | 420 | ||
414 | for (i = 0; i < output->num_modes; i++) { | 421 | for (i = 0; i < output->num_modes; i++) { |
415 | if (output->modes[i].timings_type == VPBE_ENC_DV_TIMINGS) { | 422 | 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 | 447 | ||
441 | if (!(cfg->outputs[out_index].output.capabilities & | 448 | if (!(cfg->outputs[out_index].output.capabilities & |
442 | V4L2_OUT_CAP_STD)) | 449 | V4L2_OUT_CAP_STD)) |
443 | return -EINVAL; | 450 | return -ENODATA; |
444 | 451 | ||
445 | ret = vpbe_get_std_info(vpbe_dev, std_id); | 452 | ret = vpbe_get_std_info(vpbe_dev, std_id); |
446 | if (ret) | 453 | if (ret) |
@@ -473,6 +480,11 @@ static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id std_id) | |||
473 | static int vpbe_g_std(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id) | 480 | static int vpbe_g_std(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id) |
474 | { | 481 | { |
475 | struct vpbe_enc_mode_info *cur_timings = &vpbe_dev->current_timings; | 482 | struct vpbe_enc_mode_info *cur_timings = &vpbe_dev->current_timings; |
483 | struct vpbe_config *cfg = vpbe_dev->cfg; | ||
484 | int out_index = vpbe_dev->current_out_index; | ||
485 | |||
486 | if (!(cfg->outputs[out_index].output.capabilities & V4L2_OUT_CAP_STD)) | ||
487 | return -ENODATA; | ||
476 | 488 | ||
477 | if (cur_timings->timings_type & VPBE_ENC_STD) { | 489 | if (cur_timings->timings_type & VPBE_ENC_STD) { |
478 | *std_id = cur_timings->std_id; | 490 | *std_id = cur_timings->std_id; |