From patchwork Mon Mar 5 09:35:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 10258477 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 B47A960365 for ; Mon, 5 Mar 2018 09:36:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A431D2899E for ; Mon, 5 Mar 2018 09:36:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98CD0289B2; Mon, 5 Mar 2018 09:36:00 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 3E38A289B1 for ; Mon, 5 Mar 2018 09:36:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932970AbeCEJf6 (ORCPT ); Mon, 5 Mar 2018 04:35:58 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49572 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933718AbeCEJfv (ORCPT ); Mon, 5 Mar 2018 04:35:51 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 3B4F8207F2; Mon, 5 Mar 2018 10:35:49 +0100 (CET) Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id D258220881; Mon, 5 Mar 2018 10:35:38 +0100 (CET) From: Maxime Ripard To: Yong Deng Cc: Mauro Carvalho Chehab , Chen-Yu Tsai , Maxime Ripard , Hans Verkuil , Sakari Ailus , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Mylene Josserand Subject: [PATCH 8/8] media: sun6i: Add g_parm/s_parm ioctl support Date: Mon, 5 Mar 2018 10:35:35 +0100 Message-Id: <20180305093535.11801-9-maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180305093535.11801-1-maxime.ripard@bootlin.com> References: <1519697113-32202-1-git-send-email-yong.deng@magewell.com> <20180305093535.11801-1-maxime.ripard@bootlin.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 Add a g_parm and s_parm callback in order to be able to control the sensor framerate of the sensor. Signed-off-by: Maxime Ripard --- .../media/platform/sunxi/sun6i-csi/sun6i_video.c | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c index bf7c0d1d1d47..bac867004fa0 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c @@ -478,6 +478,32 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int i) return 0; } +static int vidioc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) +{ + struct sun6i_video *video = video_drvdata(file); + struct v4l2_subdev *subdev; + u32 pad; + + subdev = sun6i_video_remote_subdev(video, &pad); + if (subdev == NULL) + return -ENXIO; + + return v4l2_g_parm_cap(video_devdata(file), subdev, a); +} + +static int vidioc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) +{ + struct sun6i_video *video = video_drvdata(file); + struct v4l2_subdev *subdev; + u32 pad; + + subdev = sun6i_video_remote_subdev(video, &pad); + if (subdev == NULL) + return -ENXIO; + + return v4l2_s_parm_cap(video_devdata(file), subdev, a); +} + static const struct v4l2_ioctl_ops sun6i_video_ioctl_ops = { .vidioc_querycap = vidioc_querycap, .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, @@ -489,6 +515,9 @@ static const struct v4l2_ioctl_ops sun6i_video_ioctl_ops = { .vidioc_s_input = vidioc_s_input, .vidioc_g_input = vidioc_g_input, + .vidioc_g_parm = vidioc_g_parm, + .vidioc_s_parm = vidioc_s_parm, + .vidioc_reqbufs = vb2_ioctl_reqbufs, .vidioc_querybuf = vb2_ioctl_querybuf, .vidioc_qbuf = vb2_ioctl_qbuf,