Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2027848pxb; Wed, 2 Feb 2022 19:19:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDpG+u2F6ZD5itluWNampwiXYp6pWxaX5pgYTUGSj/gzJK9kQ35JI5AD8Pxq7x7bAIN4dR X-Received: by 2002:a63:380f:: with SMTP id f15mr26498323pga.60.1643858342473; Wed, 02 Feb 2022 19:19:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643858342; cv=none; d=google.com; s=arc-20160816; b=tbsK8VMy4VVG+LgN9Ekn+tpBDstKbEVpxJlA+qYIG1Mbys+1mU11Km3U7lCtLdyJMV Sdk2D3JVUzYwN17RpTG5FdazZWRIKukdj51oGnDmOwtleCJfevXvXsB22ECQQZIlaWJL 7BDLVtofNLsqOTtD75YjGizn/nl8lkdXgqPzWL/E0qbsxRFqGkDeVSuZ7U75P/NONJad 0i06MA71N8Zu+/eFgW22va3C88gXWnlyCGiE3KFO7Ti9NlYuaTO/2sniy06kOYY5+VS6 BGIcYYS/v7YU1fUVby6nDqn/6a/9LE70EVVOogcG1tQCzNLabQCd45YIASJntkWcgPWF IMSQ== 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=O8HSvIWWYFgqA7EEaEALAg6iXRn0kyf09zgHH5eJZhzFU7TxmtJdRs95TXlga2ZDQ/ DzW/x0Xcv9KW5Sbi7hFCVEYthBNTHNl0AWR8sho80kqMyoyEK70sKXaGKlt2liA1ExHD PYd0f+9BWySMC/bHdE9LmYNRyU5cB88e+eAmpPmG3VsWu/eHNW1RwRQ/r4VSe12+Ttey subv7IabURzqOw3zYxKpBYsYONAWwT1dVvqAkj//w7C+Q2/amGCA71H0f/54QUBnP7R5 0+ASsHGD8QtoaS0bi5iMTzOqwsIgkLJEvxm3uN9SsDmxgy4XMmglXa6jsmksghft2yCh 2TVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=G5KX6yrX; 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 f13si18890408pfv.190.2022.02.02.19.18.50; Wed, 02 Feb 2022 19:19:02 -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=G5KX6yrX; 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 S1346538AbiBBR5i (ORCPT + 99 others); Wed, 2 Feb 2022 12:57:38 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:58274 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346465AbiBBR5W (ORCPT ); Wed, 2 Feb 2022 12:57:22 -0500 Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:7139:eada:2ff6:73dd]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1DA451516; Wed, 2 Feb 2022 18:56:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1643824612; bh=xQPdfOYaPqm5LqRMzUqsI7qdKioFoUN0FG/TD8WEU2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G5KX6yrXPzdAIFrb7CNQGEY8635x+qP6AmlCWP2x20Vok6TPq6ZekkWd0FBry+PGM EVtEu4YTftoy/ILQ5yQIdtWi+r7H5Qfjzm+nHM7KQgs92v7vok8ImgLapxPFH3qOcj 952XaaNXzsWThRiXmbYpJRuVffoaIeg0DlNyndzw= 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 Subject: [RFC PATCH v3 08/11] media: imx219: Introduce the set_routing operation Date: Wed, 2 Feb 2022 18:56:36 +0100 Message-Id: <20220202175639.149681-9-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220202175639.149681-1-jeanmichel.hautbois@ideasonboard.com> References: <20220202175639.149681-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