From patchwork Sun Oct 12 20:40:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 5072091 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2BD75C11AC for ; Sun, 12 Oct 2014 20:49:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F4B920179 for ; Sun, 12 Oct 2014 20:49:06 +0000 (UTC) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E08320176 for ; Sun, 12 Oct 2014 20:49:05 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9CKm6vJ019586; Sun, 12 Oct 2014 15:48:06 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9CKm6Zt019921; Sun, 12 Oct 2014 15:48:06 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Sun, 12 Oct 2014 15:48:06 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9CKm5DX007780; Sun, 12 Oct 2014 15:48:05 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3041A80636; Sun, 12 Oct 2014 15:48:05 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflxv17.itg.ti.com (dflxv17.itg.ti.com [128.247.5.93]) by linux.omap.com (Postfix) with ESMTP id 521478062A for ; Sun, 12 Oct 2014 15:41:14 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflxv17.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9CKfEbv029878 for ; Sun, 12 Oct 2014 15:41:14 -0500 Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9CKfDcE002763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 12 Oct 2014 15:41:14 -0500 Received: from [216.82.241.195:60356] by server-8.bemta-8.messagelabs.com id 96/95-03565-967EA345; Sun, 12 Oct 2014 20:41:13 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-6.tower-119.messagelabs.com!1413146472!30673855!1 X-Originating-IP: [74.125.82.43] X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP X-StarScan-Received: X-StarScan-Version: 6.12.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14715 invoked from network); 12 Oct 2014 20:41:13 -0000 Received: from mail-wg0-f43.google.com (HELO mail-wg0-f43.google.com) (74.125.82.43) by server-6.tower-119.messagelabs.com with RC4-SHA encrypted SMTP; 12 Oct 2014 20:41:13 -0000 Received: by mail-wg0-f43.google.com with SMTP id m15so7220081wgh.2 for ; Sun, 12 Oct 2014 13:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RUO0YrvQccnBpErHrBR03vfAZOHTENSIqWo1dAfSN+c=; b=cGAGLSYsybpQmXaQIkV+Zx9Wn4aFFJjoL26QKo3hN6MkOIzaqHa0kOm059ZIO8EE7J iO7bu8dh3TKh/YJEAitaRkmagkHex/44KbQpnGo+hunu9NNd1Fs0P0OYQEWRx5NDGXE5 b3S8UCpQjCmWUqrFN8I5mrSqWk2fGjkBLB1r/4NBo90VGDcwe5LMLXgl+lLzI66UorMr 6nMNq+0vEEdRcIM9Q0YWHy9rjtHKMoO7IfuV9CDUEd3FrNazk4NBpZGTfWcrTLgmcy0G 5IgO0K9GkILYVQiUrgZ/KAYEKYoH6DuKxtWyQFiEy9X8/e0gTxwNJx7wYlwIe5qtgL19 uBwg== X-Received: by 10.180.20.10 with SMTP id j10mr15633590wie.50.1413146471865; Sun, 12 Oct 2014 13:41:11 -0700 (PDT) Received: from tango-charlie.Home ([2.127.193.40]) by mx.google.com with ESMTPSA id y5sm9970930wix.10.2014.10.12.13.41.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 Oct 2014 13:41:10 -0700 (PDT) From: "Lad, Prabhakar" To: LMML Subject: [PATCH 15/15] media: davinci: vpbe: return -ENODATA for *dv_timings/*_std calls Date: Sun, 12 Oct 2014 21:40:45 +0100 Message-ID: <1413146445-7304-16-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413146445-7304-1-git-send-email-prabhakar.csengg@gmail.com> References: <1413146445-7304-1-git-send-email-prabhakar.csengg@gmail.com> CC: DLOS , LKML X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP this patch adds support for returning -ENODATA if the current output doesn't support it. Signed-off-by: Lad, Prabhakar --- 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;