From patchwork Wed Dec 22 20:31:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 5232 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Thu, 23 Dec 2010 00:21:54 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1PVaoT-0001Zu-QQ for mchehab@gaivota; Thu, 23 Dec 2010 00:21:54 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 23 Dec 2010 00:21:53 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PVVLw-00067j-9v; Wed, 22 Dec 2010 20:32:04 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751756Ab0LVUcC (ORCPT + 1 other); Wed, 22 Dec 2010 15:32:02 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:59945 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311Ab0LVUcA (ORCPT ); Wed, 22 Dec 2010 15:32:00 -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 1AA9918015CD; Wed, 22 Dec 2010 21:31:59 +0100 (CET) X-Auth-Info: UtvE057UtVXmUAsza4cBkOZRgIhHjNu+3USaPK3Z+Fo= Received: from localhost (p4FE3E43A.dip.t-dialin.net [79.227.228.58]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 18C4A1C00146; Wed, 22 Dec 2010 21:31:59 +0100 (CET) From: Anatolij Gustschin To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Hans Verkuil , Detlev Zundel Subject: [PATCH v2 2/2] media: fsl_viu: add VIDIOC_QUERYSTD and VIDIOC_G_STD support Date: Wed, 22 Dec 2010 21:31:59 +0100 Message-Id: <1293049919-9098-2-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <4D122C53.4070300@redhat.com> References: <4D122C53.4070300@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab VIDIOC_QUERYSTD and VIDIOC_G_STD ioctls are currently not supported in the FSL VIU driver. The decoder subdevice driver saa7115 extended by previous patch supports QUERYSTD for saa711x, so we add the appropriate ioctls to the VIU driver to be able to determine the video input's standard. Signed-off-by: Anatolij Gustschin --- Changes since first patch version: - fixed the commit message and rebased drivers/media/video/fsl-viu.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c index 693e9c0..e4bba88 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 { @@ -937,14 +939,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) @@ -1402,7 +1421,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,