From patchwork Thu Dec 14 19:08:32 2017 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: 10113155 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 BF1E960327 for ; Thu, 14 Dec 2017 19:09:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B096D28759 for ; Thu, 14 Dec 2017 19:09:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A582729178; Thu, 14 Dec 2017 19:09:39 +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=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 6394928759 for ; Thu, 14 Dec 2017 19:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754396AbdLNTJf (ORCPT ); Thu, 14 Dec 2017 14:09:35 -0500 Received: from smtp-3.sys.kth.se ([130.237.48.192]:34210 "EHLO smtp-3.sys.kth.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754344AbdLNTJX (ORCPT ); Thu, 14 Dec 2017 14:09:23 -0500 Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1]) by smtp-3.sys.kth.se (Postfix) with ESMTP id 624EA47DD; Thu, 14 Dec 2017 20:09:22 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-3.sys.kth.se ([127.0.0.1]) by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GD9G-h90zgK9; Thu, 14 Dec 2017 20:09:21 +0100 (CET) X-KTH-Auth: niso [89.233.230.99] X-KTH-mail-from: niklas.soderlund+renesas@ragnatech.se Received: from bismarck.berto.se (89-233-230-99.cust.bredband2.com [89.233.230.99]) by smtp-3.sys.kth.se (Postfix) with ESMTPSA id A6CD347CF; Thu, 14 Dec 2017 20:09:20 +0100 (CET) From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: linux-media@vger.kernel.org, Sakari Ailus Cc: linux-renesas-soc@vger.kernel.org, Laurent Pinchart , Kieran Bingham , Jacopo Mondi , Benoit Parrot , Maxime Ripard , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH/RFC v2 12/15] adv748x: csi2: switch to pad and stream aware s_stream Date: Thu, 14 Dec 2017 20:08:32 +0100 Message-Id: <20171214190835.7672-13-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171214190835.7672-1-niklas.soderlund+renesas@ragnatech.se> References: <20171214190835.7672-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 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 Switch the driver to implement the pad and stream aware s_stream operation. This is needed to enable to support to start and stop individual streams on a multiplexed pad. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- drivers/media/i2c/adv748x/adv748x-csi2.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/adv748x/adv748x-csi2.c b/drivers/media/i2c/adv748x/adv748x-csi2.c index a43b251d0bc67a43..39f993282dd3bb5c 100644 --- a/drivers/media/i2c/adv748x/adv748x-csi2.c +++ b/drivers/media/i2c/adv748x/adv748x-csi2.c @@ -128,22 +128,26 @@ static const struct v4l2_subdev_internal_ops adv748x_csi2_internal_ops = { * v4l2_subdev_video_ops */ -static int adv748x_csi2_s_stream(struct v4l2_subdev *sd, int enable) +static int adv748x_csi2_s_stream(struct v4l2_subdev *sd, unsigned int pad, + unsigned int stream, int enable) { struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); + struct adv748x_state *state = tx->state; struct v4l2_subdev *src; + if (pad != ADV748X_CSI2_SOURCE || stream != 0) + return -EINVAL; + src = adv748x_get_remote_sd(&tx->pads[ADV748X_CSI2_SINK]); if (!src) return -EPIPE; + adv_dbg(state, "%s: pad: %u stream: %u enable: %d\n", sd->name, + pad, stream, enable); + return v4l2_subdev_call(src, video, s_stream, enable); } -static const struct v4l2_subdev_video_ops adv748x_csi2_video_ops = { - .s_stream = adv748x_csi2_s_stream, -}; - /* ----------------------------------------------------------------------------- * v4l2_subdev_pad_ops * @@ -256,6 +260,7 @@ static const struct v4l2_subdev_pad_ops adv748x_csi2_pad_ops = { .get_fmt = adv748x_csi2_get_format, .set_fmt = adv748x_csi2_set_format, .get_frame_desc = adv748x_csi2_get_frame_desc, + .s_stream = adv748x_csi2_s_stream, }; /* ----------------------------------------------------------------------------- @@ -263,7 +268,6 @@ static const struct v4l2_subdev_pad_ops adv748x_csi2_pad_ops = { */ static const struct v4l2_subdev_ops adv748x_csi2_ops = { - .video = &adv748x_csi2_video_ops, .pad = &adv748x_csi2_pad_ops, };