From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E27C83093C6 for ; Thu, 9 Apr 2026 20:15:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775765704; cv=none; b=QUcPz7CUSOZ9IErjIMNJJNUF7MKbpzpNoFVSdpaUoXSQsjf5isbOXTOu7jNiatZRPlZdOJ0/0QedaKpzWW1T2aWz5C9da5JFpUFiBj65m86q/vA8SKbFEjtybhWzi0LTXzfa6TmP2193y8hPrBrxxaF11q7ytJluBBZ5VDIgUoI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775765704; c=relaxed/simple; bh=24WDH9sncOY1Nm+0wynAg+orhtieuY4fjuuYFQaI4SQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HiDrxp/YDKrRnL2qHUNJ1pwcbmsKang1sZJ8oKgS0hqlkyda9x83Oa5p59P806p74wrZDALLJWyiQ9kQMM6al4OUP1Az3GZhpBnZFUeSxrSJ1AUwQvQuXFjno/lWMsLYMaxsu5fDN5gjApa8bl6neWh1W0YWYgAYlZqsktUL3Ho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hUW0V0+9; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hUW0V0+9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775765703; x=1807301703; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=24WDH9sncOY1Nm+0wynAg+orhtieuY4fjuuYFQaI4SQ=; b=hUW0V0+97THEStwiO0Wz8gE2jN3NxypIwUVEG8F1qt/IMtgxVksVN6Sc 7DxCQUIllYp0mValWAaqFLy7aIszVX+d82gMI1oO5ssOggREAa9yFO/R5 kcmqte/PKB+TI1X27a+X63YNEKNnVsYROwAp8j67idXSJXKI3NWUqVxws QgXAQas4gAOuQoawUe3o/Uo0JGsT3dI+hNFvPM9m/1M93RWr9JZKAwXlJ FZq7dIqifm9Cvx4+/gWoy50fHe77SG7x/yunu0CwXvcfK6nwEpI7NSOq1 gVE+s4LdJbPsC/47aXBZpTZeTJNSaqfGvQAGwdbLoYQ9IV7PSipem29WK w==; X-CSE-ConnectionGUID: 6fPAzYpuS7aPnFrLXJvWUA== X-CSE-MsgGUID: uG2XPZ4NTfW188/46/hafQ== X-IronPort-AV: E=McAfee;i="6800,10657,11754"; a="87408504" X-IronPort-AV: E=Sophos;i="6.23,170,1770624000"; d="scan'208";a="87408504" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2026 13:15:01 -0700 X-CSE-ConnectionGUID: WFx4DdtNQmCpm8+fBD/ceQ== X-CSE-MsgGUID: GF4R2116T8Kia0OAYbirEA== X-ExtLoop1: 1 Received: from dalessan-mobl3.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.244.29]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2026 13:14:56 -0700 Received: from punajuuri.localdomain (unknown [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 11D55121CF3; Thu, 09 Apr 2026 23:15:03 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.98.2) (envelope-from ) id 1wAvmI-000000045oV-2Em1; Thu, 09 Apr 2026 23:15:02 +0300 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hans@jjverkuil.nl, laurent.pinchart@ideasonboard.com, Prabhakar , Kate Hsuan , Dave Stevenson , Tommaso Merciai , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck , Stefan Klug , Mirela Rabulea , =?UTF-8?q?Andr=C3=A9=20Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Mehdi Djait , Ricardo Ribalda Delgado , Hans de Goede , Jacopo Mondi , Tomi Valkeinen , David Plowman , "Yu, Ong Hock" , "Ng, Khai Wen" , Jai Luthra , Rishikesh Donadkar Subject: [PATCH v12 58/86] media: imx219: Report internal routes to userspace Date: Thu, 9 Apr 2026 23:14:33 +0300 Message-ID: <20260409201501.975242-59-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260409201501.975242-1-sakari.ailus@linux.intel.com> References: <20260409201501.975242-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Laurent Pinchart Usage of internal pads creates a route internal to the subdev, and the V4L2 camera sensor API requires such routes to be reported to userspace. Create the route in the .init_state() operation. Internal routing support requires stream support, so set the V4L2_SUBDEV_FL_STREAMS flag. As the route is immutable, there's no need to implement the .set_routing() operation. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus --- drivers/media/i2c/imx219.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index bb7b2e4b34fd..e79b26268415 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -1049,6 +1049,28 @@ static int imx219_get_selection(struct v4l2_subdev *sd, static int imx219_init_state(struct v4l2_subdev *sd, struct v4l2_subdev_state *state) { + struct v4l2_subdev_route routes[1] = { + { + .sink_pad = IMX219_PAD_IMAGE, + .sink_stream = 0, + .source_pad = IMX219_PAD_SOURCE, + .source_stream = IMX219_STREAM_IMAGE, + .flags = V4L2_SUBDEV_ROUTE_FL_ACTIVE | + V4L2_SUBDEV_ROUTE_FL_IMMUTABLE | + V4L2_SUBDEV_ROUTE_FL_STATIC, + }, + }; + struct v4l2_subdev_krouting routing = { + .len_routes = ARRAY_SIZE(routes), + .num_routes = ARRAY_SIZE(routes), + .routes = routes, + }; + int ret; + + ret = v4l2_subdev_set_routing(sd, state, &routing); + if (ret) + return ret; + struct v4l2_mbus_framefmt *pixel_array_format = v4l2_subdev_state_get_format(state, IMX219_PAD_IMAGE); struct v4l2_rect *analogue_crop = @@ -1349,7 +1371,8 @@ static int imx219_probe(struct i2c_client *client) if (ret) goto error_power_off; - imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_STREAMS; imx219->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; imx219->pads[IMX219_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE; -- 2.47.3