From patchwork Fri May 16 13:33:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 4192741 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 6AEBCBFF02 for ; Fri, 16 May 2014 13:50:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89CF620270 for ; Fri, 16 May 2014 13:50:37 +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 8ADD0201FE for ; Fri, 16 May 2014 13:50:36 +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 s4GDngm7015091; Fri, 16 May 2014 08:49:42 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4GDngat018345; Fri, 16 May 2014 08:49:42 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 16 May 2014 08:49:42 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4GDnfOt017295; Fri, 16 May 2014 08:49:41 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 0C96D8062B; Fri, 16 May 2014 08:49:41 -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 F3E2880626 for ; Fri, 16 May 2014 08:40:53 -0500 (CDT) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflxv17.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4GDerf6013796 for ; Fri, 16 May 2014 08:40:53 -0500 Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id s4GDerpD001776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 16 May 2014 08:40:53 -0500 Received: from [216.82.250.51:42505] by server-11.bemta-12.messagelabs.com id 90/13-02193-56516735; Fri, 16 May 2014 13:40:53 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-15.tower-108.messagelabs.com!1400247651!8777414!1 X-Originating-IP: [209.85.160.46] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23670 invoked from network); 16 May 2014 13:40:52 -0000 Received: from mail-pb0-f46.google.com (HELO mail-pb0-f46.google.com) (209.85.160.46) by server-15.tower-108.messagelabs.com with RC4-SHA encrypted SMTP; 16 May 2014 13:40:52 -0000 Received: by mail-pb0-f46.google.com with SMTP id rq2so2630733pbb.33 for ; Fri, 16 May 2014 06:40:51 -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=O6wMYisscKbBQnMHFL+puhq6RzrQX4jGq7HEQTI1Vgk=; b=ue9WWtV0tjEzHSBAWgaQrSU1krazSgrzlrla4y5dxHyby1BHtD/ibNavDwsEG62qLR dposxpWKRa7h1j/iW2pcvxM5wn4TXOcKNytiiLPn1/Bk+XyESIPjud4pRpBnZjszN+hs QF+IoHeDs6gcZuKzPI15qs7F2/4apbMEnmgQqGz//dGUu1+aUhwxyWEUiolxYwsF4Kha ouQJrlYKUCfCnUg6OhYHu9ni5nOEd3JBFQ9v05UdOM3FMPHxPIbM1mJCUWdhVv58+lDV 370d77VYpp+NzD2ecfFE6CBqBpjHs5y1KYcM6OuK3uEM/ec4gMJ0Z55PnQz/ExBxVF+J cVhg== X-Received: by 10.66.150.228 with SMTP id ul4mr21365306pab.16.1400247651391; Fri, 16 May 2014 06:40:51 -0700 (PDT) Received: from localhost.localdomain ([27.107.45.22]) by mx.google.com with ESMTPSA id cj1sm34699547pac.40.2014.05.16.06.40.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 May 2014 06:40:50 -0700 (PDT) From: "Lad, Prabhakar" To: LMML , Hans Verkuil Subject: [PATCH v5 23/49] media: davinci: vpif_display: return -ENODATA for *std calls Date: Fri, 16 May 2014 19:03:28 +0530 Message-ID: <1400247235-31434-25-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400247235-31434-1-git-send-email-prabhakar.csengg@gmail.com> References: <1400247235-31434-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=ham 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 From: "Lad, Prabhakar" this patch adds supports to return -ENODATA to *std calls if the selected output does not support it. Signed-off-by: Lad, Prabhakar --- drivers/media/platform/davinci/vpif_display.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index f51b5be..f581e7a 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -715,14 +715,26 @@ static int vpif_try_fmt_vid_out(struct file *file, void *priv, static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) { + struct vpif_display_config *config = vpif_dev->platform_data; struct video_device *vdev = video_devdata(file); struct channel_obj *ch = video_get_drvdata(vdev); struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; - int ret = 0; + struct vpif_display_chan_config *chan_cfg; + struct v4l2_output output; + int ret; + + if (config->chan_config[ch->channel_id].outputs == NULL) + return -ENODATA; + + chan_cfg = &config->chan_config[ch->channel_id]; + output = chan_cfg->outputs[ch->output_idx].output; + if (output.capabilities != V4L2_OUT_CAP_STD) + return -ENODATA; if (vb2_is_busy(&common->buffer_queue)) return -EBUSY; + if (!(std_id & VPIF_V4L2_STD)) return -EINVAL; @@ -754,8 +766,19 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std) { + struct vpif_display_config *config = vpif_dev->platform_data; struct video_device *vdev = video_devdata(file); struct channel_obj *ch = video_get_drvdata(vdev); + struct vpif_display_chan_config *chan_cfg; + struct v4l2_output output; + + if (config->chan_config[ch->channel_id].outputs == NULL) + return -ENODATA; + + chan_cfg = &config->chan_config[ch->channel_id]; + output = chan_cfg->outputs[ch->output_idx].output; + if (output.capabilities != V4L2_OUT_CAP_STD) + return -ENODATA; *std = ch->video.stdid; return 0;