Received: by 10.223.176.5 with SMTP id f5csp1759073wra; Thu, 8 Feb 2018 03:02:49 -0800 (PST) X-Google-Smtp-Source: AH8x227HoierBcCeY7u/qCbvXgZlSBjHSFipfaXZ3npMGtwwxawgwmTgBcZfygQ4eVQ6uz4Nvy/Y X-Received: by 2002:a17:902:8f8a:: with SMTP id z10-v6mr256814plo.395.1518087769430; Thu, 08 Feb 2018 03:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518087769; cv=none; d=google.com; s=arc-20160816; b=pvrKFndJxjp/2YBVmCjpGinkbcVVdni8X11M2pmfcCmdBEjBvKsZleO+EgWRBIQnJD Wvv0LuFMJdCnK45YYZIQT5R4bvU7iYsoOd6MviY0i97jfqeS4zt3/+iDeZw/RQHWHkZJ vyq6W5+luPhhGmTiDKOkR8SSpRBQLZsrEP/Fncogemdof2IsDd3jxwur2HYCOHipfBX9 CJT7VzBm7QFsb1tUy5GsJXQHtA0fN2UnsEU9CPOdpsoyfojArnDX5vqq1sN6cLEP47Dj Alf0aAeMPCSryygy6qcf+4WUGAEMI/jGMyXuDVb9KHWGivuPDiwijGJxJI5/vfnaMJAo C5rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=IvOJxDgFyrZV/lknsBlxiB8SRamG3CEmA7QM24Tn+Zg=; b=HBwHJml3yPZPGUJYe/a4+56e8bWHBUWfwwHbV8nglTI5vq503rKe6OS3C/j4G9QJRD 5XOtAiyw04oKAer+8CA55nuxxweHPL3PRddi/0+q+JFhcvK20f9y7ZvmkqGxJ5wdguFa JTc0sy02DKbcLNyFCNOU51DhCxof+Pua13s3yPI+UYTeE1/rbs0D/v7SRNtjpoIV6mKV g37Kb0DJsCa2iBLQsZLBjDX1MKtq6AvTcVFbpmtMNSye8SIvLbkH9V9hRvFX9tpKS0WB l8MkKlGrK3WFzL2jsACRp5WIRpUbWdk4fj2e2p+LN8qwiDcjBOPXCvoR1ifGNu0tcXwD /uWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l132si1192506pfc.202.2018.02.08.03.02.35; Thu, 08 Feb 2018 03:02:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752491AbeBHLBe (ORCPT + 99 others); Thu, 8 Feb 2018 06:01:34 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:27335 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbeBHLBS (ORCPT ); Thu, 8 Feb 2018 06:01:18 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w18Awllf020397; Thu, 8 Feb 2018 12:00:52 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2fw3qx1u06-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 08 Feb 2018 12:00:52 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8D83631; Thu, 8 Feb 2018 11:00:51 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6D05D561D; Thu, 8 Feb 2018 11:00:51 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.352.0; Thu, 8 Feb 2018 12:00:51 +0100 Received: from localhost (10.201.23.73) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 8 Feb 2018 12:00:50 +0100 From: Hugues Fruchet To: Maxime Coquelin , Alexandre Torgue , Mauro Carvalho Chehab , "Hans Verkuil" CC: , , , , "Benjamin Gaignard" , Yannick Fertre , Hugues Fruchet Subject: [PATCH v2] media: stm32-dcmi: add g/s_parm framerate support Date: Thu, 8 Feb 2018 12:00:45 +0100 Message-ID: <1518087645-1394-1-git-send-email-hugues.fruchet@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.73] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-08_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add g/s_parm framerate support by calling subdev g/s_frame_interval ops. This allows user to control sensor framerate by calling ioctl G/S_PARM. Signed-off-by: Hugues Fruchet --- version 2: - Rebase on Hans branch to use new helpers: See https://www.mail-archive.com/linux-media@vger.kernel.org/msg125769.html drivers/media/platform/stm32/stm32-dcmi.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index 9460b30..60dd24c 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -1167,6 +1167,22 @@ static int dcmi_enum_framesizes(struct file *file, void *fh, return 0; } +static int dcmi_g_parm(struct file *file, void *priv, + struct v4l2_streamparm *p) +{ + struct stm32_dcmi *dcmi = video_drvdata(file); + + return v4l2_g_parm_cap(video_devdata(file), dcmi->entity.subdev, p); +} + +static int dcmi_s_parm(struct file *file, void *priv, + struct v4l2_streamparm *p) +{ + struct stm32_dcmi *dcmi = video_drvdata(file); + + return v4l2_s_parm_cap(video_devdata(file), dcmi->entity.subdev, p); +} + static int dcmi_enum_frameintervals(struct file *file, void *fh, struct v4l2_frmivalenum *fival) { @@ -1269,6 +1285,9 @@ static int dcmi_release(struct file *file) .vidioc_g_input = dcmi_g_input, .vidioc_s_input = dcmi_s_input, + .vidioc_g_parm = dcmi_g_parm, + .vidioc_s_parm = dcmi_s_parm, + .vidioc_enum_framesizes = dcmi_enum_framesizes, .vidioc_enum_frameintervals = dcmi_enum_frameintervals, -- 1.9.1