From patchwork Wed Mar 2 17:16:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 8484101 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 065EA9FC55 for ; Wed, 2 Mar 2016 17:17:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F90720114 for ; Wed, 2 Mar 2016 17:17:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 96B662017E for ; Wed, 2 Mar 2016 17:17:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236AbcCBRRK (ORCPT ); Wed, 2 Mar 2016 12:17:10 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33306 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753879AbcCBRRH (ORCPT ); Wed, 2 Mar 2016 12:17:07 -0500 Received: by mail-wm0-f65.google.com with SMTP id n186so10774894wmn.0; Wed, 02 Mar 2016 09:17:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=9xgQrY9glI9rqHek3rRzN/1zDdZ+4+CFpd8b6PjGxII=; b=QgIDwjuNqfgFrv2N+SYvbIdyVMYzEhZtTP5ZO9kJ7H/54PsjBSvRLKJk3t+A9vrlJt OdAd/MBrFeO5jU60ftzQ7h2V+toLeaU3WPMMPowwLwkffGKLaDj9ieTS4sNdmDbqASK6 Q++YkZKjhnLvPhU2uGQr5mY11ZeZwRaSns8aypmb5lKxutZ9dwr7vk5nRXs3SvyRRROn c4M9CQr2idFv/34nFiCg48MyoQ2eZvZQyYYvtCh5HcbvjdNgH2PYQ9klYHnDmoh/eqq3 0h8z30qLKHUywSFBiRXPgE+LczC6rzSDlEcnyP+XOJw+HS/Vu93Y05if9fBXj5PZlGFn aoKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=9xgQrY9glI9rqHek3rRzN/1zDdZ+4+CFpd8b6PjGxII=; b=RYH54C5AGmxFR+MBblD++/ikw8YW/ztjJ9ihrbSa2VPPzGsD0dAJ3syp/eWO2Xsz7G Rgu6YRh68I6W87ASG0CM3SAghyTKavtdddIw2INpJQLLKDiCxeBuaXNB+7Nu4eRVuvx0 zj/wfMTjuYmRa+VKhrAtGLExNehcBQRUDGZUoWekM8SOsNDQsSiAroe8em4t+vCr3OuP Pp06QC2/c5DjaGjsXJJCvUpbF9BAaCOQRTlY1ZscZ8WS82AQTYmU/Cd/vJLPlZcUnYMn jXHavlC3URv0m1CP2y/RquiKekYILsnKn0DxOqTKHIr4yVPJiPu3ILWsZyYimTdmnQdH A1tw== X-Gm-Message-State: AD7BkJJ94p5ZYMk51miBWZa6w7R3hgx39G+s9SPhDgqJss9o4Oqtazd7XK3SAy2MImZrlw== X-Received: by 10.28.101.7 with SMTP id z7mr1011596wmb.92.1456939025909; Wed, 02 Mar 2016 09:17:05 -0800 (PST) Received: from groucho.site (ip9234e209.dynamic.kabel-deutschland.de. [146.52.226.9]) by smtp.gmail.com with ESMTPSA id ka7sm36741410wjb.8.2016.03.02.09.17.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Mar 2016 09:17:05 -0800 (PST) From: Ulrich Hecht To: linux-renesas-soc@vger.kernel.org, laurent.pinchart@ideasonboard.com, niklas.soderlund@ragnatech.se Cc: linux-media@vger.kernel.org, magnus.damm@gmail.com, hans.verkuil@cisco.com, ian.molton@codethink.co.uk, lars@metafoo.de, william.towle@codethink.co.uk, Ulrich Hecht Subject: [PATCH v2 6/9] media: rcar-vin: add DV timings support Date: Wed, 2 Mar 2016 18:16:34 +0100 Message-Id: <1456938997-29971-7-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1456938997-29971-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1456938997-29971-1-git-send-email-ulrich.hecht+renesas@gmail.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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, RP_MATCHES_RCVD, 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 Adds ioctls DV_TIMINGS_CAP, ENUM_DV_TIMINGS, G_DV_TIMINGS, S_DV_TIMINGS, and QUERY_DV_TIMINGS. Signed-off-by: Ulrich Hecht --- drivers/media/platform/rcar-vin/rcar-dma.c | 69 ++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index 3d957dc..4596eda 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -644,12 +644,17 @@ static int rvin_enum_input(struct file *file, void *priv, struct v4l2_input *i) { struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); if (i->index != 0) return -EINVAL; i->type = V4L2_INPUT_TYPE_CAMERA; i->std = vin->vdev.tvnorms; + + if (v4l2_subdev_has_op(sd, pad, dv_timings_cap)) + i->capabilities = V4L2_IN_CAP_DV_TIMINGS; + strlcpy(i->name, "Camera", sizeof(i->name)); return 0; @@ -692,6 +697,64 @@ static int rvin_g_std(struct file *file, void *priv, v4l2_std_id *a) return v4l2_subdev_call(sd, video, g_std, a); } +static int rvin_enum_dv_timings(struct file *file, void *priv_fh, + struct v4l2_enum_dv_timings *timings) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + + timings->pad = 0; + return v4l2_subdev_call(sd, + pad, enum_dv_timings, timings); +} + +static int rvin_s_dv_timings(struct file *file, void *priv_fh, + struct v4l2_dv_timings *timings) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + int err; + + err = v4l2_subdev_call(sd, + video, s_dv_timings, timings); + if (!err) { + vin->sensor.width = timings->bt.width; + vin->sensor.height = timings->bt.height; + } + return err; +} + +static int rvin_g_dv_timings(struct file *file, void *priv_fh, + struct v4l2_dv_timings *timings) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + + return v4l2_subdev_call(sd, + video, g_dv_timings, timings); +} + +static int rvin_query_dv_timings(struct file *file, void *priv_fh, + struct v4l2_dv_timings *timings) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + + return v4l2_subdev_call(sd, + video, query_dv_timings, timings); +} + +static int rvin_dv_timings_cap(struct file *file, void *priv_fh, + struct v4l2_dv_timings_cap *cap) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + + cap->pad = 0; + return v4l2_subdev_call(sd, + pad, dv_timings_cap, cap); +} + static const struct v4l2_ioctl_ops rvin_ioctl_ops = { .vidioc_querycap = rvin_querycap, .vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap, @@ -706,6 +769,12 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = { .vidioc_g_input = rvin_g_input, .vidioc_s_input = rvin_s_input, + .vidioc_dv_timings_cap = rvin_dv_timings_cap, + .vidioc_enum_dv_timings = rvin_enum_dv_timings, + .vidioc_g_dv_timings = rvin_g_dv_timings, + .vidioc_s_dv_timings = rvin_s_dv_timings, + .vidioc_query_dv_timings = rvin_query_dv_timings, + .vidioc_querystd = rvin_querystd, .vidioc_g_std = rvin_g_std, .vidioc_s_std = rvin_s_std,