From patchwork Wed Aug 3 18:03:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9261707 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 309B360754 for ; Wed, 3 Aug 2016 18:05:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 240AE281F9 for ; Wed, 3 Aug 2016 18:05:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 172A128236; Wed, 3 Aug 2016 18:05:48 +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 AA773281F9 for ; Wed, 3 Aug 2016 18:05:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932411AbcHCSEJ (ORCPT ); Wed, 3 Aug 2016 14:04:09 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:33111 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932367AbcHCSEF (ORCPT ); Wed, 3 Aug 2016 14:04:05 -0400 Received: by mail-pa0-f68.google.com with SMTP id q2so14438692pap.0; Wed, 03 Aug 2016 11: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=KdJMC6ftKl21dY0W7d5wd17eT4XA1Z8BgrQla09jNdc=; b=Zn/uziOuIb74WhdyzDHk99/x/UPNNbW4z10AQ8vMuB/X/ipJn0fsJUjdm3tksTNUth mCFPzoS37gTR6+CQjacP7hb18fzVUupBxPH/UI3TbyRmJ8BM5XeFgq+A3AjOWCmlktRC 7+Jdvars+ISWodr0nh3PHi5ZggPLRNBvU90GWNsFUNh/1mTmJDoJtkS+a2dPZMfobJY0 lQDaaYVFqug0ny0zBTmc/3wUPW6ItLBP64H/Dg3X1ZHCKmL/jb66Ktd00JI3hKbs9ss5 0n4fF0wdYVeMxaZM3mwaubbeCVAIo+3w71i3hX2aRrQAmkYS5PUkzq8K8ATWJBK5fayw AOXg== 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=KdJMC6ftKl21dY0W7d5wd17eT4XA1Z8BgrQla09jNdc=; b=kGFjKo/Fih+dGPbo/6cMptwDT1BBkY2E3GkoEcEBxAvs0we5Nv7IdXaRNgHNjfLDFH z/uLu3LOnFibpPziSfSOULwualhQYBlzZg1DpVH9Ke9OuVW9OxOEZBMx20gigGJ/Xu/O yVExHSRK3wtzjLxuUuahgLrBC9YtJU65iJYFVB+nr3fNOEwNf2yVJLYypGxPf0QORXhB xcvWaDdjGaBjX2lZBUpfUdl2qTCc2h/3iA5qhOY1b8ACyZndHTpsFJCbzn1vhW/pJcBg vZhdyF39qoasqZexYmhawJK/00PMCo78BbjqWnMeTxyqaTa08TklvSRBDMziWSDEtV8w r5sw== X-Gm-Message-State: AEkooustnzRgIXBXbKpthgeBzLO6pHBpYWY9IGHeiFKr2DPwf8ZSkGoqNyHBOB83CsY7iA== X-Received: by 10.66.86.170 with SMTP id q10mr117912043paz.105.1470247444455; Wed, 03 Aug 2016 11:04:04 -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 w64sm14219878pfb.93.2016.08.03.11.04.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Aug 2016 11:04:03 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: lars@metafoo.de Cc: mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Steve Longerbeam Subject: [PATCH v4 5/8] media: adv7180: implement g_parm Date: Wed, 3 Aug 2016 11:03:47 -0700 Message-Id: <1470247430-11168-6-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470247430-11168-1-git-send-email-steve_longerbeam@mentor.com> References: <1470247430-11168-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 --- v4: no changes v3: no changes v2: no changes --- 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 b2df181..9705e24 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -764,6 +764,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); @@ -822,6 +843,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,