From patchwork Wed Jul 20 00:03:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9238541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8906F602F0 for ; Wed, 20 Jul 2016 00:05:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AFA52787C for ; Wed, 20 Jul 2016 00:05:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F88A2624D; Wed, 20 Jul 2016 00:05:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85EAE2787C for ; Wed, 20 Jul 2016 00:05:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753016AbcGTAFn (ORCPT ); Tue, 19 Jul 2016 20:05:43 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:33612 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbcGTAEE (ORCPT ); Tue, 19 Jul 2016 20:04:04 -0400 Received: by mail-pa0-f67.google.com with SMTP id q2so2160424pap.0; Tue, 19 Jul 2016 17:04:04 -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=ISVrwiUfeVjIuAOM1YVfUlzltf4vtS1QBjig4ydwBUU=; b=XQhpKSn2/Ehn24jpbsR2APTdnLaQxCoKhcyiExxMbz3lkgO8C7goDKD8rnmNjaWkjM ki7/FE/qISb/emHmV8w656nChXKEogrmAoAHKpkoTkE8GdTdLmd/I0bbk/5K/Sp+/BGc hPFjXmdptGpYe8BIpJnoTlrvMP2s/daHt4BXdpq+DlDaCtO6gFVGNKM5C6vZjrWAimTR Ub9EyYtuKJGO9DWJ8KQj/3umZ32YIf6i1zRXUu1q+1Ci86uU/RorKSwxMS1nJfBHcZM8 0jdxRCC8NPLeMwnTMy909cUvwIrUqa3ijhS2FgI6gcS0J1ZRPdj7Bo+zE+cCqItFyTVr M2fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ISVrwiUfeVjIuAOM1YVfUlzltf4vtS1QBjig4ydwBUU=; b=lPQAJ6l7UvRIY7TyiFc/qlIqQ7IvBg2jcwz0LC5ri3P/apg157rWXhBD6N5nPhe+ci AE9kUYwsk0Rj2kttUz6PQSbMvFLIa5vIGrvNnRadcnuYgHlKKtoSqwypGGKCF3bz1Vh8 nXZbxIFHfgIuc1ScfMEPsmi/YOqjc2E3AqTSphRDIWoEQqAWDPaJy1tUryRaVGLaMJmt LoTiB4EVPUtbCdiHbtugBXGhVQ4uh95a1PtonGUOMmIhxrQLzwM4nkVshZ09m3s1EHB2 czkSswroGic/xCgi5+uaogK1fQR90idBZEvujMqjomeCyIZ2DZ4Ejq81bM3Yk/VZJ64z ku+Q== X-Gm-Message-State: ALyK8tJ3J2BiEM4xWoNjGD8g/HBknddFvrTjrImQVbQVJp4+EHaX6+d24Vq99/zNmQH63Q== X-Received: by 10.66.181.16 with SMTP id ds16mr21440292pac.102.1468973043522; Tue, 19 Jul 2016 17:04:03 -0700 (PDT) Received: from mothership.sklembedded.com (c-73-241-2-21.hsd1.ca.comcast.net. [73.241.2.21]) by smtp.googlemail.com with ESMTPSA id ty6sm7107742pac.18.2016.07.19.17.04.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 17:04:03 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: lars@metafoo.de Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Steve Longerbeam Subject: [PATCH v2 06/10] media: adv7180: implement g_parm Date: Tue, 19 Jul 2016 17:03:33 -0700 Message-Id: <1468973017-17647-7-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468973017-17647-1-git-send-email-steve_longerbeam@mentor.com> References: <1467846004-12731-1-git-send-email-steve_longerbeam@mentor.com> <1468973017-17647-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Implement g_parm to return the current standard's frame period. Signed-off-by: Steve Longerbeam Tested-by: Tim Harvey Acked-by: Tim Harvey --- drivers/media/i2c/adv7180.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index 8612d21..8259549 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -766,6 +766,27 @@ static int adv7180_g_mbus_config(struct v4l2_subdev *sd, return 0; } +static int adv7180_g_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a) +{ + struct adv7180_state *state = to_state(sd); + struct v4l2_captureparm *cparm = &a->parm.capture; + + if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + return -EINVAL; + + memset(a, 0, sizeof(*a)); + a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + if (state->curr_norm & V4L2_STD_525_60) { + cparm->timeperframe.numerator = 1001; + cparm->timeperframe.denominator = 30000; + } else { + cparm->timeperframe.numerator = 1; + cparm->timeperframe.denominator = 25; + } + + return 0; +} + static int adv7180_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *cropcap) { struct adv7180_state *state = to_state(sd); @@ -824,6 +845,7 @@ static int adv7180_subscribe_event(struct v4l2_subdev *sd, static const struct v4l2_subdev_video_ops adv7180_video_ops = { .s_std = adv7180_s_std, .g_std = adv7180_g_std, + .g_parm = adv7180_g_parm, .querystd = adv7180_querystd, .g_input_status = adv7180_g_input_status, .s_routing = adv7180_s_routing,