From patchwork Fri Dec 14 06:18:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10730595 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE58E16B1 for ; Fri, 14 Dec 2018 06:19:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AED162CC3E for ; Fri, 14 Dec 2018 06:19:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A31F12CC76; Fri, 14 Dec 2018 06:19:33 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 517532CC48 for ; Fri, 14 Dec 2018 06:19:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727164AbeLNGTc (ORCPT ); Fri, 14 Dec 2018 01:19:32 -0500 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:53002 "EHLO vsp-unauthed02.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbeLNGTc (ORCPT ); Fri, 14 Dec 2018 01:19:32 -0500 X-Halon-ID: 2faf7d72-ff68-11e8-911a-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 2faf7d72-ff68-11e8-911a-0050569116f7; Fri, 14 Dec 2018 07:19:20 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Laurent Pinchart , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH 3/4] rcar-vin: make rvin_{start,stop}_streaming() available for internal use Date: Fri, 14 Dec 2018 07:18:23 +0100 Message-Id: <20181214061824.10296-4-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181214061824.10296-1-niklas.soderlund+renesas@ragnatech.se> References: <20181214061824.10296-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To support suspend/resume rvin_{start,stop}_streaming() needs to be accessible from the suspend and resume callbacks. Up until now the only users of these functions have been the callbacks in struct vb2_ops so the arguments to the functions are not suitable for use by the driver it self. Fix this by adding wrappers for the struct vb2_ops callbacks which calls the new rvin_{start,stop}_streaming() using more friendly arguments. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 20 ++++++++++++++------ drivers/media/platform/rcar-vin/rcar-vin.h | 3 +++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index 64f7636f94d6a0a3..d11d4df1906a8962 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -1143,9 +1143,8 @@ static int rvin_set_stream(struct rvin_dev *vin, int on) return ret; } -static int rvin_start_streaming(struct vb2_queue *vq, unsigned int count) +int rvin_start_streaming(struct rvin_dev *vin) { - struct rvin_dev *vin = vb2_get_drv_priv(vq); unsigned long flags; int ret; @@ -1187,9 +1186,13 @@ static int rvin_start_streaming(struct vb2_queue *vq, unsigned int count) return ret; } -static void rvin_stop_streaming(struct vb2_queue *vq) +static int rvin_start_streaming_vq(struct vb2_queue *vq, unsigned int count) +{ + return rvin_start_streaming(vb2_get_drv_priv(vq)); +} + +void rvin_stop_streaming(struct rvin_dev *vin) { - struct rvin_dev *vin = vb2_get_drv_priv(vq); unsigned long flags; int retries = 0; @@ -1238,12 +1241,17 @@ static void rvin_stop_streaming(struct vb2_queue *vq) vin->scratch_phys); } +static void rvin_stop_streaming_vq(struct vb2_queue *vq) +{ + rvin_stop_streaming(vb2_get_drv_priv(vq)); +} + static const struct vb2_ops rvin_qops = { .queue_setup = rvin_queue_setup, .buf_prepare = rvin_buffer_prepare, .buf_queue = rvin_buffer_queue, - .start_streaming = rvin_start_streaming, - .stop_streaming = rvin_stop_streaming, + .start_streaming = rvin_start_streaming_vq, + .stop_streaming = rvin_stop_streaming_vq, .wait_prepare = vb2_ops_wait_prepare, .wait_finish = vb2_ops_wait_finish, }; diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h index d21fc991b7a9da36..700fae1c1225a2f3 100644 --- a/drivers/media/platform/rcar-vin/rcar-vin.h +++ b/drivers/media/platform/rcar-vin/rcar-vin.h @@ -269,4 +269,7 @@ void rvin_crop_scale_comp(struct rvin_dev *vin); int rvin_set_channel_routing(struct rvin_dev *vin, u8 chsel); +int rvin_start_streaming(struct rvin_dev *vin); +void rvin_stop_streaming(struct rvin_dev *vin); + #endif