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: 10258495 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 8C53A60365 for ; Mon, 5 Mar 2018 09:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78BE2289AF for ; Mon, 5 Mar 2018 09:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B619289B2; Mon, 5 Mar 2018 09:39:40 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CD355289AF for ; Mon, 5 Mar 2018 09:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=6bA3U5LH1pg6Ia0k5PU6P5959CctmAUnwEy3ybumbj8=; b=GfSWymVqunzadn0iM1oWk0X4Yi OU1/WTr2HFGFO+3yLNuGT5M2YYsUcqRH0heiSt/b84unAQI+9NWN+dGsEGqFAhCRwGjNquJ1/Sui3 pjtHEXgUw7K4pZ0knnN5DwBX67irBrFUjER9DO7RqQOTvwvOy9FhxIb8FpoY2Op6/rsXfiILGq+ij ljWdZIMf5t2JwuJsAVrxurFj9hjNL4a85wG5wLrGfajZcRzfmOLiRVPUXYYpQiPCGQapMIxYKdytF kyEvRCOC5nj/G2OLO8yvdohut1lQYbpggUStJMZbDj9oh2MhCjwk79v/RA7vSGwV3wp4huB8tix7F V8ZJhWYQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1esmah-0006Os-OW; Mon, 05 Mar 2018 09:39:31 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1esmXU-0004Ws-2g for linux-arm-kernel@lists.infradead.org; Mon, 05 Mar 2018 09:36:17 +0000 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180305_013612_766880_E7371B20 X-CRM114-Status: GOOD ( 11.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mylene Josserand , Thomas Petazzoni , Maxime Ripard , Chen-Yu Tsai , Hans Verkuil , Sakari Ailus , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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,