From patchwork Mon Dec 13 18:19:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 407382 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBDIJedX007099 for ; Mon, 13 Dec 2010 18:19:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757501Ab0LMSTi (ORCPT ); Mon, 13 Dec 2010 13:19:38 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:58082 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757470Ab0LMSTh (ORCPT ); Mon, 13 Dec 2010 13:19:37 -0500 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 687691853B89; Mon, 13 Dec 2010 19:19:35 +0100 (CET) X-Auth-Info: /8tgXCCJ++dKGEXCTJHyE83d0DjZLz4Z9kKDl96olQs= Received: from localhost (p4FE3F5CB.dip.t-dialin.net [79.227.245.203]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 84A661C0012F; Mon, 13 Dec 2010 19:19:35 +0100 (CET) From: Anatolij Gustschin To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Hans Verkuil , Detlev Zundel Subject: [PATCH 2/2] media: fsl_viu: add VIDIOC_QUERYSTD and VIDIOC_G_STD support Date: Mon, 13 Dec 2010 19:19:37 +0100 Message-Id: <1292264377-31877-2-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1292264377-31877-1-git-send-email-agust@denx.de> References: <1292264377-31877-1-git-send-email-agust@denx.de> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 13 Dec 2010 18:19:41 +0000 (UTC) diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c index b8faff2..04be6eb 100644 --- a/drivers/media/video/fsl-viu.c +++ b/drivers/media/video/fsl-viu.c @@ -194,6 +194,8 @@ struct viu_dev { /* decoder */ struct v4l2_subdev *decoder; + + v4l2_std_id std; }; struct viu_fh { @@ -933,14 +935,31 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) #define decoder_call(viu, o, f, args...) \ v4l2_subdev_call(viu->decoder, o, f, ##args) +static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *std_id) +{ + struct viu_fh *fh = priv; + + decoder_call(fh->dev, video, querystd, std_id); + return 0; +} + static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id) { struct viu_fh *fh = priv; + fh->dev->std = *id; decoder_call(fh->dev, core, s_std, *id); return 0; } +static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *std_id) +{ + struct viu_fh *fh = priv; + + *std_id = fh->dev->std; + return 0; +} + /* only one input in this driver */ static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *inp) @@ -1397,7 +1416,9 @@ static const struct v4l2_ioctl_ops viu_ioctl_ops = { .vidioc_querybuf = vidioc_querybuf, .vidioc_qbuf = vidioc_qbuf, .vidioc_dqbuf = vidioc_dqbuf, + .vidioc_g_std = vidioc_g_std, .vidioc_s_std = vidioc_s_std, + .vidioc_querystd = vidioc_querystd, .vidioc_enum_input = vidioc_enum_input, .vidioc_g_input = vidioc_g_input, .vidioc_s_input = vidioc_s_input,