I’m trying to migrate our V4L2 camera sensor driver to the Jetpack 6 developer preview image, which has the Jetson Linux 36.2 driver package.
The hardware setup is a Jetson Orin Nano Developer Kit, and it flashed with a JP6 SD card image.
Based on the below steps, create the new camera device tree.
Create the camera device tree overlay file.
compiled the dts and generated the dtbo file.
Copied the dtbo file to /kernel/dtbo
Using the ftdoverlay command, generate a new device tree file.
When the camera driver kernel module is inserted, the driver fails to create the video device and sub device. I have added the debug prints to the v4l2-asyn.c file.
The 5.15 kernel v4l2-async.c has removed the driver device name match type (V4L2_ASYNC_MATCH_DEVNAME) and it’s looking to match fwnode (V4L2_ASYNC_MATCH_FWNODE).
But it failed to match the fwnode from the below function of v4l2-asyn.c.
diff --git a/drivers/media/platform/tegra/camera/camera_common.c b/drivers/media/platform/tegra/camera/camera_common.c
index 126527c65..aa043a7f2 100644
--- a/drivers/media/platform/tegra/camera/camera_common.c
+++ b/drivers/media/platform/tegra/camera/camera_common.c
@@ -1,8 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * camera_common.c - utilities for tegra camera driver
- *
- * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+/* SPDX-License-Identifier: GPL-2.0-only
+ * SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -14,7 +11,7 @@
* more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/types.h>
#include <media/tegra-v4l2-camera.h>
@@ -82,6 +79,11 @@ static const struct camera_common_colorfmt camera_common_color_fmts[] = {
V4L2_COLORSPACE_SRGB,
V4L2_PIX_FMT_SGBRG12
},
+ {
+ MEDIA_BUS_FMT_SBGGR12_1X12,
+ V4L2_COLORSPACE_SRGB,
+ V4L2_PIX_FMT_SBGGR12
+ },
{
MEDIA_BUS_FMT_SRGGB10_1X10,
V4L2_COLORSPACE_SRGB,
Applied this patch and still it fails to register the sub device and video device. It failed to match the fwnode from the below function of v4l2-async.c
With reference to the tegra234-p3767-camera-p3768-imx219-A.dts file, I have created the dts file for my camera sensor and built the dtbo. I applied the overlay to the DTB.
During kernel booting, the tegra_vi_graph_init function of graph.c failed to register the notifier. But the endpoints and ports are parsed from the device tree. The __v4l2_async_notifier_add_subdev failed to add the subdev notifier. Another error I am seeing is the failure of v4l2_async_notifier_register in graph.c.
In this successful case, the camera sensor firmware node is added to the notifier_list. It can be displayed in the subdev debugfs file of /sys/kernel/debug/v4l2-async/pending_async_subdevices. Now the file is empty, and it doesn’t have any valid fw_nodes.
I tested with the tegra234-p3767-camera-p3768-imx219-A.dtbo and it didn’t register the pending async sub device. The same notifier registration failed in graph.c file.