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: "Lad, Prabhakar" X-Patchwork-Id: 5071701 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1306F9F1EE for ; Sun, 12 Oct 2014 20:42:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5037E20176 for ; Sun, 12 Oct 2014 20:42:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DEC720148 for ; Sun, 12 Oct 2014 20:42:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085AbaJLUlR (ORCPT ); Sun, 12 Oct 2014 16:41:17 -0400 Received: from mail-wg0-f48.google.com ([74.125.82.48]:34962 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753030AbaJLUlN (ORCPT ); Sun, 12 Oct 2014 16:41:13 -0400 Received: by mail-wg0-f48.google.com with SMTP id k14so7423035wgh.7 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 Cc: LKML , DLOS , "Lad, Prabhakar" 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> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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, T_RP_MATCHES_RCVD, 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;