mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
To: LMML <linux-media@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	DLOS <davinci-linux-open-source@linux.davincidsp.com>,
	"Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Subject: [PATCH 15/15] media: davinci: vpbe: return -ENODATA for *dv_timings/*_std calls
Date: Sun, 12 Oct 2014 21:40:45 +0100	[thread overview]
Message-ID: <1413146445-7304-16-git-send-email-prabhakar.csengg@gmail.com> (raw)
In-Reply-To: <1413146445-7304-1-git-send-email-prabhakar.csengg@gmail.com>

this patch adds support for returning -ENODATA if the current
output doesn't support it.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
 drivers/media/platform/davinci/vpbe.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c
index 33b9660..49d2de0 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,
 
 	if (!(cfg->outputs[out_index].output.capabilities &
 	    V4L2_OUT_CAP_DV_TIMINGS))
-		return -EINVAL;
+		return -ENODATA;
 
 	for (i = 0; i < output->num_modes; i++) {
 		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,
 static int vpbe_g_dv_timings(struct vpbe_device *vpbe_dev,
 		     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 &
 	  VPBE_ENC_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,
 	int i;
 
 	if (!(output->output.capabilities & V4L2_OUT_CAP_DV_TIMINGS))
-		return -EINVAL;
+		return -ENODATA;
 
 	for (i = 0; i < output->num_modes; i++) {
 		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)
 
 	if (!(cfg->outputs[out_index].output.capabilities &
 		V4L2_OUT_CAP_STD))
-		return -EINVAL;
+		return -ENODATA;
 
 	ret = vpbe_get_std_info(vpbe_dev, std_id);
 	if (ret)
@@ -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)
 {
 	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) {
 		*std_id = cur_timings->std_id;
-- 
1.9.1


      parent reply	other threads:[~2014-10-12 20:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-12 20:40 [PATCH 00/15] media: davinci: vpbe enhancements Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 01/15] media: davinci: vpbe: initialize vb2 queue and DMA context in probe Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 02/15] media: davinci: vpbe: drop buf_init() callback Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 03/15] media: davinci: vpbe: use vb2_ops_wait_prepare/finish helper functions Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 04/15] media: davinci: vpbe: drop buf_cleanup() callback Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 05/15] media: davinci: vpbe: improve vpbe_buffer_prepare() callback Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 06/15] media: davinci: vpbe: use vb2_fop_mmap/poll Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 07/15] media: davinci: vpbe: use fh handling provided by v4l Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 08/15] media: davinci: vpbe: use vb2_ioctl_* helpers Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 09/15] media: davinci: vpbe: add support for VB2_DMABUF Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 10/15] media: davinci: vpbe: add support for VIDIOC_CREATE_BUFS Lad, Prabhakar
2014-10-22 11:26   ` Hans Verkuil
2014-10-22 21:48     ` Prabhakar Lad
2014-10-12 20:40 ` [PATCH 11/15] media: davinci: vpbe: add support for VIDIOC_EXPBUF Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 12/15] media: davinci: vpbe: use helpers provided by core if streaming is started Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 13/15] media: davinci: vpbe: drop unused member memory from vpbe_layer Lad, Prabhakar
2014-10-12 20:40 ` [PATCH 14/15] media: davinci: vpbe: group v4l2_ioctl_ops Lad, Prabhakar
2014-10-12 20:40 ` Lad, Prabhakar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1413146445-7304-16-git-send-email-prabhakar.csengg@gmail.com \
    --to=prabhakar.csengg@gmail.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®