From patchwork Sun Oct 17 18:24:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12564543 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE94AC433F5 for ; Sun, 17 Oct 2021 18:24:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8FBB460F8F for ; Sun, 17 Oct 2021 18:24:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344139AbhJQS0q (ORCPT ); Sun, 17 Oct 2021 14:26:46 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:60629 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344382AbhJQS0o (ORCPT ); Sun, 17 Oct 2021 14:26:44 -0400 Received: (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id A4407200005; Sun, 17 Oct 2021 18:24:31 +0000 (UTC) From: Jacopo Mondi To: tomi.valkeinen@ideasonboard.com, sakari.ailus@linux.intel.com, laurent.pinchart@ideasonboard.com, niklas.soderlund@ragnatech.se, kieran.bingham@ideasonboard.com Cc: Jacopo Mondi , Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 13/13] media: rcar-vin: Support multiplexed CSI-2 receiver Date: Sun, 17 Oct 2021 20:24:49 +0200 Message-Id: <20211017182449.64192-14-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211017182449.64192-1-jacopo+renesas@jmondi.org> References: <20211017182449.64192-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The R-Car CSI-2 receiver supports multiplexed streams. The VIN driver inspects the CSI-2 subdevice format with the intent of validating formats at stream start time. Each VIN instance is connected to a CSI-2 receiver which exposes a single stream and since it has acquired support for multiplexed streams maintains the format information in its v4l2_subdev_state per-stream. Instrument the VIN driver to fetch the CSI-2 receiver format from the streams configuration by setting the stream identifier to 0 and pass to the subdevice its own state where to retrieve format information from. Signed-off-by: Jacopo Mondi --- drivers/media/platform/rcar-vin/rcar-dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index 83b2f923cf98..a6f3701f3f3f 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -1119,7 +1119,8 @@ static int rvin_mc_validate_format(struct rvin_dev *vin, struct v4l2_subdev *sd, }; fmt.pad = pad->index; - if (v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt)) + fmt.stream = 0; + if (v4l2_subdev_call(sd, pad, get_fmt, sd->state, &fmt)) return -EPIPE; switch (fmt.format.code) {