Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2753552pxb; Thu, 3 Feb 2022 13:34:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyqKTZUQv30i6450B5AEPt8v6221n/2yRRV2zw+cgTWR1DwsPuh2pZyKwaytFrm8yBNZf/ X-Received: by 2002:a17:907:1b1a:: with SMTP id mp26mr30831978ejc.450.1643924049748; Thu, 03 Feb 2022 13:34:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643924049; cv=none; d=google.com; s=arc-20160816; b=I0vUBqp0/aVcGSHCu0C6sDJHos331Ab2vnC+Eu5N9uaOeKaVy00eZvQ+/RMFK2GdTz VniHIUqkQAy/aEe2EidUaciyWro6aOQYkQjy7Ri53rvPN5ioO2znP/tAkLPBXLnCHHma 7ufbjucybSqtz/DYC6jlhRbWtFhVRo3ZUkcHepSyM4SpAzwP1Jna/9V3FQnO1FNSXmp6 XhdZ6dX4znplWzMKxTfspu31WS0/N9DmMAtg8Iw8CjCj+d4Xp6/aYN8HitouKhxSSnU6 8tLgSBxE+tGH6IkVDypi1mtvc5BFoLnpayav4URvZci/9IMFfpuliB6R4EpWKd+aRCUa ZKcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bSnEi9mcX+YuKmTqIQUeBLo1QS25OYoHqN8kswu/E2g=; b=XgNaTK5Vu+wzbV+H4n65QnRyJ5xPz7uC4Gruuhnp8jbtzx29VWfXnE8tM0sZZ2CunZ rSIUOIgr+gB4en/wngPjYitvfknz15x4ix+VLRGi5CPqblMHOROMNJjdtQngtYDkZP8C HSJrc7YBnaAjwfUficqjrsBW83OB+PTjhHKQRcxrNRq89g+bs1BPd8W3bkhrGeD1YcKu tKlMYwIpdJmfylRy+T8KxTm3V//etx12Bg0sHFaEpnZfXkWVHH5JQLau2GC+iCG4W1dl rytguDgJ5PsFYd2MzSjd6Sydi7XE7vIZeNvozjXar3UQ96c8rEWcPFtz30UK5nL4AUDM Q0Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=vQbbsuH5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7si13323950edr.50.2022.02.03.13.33.45; Thu, 03 Feb 2022 13:34:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=vQbbsuH5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353337AbiBCRwP (ORCPT + 99 others); Thu, 3 Feb 2022 12:52:15 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:59048 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353221AbiBCRus (ORCPT ); Thu, 3 Feb 2022 12:50:48 -0500 Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:5173:4d3f:4ddc:2012]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 861C915AF; Thu, 3 Feb 2022 18:50:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1643910628; bh=xQPdfOYaPqm5LqRMzUqsI7qdKioFoUN0FG/TD8WEU2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vQbbsuH5e9POxqOOKZDs9xFefO2nnoi0snKDVU8UwlB/9iAyDT7iiuop0IGcS+pBG QldlvpM1Dq2t94fvDzgRmR4+2qyBgfA3ohqIVh8HFt1+piSjg7gUtTSTBM5+cnjs89 8RU6OG9FLLGRWyOdPbIWzttRSN2JsJpdeK/TAlJo= From: Jean-Michel Hautbois To: jeanmichel.hautbois@ideasonboard.com Cc: dave.stevenson@raspberrypi.com, devicetree@vger.kernel.org, kernel-list@raspberrypi.com, laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, lukasz@jany.st, mchehab@kernel.org, naush@raspberrypi.com, robh@kernel.org, tomi.valkeinen@ideasonboard.com, nsaenz@kernel.org, bcm-kernel-feedback-list@broadcom.com Subject: [RFC PATCH v4 09/12] media: imx219: Introduce the set_routing operation Date: Thu, 3 Feb 2022 18:50:06 +0100 Message-Id: <20220203175009.558868-10-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220203175009.558868-1-jeanmichel.hautbois@ideasonboard.com> References: <20220203175009.558868-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As we want to use multiplexed streams API, we need to be able to set the pad routing. Introduce the set_routing operation. As this operation is required for a multiplexed able sensor, add the V4L2_SUBDEV_FL_MULTIPLEXED flag. Signed-off-by: Jean-Michel Hautbois --- drivers/media/i2c/imx219.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index b68d35046725..7d29cf2b06f8 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -817,6 +817,25 @@ static int _imx219_set_routing(struct v4l2_subdev *sd, return 0; } +static int imx219_set_routing(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + enum v4l2_subdev_format_whence which, + struct v4l2_subdev_krouting *routing) +{ + int ret; + + if (routing->num_routes == 0 || routing->num_routes > 2) + return -EINVAL; + + v4l2_subdev_lock_state(state); + + ret = _imx219_set_routing(sd, state); + + v4l2_subdev_unlock_state(state); + + return ret; +} + static int imx219_init_cfg(struct v4l2_subdev *sd, struct v4l2_subdev_state *state) { @@ -1289,6 +1308,7 @@ static const struct v4l2_subdev_pad_ops imx219_pad_ops = { .get_fmt = imx219_get_pad_format, .set_fmt = imx219_set_pad_format, .get_selection = imx219_get_selection, + .set_routing = imx219_set_routing, .enum_frame_size = imx219_enum_frame_size, }; @@ -1547,7 +1567,8 @@ static int imx219_probe(struct i2c_client *client) /* Initialize subdev */ imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | - V4L2_SUBDEV_FL_HAS_EVENTS; + V4L2_SUBDEV_FL_HAS_EVENTS | + V4L2_SUBDEV_FL_MULTIPLEXED; imx219->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; /* Initialize source pad */ -- 2.32.0