From patchwork Tue Jun 14 22:49:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9177103 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 756616021C for ; Tue, 14 Jun 2016 22:52:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6636F28307 for ; Tue, 14 Jun 2016 22:52:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5921828340; Tue, 14 Jun 2016 22:52:03 +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 DAB4528307 for ; Tue, 14 Jun 2016 22:52:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932223AbcFNWv4 (ORCPT ); Tue, 14 Jun 2016 18:51:56 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33551 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932222AbcFNWvc (ORCPT ); Tue, 14 Jun 2016 18:51:32 -0400 Received: by mail-pf0-f193.google.com with SMTP id c74so307139pfb.0 for ; Tue, 14 Jun 2016 15:51:32 -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=DcodZNuAiPqx5vap44d38nJaypc6tt8CFeaQBy2XOh0=; b=kTy1WkC1lsDhNLa0PNJowMjVznB2Z3ZQtnVkCkkk1Trym7rBYyMWmTHUDSghTIJM2v hBIcePn0nSDA/vg9okDk9giHDtW58CVK9t3CbTmmHrmZkB6HbH9YgZNLnUmaRw8LNCNH kmSwc/nGZF03mrhfsHYt0fHv9DYvtW6xKh+UK7BLvMhY4Fn9dI6i8J982Jx5W0UhAt8K NMe2zJHLSAyyfvv2XAW/YLrY9czIxsi9962zC1gQM8wNiSmRwg58iCJSViDVf8d5+Vtk 8gq8I5tDoXhZPex4WdqAKeY2wcRrFegQKR6g0bC3Jld3lbPNze4czKuCa5fQ4+cKNpJx a7VA== 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=DcodZNuAiPqx5vap44d38nJaypc6tt8CFeaQBy2XOh0=; b=RLI2OwwD8T3MpDRIUwUKMnFc8V48AretKOBJo576P3BhWc7B6wBfX01SvBYni3FP2c BtpwunM8hbkpOL/8Kf5Kk7mS7aF3tPQvJByqYmi4GbVhxnNnZ/g96hHj1rvzSAKrypjH ejJAgXPmmgzAJYxPaigQR4xc/D/F/oV6N9Ibe7uYz6oZRrtPAPapTHaAxXOEqjicGWxD ysn13z40Cnh7WSZaNyfv5sWWYWQWC2HBZlfdfa/g0+Khkg7tKzEbrCKaLwaOmrg3GhKu EW9Ag4nmsDTg4iyPqGQddKe6lKJ27wlIF/DKS9pEKD13ZtuQL4xzVDfIl6CkWTRTXumt neCg== X-Gm-Message-State: ALyK8tKgiiJeCWwGzYBLksqfcE6+KvriJOBieBzXCF2ZMfhEGpubeBZKMTx+ywxhMeoO8A== X-Received: by 10.66.221.66 with SMTP id qc2mr14150pac.147.1465944692001; Tue, 14 Jun 2016 15:51:32 -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 v184sm47829999pfb.24.2016.06.14.15.51.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Jun 2016 15:51:31 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH 36/38] media: adv7180: implement g_parm Date: Tue, 14 Jun 2016 15:49:32 -0700 Message-Id: <1465944574-15745-37-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465944574-15745-1-git-send-email-steve_longerbeam@mentor.com> References: <1465944574-15745-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 --- 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 b3bb19f..9e40632 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -740,6 +740,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); @@ -798,6 +819,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,