JetPack6.2 GMSL max96724 1920*1536*30 UYVY 4lane 2000M/lane Image acquisition timed out

I have a GMSL adapter board that connects to the NVIDIA Jetson via MIPI CSI. I will configure this adapter board through another SoC, and the NVIDIA board only needs to receive the MIPI data. How should I write the driver for NVIDIA? My NVIDIA board is Orin NX and I’m using Jetpack 6.2.

// SPDX-License-Identifier: GPL-2.0-only

// SPDX-FileCopyrightText: Copyright (c) 2018-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

/dts-v1/;

/plugin/;

define CAM0_RST TEGRA234_MAIN_GPIO(H, 3)

define CAM0_PWDN TEGRA234_MAIN_GPIO(H, 6)

define CAM1_PWDN TEGRA234_MAIN_GPIO(AC, 0)

define CAM_I2C_MUX TEGRA234_AON_GPIO(CC, 3)

include <dt-bindings/tegra234-p3767-0000-common.h>

/ {

overlay-name = “Jetson Camera zuojisi”;

jetson-header-name = “Jetson 24pin CSI Connector”;

compatible = JETSON_COMPATIBLE_P3768;

fragment@0 {

target-path = “/”;

_overlay_ {

zuojisi {

base {

label = “xcbase 20250517”;

};

branch {

label = “xcDeserializer4.0.01_4CAM_CAM1_4LANE 20260208”;

};

};

tegra-capture-vi {

num-channels = <4>;

ports {

#address-cells = <1>;

#size-cells = <0>;

status = “okay”;

/* Camera A - VC0 on CAM1 */

port@0 {

status = “okay”;

reg = <0>;

z_cam_a_vi_in0: endpoint {

status = “okay”;

vc-id = <0>;

port-index = <2>; /* CAM1 */

bus-width = <4>; /* 4 Lane */

remote-endpoint = <&z_cam_a_csi_out0>;

};

};

/* Camera B - VC1 on CAM1 */

port@1 {

status = “okay”;

reg = <1>;

z_cam_b_vi_in1: endpoint {

status = “okay”;

vc-id = <1>;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_b_csi_out1>;

};

};

/* Camera C - VC2 on CAM1 */

port@2 {

status = “okay”;

reg = <2>;

z_cam_c_vi_in2: endpoint {

status = “okay”;

vc-id = <2>;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_c_csi_out2>;

};

};

/* Camera D - VC3 on CAM1 */

port@3 {

status = “okay”;

reg = <3>;

z_cam_d_vi_in3: endpoint {

status = “okay”;

vc-id = <3>;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_d_csi_out3>;

};

};

};

};

tegra-camera-platform {

compatible = “nvidia, tegra-camera-platform”;

num_csi_lanes = <4>;

max_lane_speed = <2000000>; /* 2Gbps */

min_bits_per_pixel = <16>;

vi_peak_byte_per_pixel = <2>;

vi_bw_margin_pct = <25>;

max_pixel_rate = <10000000>; /* 1920*1536*30 */

isp_peak_byte_per_pixel = <2>;

isp_bw_margin_pct = <25>;

};

bus@0{

host1x@13e00000 {

nvcsi@15a00000 {

num-channels = <4>;

#address-cells = <1>;

#size-cells = <0>;

/* Channel 0: Camera A */

channel@0 {

status = “okay”;

reg = <0>;

ports {

status = “okay”;

#address-cells = <1>;

#size-cells = <0>;

port@0 {

status = “okay”;

reg = <0>;

z_cam_a_csi_in0: endpoint@0 {

status = “okay”;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_a_cam_out0>;

};

};

port@1 {

status = “okay”;

reg = <1>;

z_cam_a_csi_out0: endpoint@1 {

status = “okay”;

remote-endpoint = <&z_cam_a_vi_in0>;

};

};

};

};

/* Channel 1: Camera B */

channel@1 {

status = “okay”;

reg = <1>;

ports {

status = “okay”;

#address-cells = <1>;

#size-cells = <0>;

port@0 {

status = “okay”;

reg = <0>;

z_cam_b_csi_in1: endpoint@2 {

status = “okay”;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_b_cam_out1>;

};

};

port@1 {

status = “okay”;

reg = <1>;

z_cam_b_csi_out1: endpoint@3 {

status = “okay”;

remote-endpoint = <&z_cam_b_vi_in1>;

};

};

};

};

/* Channel 2: Camera C */

channel@2 {

status = “okay”;

reg = <2>;

ports {

status = “okay”;

#address-cells = <1>;

#size-cells = <0>;

port@0 {

status = “okay”;

reg = <0>;

z_cam_c_csi_in2: endpoint@4 {

status = “okay”;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_c_cam_out2>;

};

};

port@1 {

status = “okay”;

reg = <1>;

z_cam_c_csi_out2: endpoint@5 {

status = “okay”;

remote-endpoint = <&z_cam_c_vi_in2>;

};

};

};

};

/* Channel 3: Camera D */

channel@3 {

status = “okay”;

reg = <3>;

ports {

status = “okay”;

#address-cells = <1>;

#size-cells = <0>;

port@0 {

status = “okay”;

reg = <0>;

z_cam_d_csi_in3: endpoint@6 {

status = “okay”;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_d_cam_out3>;

};

};

port@1 {

status = “okay”;

reg = <1>;

z_cam_d_csi_out3: endpoint@7 {

status = “okay”;

remote-endpoint = <&z_cam_d_vi_in3>;

};

};

};

};

};

};

/* === cam_i2cmux 完全保留原始架构 === */

cam_i2cmux {

status = “okay”;

compatible = “i2c-mux-gpio”;

#address-cells = <1>;

#size-cells = <0>;

mux-gpios = <&gpio_aon CAM_I2C_MUX GPIO_ACTIVE_HIGH>;

i2c-parent = <&cam_i2c>;

i2c@0 {

reg = <0>;

#address-cells = <1>;

#size-cells = <0>;

status = “okay”;

z_dser_0: z_max96724 {

status = “okay”;

compatible = “zuojisi,z_max96724”;

reg = <0x27>;

is-master;

};

/* === Camera A === */

z_cam_a {

status = “okay”;

def-addr = <0x51>;

nvidia,gmsl-dser-device = <&z_dser_0>;

des-link = “A”;

compatible = “zuojisi,z_imx390_5200_9295”;

reg = <0x10>;

physical_w = “15.0”;

physical_h = “12.5”;

sensor_model = “cam_a”;

post_crop_frame_drop = “0”;

use_decibel_gain = “true”;

use_sensor_mode_id = “true”;

mode0 {

mclk_khz = “24000”;

num_lanes = “4”;

tegra_sinterface = “serial_c”; /* CAM1 */

vc_id = “0”; /* === 保持原始不变 === */

discontinuous_clk = “no”;

dpcm_enable = “false”;

cil_settletime = “0”;

dynamic_pixel_bit_depth = “16”;

csi_pixel_bit_depth = “16”;

mode_type = “yuv”;

pixel_phase = “uyvy”;

active_w = “1920”;

active_h = “1536”;

readout_orientation = “0”;

line_length = “0”;

inherent_gain = “1”;

pix_clk_hz = “176947200”;

serdes_pix_clk_hz = “800000000”;

gain_factor = “10”;

min_gain_val = “0”;

max_gain_val = “0”;

step_gain_val = “1”;

default_gain = “0”;

min_hdr_ratio = “1”;

max_hdr_ratio = “1”;

framerate_factor = “1000000”;

min_framerate = “30000000”;

max_framerate = “30000000”;

step_framerate = “1”;

default_framerate = “30000000”;

exposure_factor = “1000000”;

min_exp_time = “33”;

max_exp_time = “33333”;

step_exp_time = “1”;

default_exp_time = “33333”;

embedded_metadata_height = “0”;

};

ports {

#address-cells = <1>;

#size-cells = <0>;

port@0 {

reg = <0>;

z_cam_a_cam_out0: endpoint {

vc-id = <0>;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_a_csi_in0>;

};

};

};

gmsl-link {

num-ser-lanes = <4>;

streams = “yuv16”;

};

};

/* === Camera B === */

z_cam_b {

status = “okay”;

def-addr = <0x51>;

nvidia,gmsl-dser-device = <&z_dser_0>;

des-link = “B”;

compatible = “zuojisi,z_imx390_5200_9295”;

reg = <0x11>;

physical_w = “15.0”;

physical_h = “12.5”;

sensor_model = “cam_b”;

post_crop_frame_drop = “0”;

use_decibel_gain = “true”;

use_sensor_mode_id = “true”;

mode0 {

mclk_khz = “24000”;

num_lanes = “4”;

tegra_sinterface = “serial_c”;

vc_id = “1”; /* === 保持原始不变 === */

discontinuous_clk = “no”;

dpcm_enable = “false”;

cil_settletime = “0”;

dynamic_pixel_bit_depth = “16”;

csi_pixel_bit_depth = “16”;

mode_type = “yuv”;

pixel_phase = “uyvy”;

active_w = “1920”;

active_h = “1536”;

readout_orientation = “0”;

line_length = “0”;

inherent_gain = “1”;

pix_clk_hz = “176947200”;

serdes_pix_clk_hz = “800000000”;

gain_factor = “10”;

min_gain_val = “0”;

max_gain_val = “0”;

step_gain_val = “1”;

default_gain = “0”;

min_hdr_ratio = “1”;

max_hdr_ratio = “1”;

framerate_factor = “1000000”;

min_framerate = “30000000”;

max_framerate = “30000000”;

step_framerate = “1”;

default_framerate = “30000000”;

exposure_factor = “1000000”;

min_exp_time = “33”;

max_exp_time = “33333”;

step_exp_time = “1”;

default_exp_time = “33333”;

embedded_metadata_height = “0”;

};

ports {

#address-cells = <1>;

#size-cells = <0>;

port@0 {

reg = <0>;

z_cam_b_cam_out1: endpoint {

vc-id = <1>;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_b_csi_in1>;

};

};

};

gmsl-link {

num-ser-lanes = <4>;

streams = “yuv16”;

};

};

/* === Camera C === */

z_cam_c {

status = “okay”;

def-addr = <0x51>;

nvidia,gmsl-dser-device = <&z_dser_0>;

des-link = “C”;

compatible = “zuojisi,z_imx390_5200_9295”;

reg = <0x12>;

physical_w = “15.0”;

physical_h = “12.5”;

sensor_model = “cam_c”;

post_crop_frame_drop = “0”;

use_decibel_gain = “true”;

use_sensor_mode_id = “true”;

mode0 {

mclk_khz = “24000”;

num_lanes = “4”;

tegra_sinterface = “serial_c”;

vc_id = “2”; /* === 保持原始不变 === */

discontinuous_clk = “no”;

dpcm_enable = “false”;

cil_settletime = “0”;

dynamic_pixel_bit_depth = “16”;

csi_pixel_bit_depth = “16”;

mode_type = “yuv”;

pixel_phase = “uyvy”;

active_w = “1920”;

active_h = “1536”;

readout_orientation = “0”;

line_length = “0”;

inherent_gain = “1”;

pix_clk_hz = “176947200”;

serdes_pix_clk_hz = “800000000”;

gain_factor = “10”;

min_gain_val = “0”;

max_gain_val = “0”;

step_gain_val = “1”;

default_gain = “0”;

min_hdr_ratio = “1”;

max_hdr_ratio = “1”;

framerate_factor = “1000000”;

min_framerate = “30000000”;

max_framerate = “30000000”;

step_framerate = “1”;

default_framerate = “30000000”;

exposure_factor = “1000000”;

min_exp_time = “33”;

max_exp_time = “33333”;

step_exp_time = “1”;

default_exp_time = “33333”;

embedded_metadata_height = “0”;

};

ports {

#address-cells = <1>;

#size-cells = <0>;

port@0 {

reg = <0>;

z_cam_c_cam_out2: endpoint {

vc-id = <2>;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_c_csi_in2>;

};

};

};

gmsl-link {

num-ser-lanes = <4>;

streams = “yuv16”;

};

};

/* === Camera D === */

z_cam_d {

status = “okay”;

def-addr = <0x51>;

nvidia,gmsl-dser-device = <&z_dser_0>;

des-link = “D”;

compatible = “zuojisi,z_imx390_5200_9295”;

reg = <0x13>;

physical_w = “15.0”;

physical_h = “12.5”;

sensor_model = “cam_d”;

post_crop_frame_drop = “0”;

use_decibel_gain = “true”;

use_sensor_mode_id = “true”;

mode0 {

mclk_khz = “24000”;

num_lanes = “4”;

tegra_sinterface = “serial_c”;

vc_id = “3”; /* === 保持原始不变 === */

discontinuous_clk = “no”;

dpcm_enable = “false”;

cil_settletime = “0”;

dynamic_pixel_bit_depth = “16”;

csi_pixel_bit_depth = “16”;

mode_type = “yuv”;

pixel_phase = “uyvy”;

active_w = “1920”;

active_h = “1536”;

readout_orientation = “0”;

line_length = “0”;

inherent_gain = “1”;

pix_clk_hz = “176947200”;

serdes_pix_clk_hz = “800000000”;

gain_factor = “10”;

min_gain_val = “0”;

max_gain_val = “0”;

step_gain_val = “1”;

default_gain = “0”;

min_hdr_ratio = “1”;

max_hdr_ratio = “1”;

framerate_factor = “1000000”;

min_framerate = “30000000”;

max_framerate = “30000000”;

step_framerate = “1”;

default_framerate = “30000000”;

exposure_factor = “1000000”;

min_exp_time = “33”;

max_exp_time = “33333”;

step_exp_time = “1”;

default_exp_time = “33333”;

embedded_metadata_height = “0”;

};

ports {

#address-cells = <1>;

#size-cells = <0>;

port@0 {

reg = <0>;

z_cam_d_cam_out3: endpoint {

vc-id = <3>;

port-index = <2>;

bus-width = <4>;

remote-endpoint = <&z_cam_d_csi_in3>;

};

};

};

gmsl-link {

num-ser-lanes = <4>;

streams = “yuv16”;

};

};

};

};

};

};

};

};

/* zuojisi */

include <linux/gpio.h>

include <linux/module.h>

include <linux/of.h>

include <linux/of_device.h>

include <linux/of_gpio.h>

include <linux/uaccess.h>

include <linux/slab.h>

include <linux/fs.h>

include <media/camera_common.h>

include <linux/module.h>

include “z_max96724.h”

define max96724_TX11_PIPE_X_EN_ADDR 0x90B

define max96724_TX45_PIPE_X_DST_CTRL_ADDR 0x92D

define max96724_PIPE_X_SRC_0_MAP_ADDR 0x90D

define max96724_PHY_CLK (16)

struct max96724 {

struct i2c_client *i2c_client;

struct regmap *regmap;

struct mutex lock;

u8 link_lock_status;

u8 ismaster;

};

define CHECKNULL(x) if(x==NULL){ \

dev_err(NULL, “zuojisi %s: ##x## NULL ptr\n”,_func_); \

return -EINVAL; \

}

/* ========== FAKE I2C FUNCTIONS - Always return success ========== */

/* ========== EXPORTED APIs ========== */

int z_max96724_lock_link(struct device *dev)

{

struct max96724 *priv = NULL;

CHECKNULL(dev);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

mutex_lock(&priv->lock);

dev_info(dev,“zuojisi: mutex lock”);

return 0;

}

EXPORT_SYMBOL(z_max96724_lock_link);

int z_max96724_unlock_link(struct device *dev)

{

struct max96724 *priv = NULL;

CHECKNULL(dev);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

dev_info(dev,“zuojisi: mutex unlock”);

mutex_unlock(&priv->lock);

return 0;

}

EXPORT_SYMBOL(z_max96724_unlock_link);

int z_max96724_monopolize_link(struct device *dev, int link)

{

struct max96724 *priv = NULL;

CHECKNULL(dev);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

dev_info(dev, “zuojisi: %s: monopolize link_%c (FAKE)\n”, _func_, ‘A’+link);

return 0;

}

EXPORT_SYMBOL(z_max96724_monopolize_link);

int z_max96724_enable_link(struct device *dev, int link)

{

struct max96724 *priv = NULL;

CHECKNULL(dev);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

dev_info(dev, “zuojisi: %s: enable link_%c (FAKE)\n”, _func_, ‘A’+link);

priv->link_lock_status |= (1<<link);

return 0;

}

EXPORT_SYMBOL(z_max96724_enable_link);

int z_max96724_restore_link(struct device *dev)

{

struct max96724 *priv = NULL;

CHECKNULL(dev);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

dev_info(dev, “zuojisi: restore links (FAKE)\n”);

return 0;

}

EXPORT_SYMBOL(z_max96724_restore_link);

int z_max96724_check_link_status(struct device *dev, int link)

{

struct max96724 *priv = NULL;

CHECKNULL(dev);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

/* Always report as NOT occupied */

return 0;

}

EXPORT_SYMBOL(z_max96724_check_link_status);

int z_max96724_set_link_bandwidth(struct device *dev, int link, int gbps)

{

struct max96724 *priv = NULL;

CHECKNULL(dev);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

dev_info(dev, “zuojisi: set link_%c to %dGbps (FAKE)\n”,link+‘A’,gbps);

return 0;

}

EXPORT_SYMBOL(z_max96724_set_link_bandwidth);

/* ========== PIPELINE SETUP ========== */

static int max96724_setup_pipeline(struct device *dev,struct gmsl_link_ctx *g_ctx)

{

struct max96724 *priv = NULL;

int pipe_id = 0;

u32 i = 0;

u8 dst_vc = 0;

CHECKNULL(dev);

CHECKNULL(g_ctx);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

dev_info(dev,“zuojisi:96724: num_streams=%d (FAKE setup)\n”,g_ctx->num_streams);

for (i = 0; i < g_ctx->num_streams; i++) {

pipe_id = g_ctx->des_link;

dev_info(dev, “zuojisi: pipe_%d receive stream_id=%d, datatype=0x%x (FAKE)\n”,

pipe_id, i, g_ctx->streams[i]);

dst_vc = g_ctx->des_link;

dev_info(dev, “zuojisi: mapping pipe_%d → dst_vc=%d (FAKE)\n”, pipe_id, dst_vc);

}

return 0;

}

int z_max96724_start_streaming(struct device *dev, struct gmsl_link_ctx *g_ctx)

{

struct max96724 *priv = NULL;

int err;

CHECKNULL(dev);

CHECKNULL(g_ctx);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

dev_info(dev,“zuojisi: 96724 start streaming, link=%c - enter (FAKE)\n”,‘A’+g_ctx->des_link);

mutex_lock(&priv->lock);

err = max96724_setup_pipeline(dev, g_ctx);

if (err) {

mutex_unlock(&priv->lock);

return err;

}

mutex_unlock(&priv->lock);

dev_info(dev,“zuojisi: 96724 start streaming - exit (FAKE)\n”);

return 0;

}

EXPORT_SYMBOL(z_max96724_start_streaming);

int z_max96724_stop_streaming(struct device *dev, struct gmsl_link_ctx *g_ctx)

{

struct max96724 *priv = NULL;

CHECKNULL(dev);

CHECKNULL(g_ctx);

priv = dev_get_drvdata(dev);

CHECKNULL(priv);

dev_info(dev,“zuojisi: 96724 stop streaming, link_%c - enter (FAKE)\n”,‘A’+g_ctx->des_link);

mutex_lock(&priv->lock);

dev_info(dev,“zuojisi: 96724 stop streaming - exit (FAKE)\n”);

mutex_unlock(&priv->lock);

return 0;

}

EXPORT_SYMBOL(z_max96724_stop_streaming);

/* ========== OF MATCH ========== */

const struct of_device_id max96724_of_match[] = {

{ .compatible = “zuojisi,z_max96724”, },

{ },

};

MODULE_DEVICE_TABLE(of, max96724_of_match);

static int max96724_parse_dt(struct max96724 *priv,

struct i2c_client *client)

{

struct device_node *node = client->dev.of_node;

const struct of_device_id *match;

if (!node)

return -EINVAL;

match = of_match_device(max96724_of_match, &client->dev);

if (!match) {

dev_err(&client->dev, “Failed to find matching dt id\n”);

return -EFAULT;

}

return 0;

}

static struct regmap_config max96724_regmap_config =@0x0x{

.reg_bits = 16,

.val_bits = 8,

.cache_type = REGCACHE_RBTREE,

};

static int max96724_probe(struct i2c_client *client,

const struct i2c_device_id *id)

{

struct max96724 *priv;

int err = 0;

dev_info(&client->dev, “zuojisi: [max96724]: FAKE probing GMSL Deserializer @0x%x\n”,client->addr);

priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);

priv->i2c_client = client;

priv->regmap = devm_regmap_init_i2c(priv->i2c_client,

&max96724_regmap_config);

if (IS_ERR(priv->regmap)) {

dev_err(&client->dev,

“regmap init failed: %ld\n”, PTR_ERR(priv->regmap));

priv->regmap = NULL;

}

err = max96724_parse_dt(priv, client);

if (err) {

dev_err(&client->dev, “zuojisi: unable to parse dt\n”);

return -EFAULT;

}

mutex_init(&priv->lock);

dev_set_drvdata(&client->dev, priv);

dev_info(&client->dev, “zuojisi: %s: FAKE success (no I2C communication)\n”, _func_);

return err;

}

static int max96724_remove(struct i2c_client *client)

{

struct max96724 *priv;

if (client != NULL) {

priv = dev_get_drvdata(&client->dev);

if (priv)

mutex_destroy(&priv->lock);

}

return 0;

}

static const struct i2c_device_id max96724_id[] = {

{ “max96724”, 0 },

{ },

};

MODULE_DEVICE_TABLE(i2c, max96724_id);

static struct i2c_driver max96724_i2c_driver = {

.driver = {

.name = “z_max96724”,

.owner = THIS_MODULE,

.of_match_table = of_match_ptr(max96724_of_match),

},

.probe = max96724_probe,

.remove = max96724_remove,

.id_table = max96724_id,

};

static int __init max96724_init(void)

{

return i2c_add_driver(&max96724_i2c_driver);

}

static void __exit max96724_exit(void)

{

i2c_del_driver(&max96724_i2c_driver);

}

module_init(max96724_init);

module_exit(max96724_exit);

MODULE_DESCRIPTION(“GMSL Deserializer driver z_max96724 (FAKE I2C)”);

MODULE_AUTHOR(“zuojisi zuojisi@163.com”);

MODULE_LICENSE(“GPL v2”);

/*

* z_imx390_5200_9295.c - z_imx390_5200_9295 sensor driver

* zuojisi@163.com

* MODIFIED: FAKE I2C for Orin NX, 4 cameras on CAM1

*/

include <linux/slab.h>

include <linux/uaccess.h>

include <linux/gpio.h>

include <linux/module.h>

include <linux/seq_file.h>

include <linux/of.h>

include <linux/of_device.h>

include <linux/of_gpio.h>

include “z_max96724.h”

include <media/tegracam_core.h>

include “z_imx390_5200_9295_mode_tbls.h”

define MAX9295_ALTER_ADDR_BASE 0x20

const struct of_device_id z_imx390_5200_9295_of_match[] = {

{ .compatible = “zuojisi,z_imx390_5200_9295”,},

{ },

};

MODULE_DEVICE_TABLE(of, z_imx390_5200_9295_of_match);

static const u32 ctrl_cid_list[] = {

TEGRA_CAMERA_CID_SENSOR_MODE_ID,

};

struct z_imx390_5200_9295 {

struct i2c_client *i2c_client;

const struct i2c_device_id *id;

struct v4l2_subdev *subdev;

struct device *dser_dev;

struct camera_common_data *s_data;

struct tegracam_device *tc_dev;

struct gmsl_link_ctx g_ctx;

u32 def_addr;

u32 act_addr;

u32 des_link;

};

static const struct regmap_config sensor_regmap_config = {

.reg_bits = 16,

.val_bits = 8,

.cache_type = REGCACHE_RBTREE,

#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)

.use_single_rw = true,

#else

.use_single_read = true,

.use_single_write = true,

endif

};

static struct mutex serdes_lock__;

static int test_mode;

module_param(test_mode, int, 0644);

/* ========== FAKE I2C FUNCTIONS ========== */

static int z_imx390_5200_9295_read_reg(struct camera_common_data *s_data,

u16 addr, u8 *val)

{

*val = 0;

dev_info(s_data->dev,“zuojisi:z_imx390_5200_9295:FAKE r addr(0x%04x)<-0x00\n”,addr);

usleep_range(100, 110);

return 0;

}

static int z_imx390_5200_9295_write_reg(struct camera_common_data *s_data,

u16 addr, u8 val)

{

dev_info(s_data->dev,“zuojisi:z_imx390_5200_9295:FAKE w addr(0x%04x)->0x%02x\n”,addr,val);

usleep_range(100, 110);

return 0;

}

/* ========== POWER OPS ========== */

static int z_imx390_5200_9295_power_on(struct camera_common_data *s_data)

{

dev_info(s_data->dev, “zuojisi: %s (FAKE)\n”, _func_);

return 0;

}

static int z_imx390_5200_9295_power_off(struct camera_common_data *s_data)

{

dev_info(s_data->dev, “zuojisi: %s (FAKE)\n”, _func_);

return 0;

}

static int z_imx390_5200_9295_power_get(struct tegracam_device *tc_dev)

{

return 0;

}

static int z_imx390_5200_9295_power_put(struct tegracam_device *tc_dev)

{

return 0;

}

static int z_imx390_5200_9295_set_group_hold(struct tegracam_device *tc_dev, bool val)

{

dev_info(tc_dev->dev,“zuojisi: %s (FAKE)\n”,_func_);

return 0;

}

static struct tegracam_ctrl_ops z_imx390_5200_9295_ctrl_ops = {

.numctrls = ARRAY_SIZE(ctrl_cid_list),

.ctrl_cid_list = ctrl_cid_list,

.set_group_hold = z_imx390_5200_9295_set_group_hold,

};

static struct camera_common_pdata *z_imx390_5200_9295_parse_dt(struct tegracam_device *tc_dev)

{

struct device *dev = tc_dev->dev;

struct device_node *node = dev->of_node;

struct camera_common_pdata *board_priv_pdata;

const struct of_device_id *match;

if (!node)

return NULL;

match = of_match_device(z_imx390_5200_9295_of_match, dev);

if (!match) {

dev_err(dev, “Failed to find matching dt id\n”);

return NULL;

}

board_priv_pdata = devm_kzalloc(dev, sizeof(*board_priv_pdata), GFP_KERNEL);

return board_priv_pdata;

}

static int z_imx390_5200_9295_set_mode(struct tegracam_device *tc_dev)

{

dev_info(tc_dev->dev,“zuojisi:z_imx390_5200_9295 set mode (FAKE)\n”);

return 0;

}

static int z_imx390_5200_9295_start_streaming(struct tegracam_device *tc_dev)

{

struct z_imx390_5200_9295 *priv = (struct z_imx390_5200_9295 *)tegracam_get_privdata(tc_dev);

struct device *dev = tc_dev->dev;

int err;

mutex_lock(&serdes_lock__);

dev_info(dev,“zuojisi: z_imx390_5200_9295 start streaming link=%c - enter (FAKE)\n”, ‘A’+priv->des_link);

/* Skip all MAX9295 configuration */

err = z_max96724_start_streaming(priv->dser_dev, &priv->g_ctx);

if (err)

goto exit;

dev_info(dev,“zuojisi: z_imx390_5200_9295 start streaming - exit (FAKE)\n”);

mutex_unlock(&serdes_lock__);

return 0;

exit:

mutex_unlock(&serdes_lock__);

if(err){

dev_err(dev, “zuojisi: %s: error setting stream\n”, _func_);

}

return err;

}

static int z_imx390_5200_9295_stop_streaming(struct tegracam_device *tc_dev)

{

struct device *dev = tc_dev->dev;

struct z_imx390_5200_9295 *priv = (struct z_imx390_5200_9295 *)tegracam_get_privdata(tc_dev);

dev_info(dev,“zuojisi:z_imx390_5200_9295 stop streaming (FAKE)\n”);

z_max96724_stop_streaming(priv->dser_dev, &priv->g_ctx);

return 0;

}

static struct camera_common_sensor_ops z_imx390_5200_9295_common_ops = {

.numfrmfmts = ARRAY_SIZE(z_imx390_5200_9295_frmfmt),

.frmfmt_table = z_imx390_5200_9295_frmfmt,

.power_on = z_imx390_5200_9295_power_on,

.power_off = z_imx390_5200_9295_power_off,

.write_reg = z_imx390_5200_9295_write_reg,

.read_reg = z_imx390_5200_9295_read_reg,

.parse_dt = z_imx390_5200_9295_parse_dt,

.power_get = z_imx390_5200_9295_power_get,

.power_put = z_imx390_5200_9295_power_put,

.set_mode = z_imx390_5200_9295_set_mode,

.start_streaming = z_imx390_5200_9295_start_streaming,

.stop_streaming = z_imx390_5200_9295_stop_streaming,

};

static int z_imx390_5200_9295_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)

{

return 0;

}

static const struct v4l2_subdev_internal_ops z_imx390_5200_9295_subdev_internal_ops = {

.open = z_imx390_5200_9295_open,

};

/* ========== BOARD SETUP ========== */

static int z_imx390_5200_9295_board_setup(struct z_imx390_5200_9295 *priv)

{

struct device *dev = &priv->i2c_client->dev;

struct device_node *node = dev->of_node;

struct device_node *dser_node;

struct i2c_client *dser_i2c = NULL;

struct device_node *gmsl;

int value = 0xFFFF;

const char *str_value1[2],*str_value;

int i;

int err;

err = of_property_read_u32(node, “reg”, &priv->act_addr);

if (err < 0) {

dev_err(dev, “zuojisi: reg not found\n”);

goto error;

}

err = of_property_read_u32(node, “def-addr”,

&priv->def_addr);

if (err < 0) {

dev_err(dev, “zuojisi: def-addr not found\n”);

goto error;

}

priv->g_ctx.ser_dev = dev;

dser_node = of_parse_phandle(node, “nvidia,gmsl-dser-device”, 0);

if (dser_node == NULL) {

dev_err(dev,

“zuojisi: missing %s handle\n”, “nvidia,gmsl-dser-device”);

err = -EINVAL;

goto error;

}

dser_i2c = of_find_i2c_device_by_node(dser_node);

of_node_put(dser_node);

if (dser_i2c == NULL) {

dev_err(dev, “zuojisi: missing deserializer dev handle\n”);

err = -EINVAL;

goto error;

}

if (dser_i2c->dev.driver == NULL) {

dev_err(dev, “zuojisi: missing deserializer driver\n”);

err = -EINVAL;

goto error;

}

priv->dser_dev = &dser_i2c->dev;

priv->g_ctx.des_dev = &dser_i2c->dev;

err = of_property_read_string(node, “des-link”, &str_value);

if (err < 0) {

dev_err(dev, “zuojisi: des-link property is not found\n”);

return -EINVAL;

}

dev_info(dev, “zuojisi: link is %s\n”,str_value);

priv->des_link = str_value[0]-‘A’;

priv->g_ctx.des_link = priv->des_link;

/* populate g_ctx from DT */

gmsl = of_get_child_by_name(node, “gmsl-link”);

if (gmsl == NULL) {

dev_err(dev, “zuojisi: missing gmsl-link device node\n”);

err = -EINVAL;

goto error;

}

err = of_property_read_u32(gmsl, “num-ser-lanes”, &value);

if (err < 0) {

dev_err(dev, “zuojisi: No num-lanes info\n”);

goto error;

}

priv->g_ctx.num_ser_csi_lanes = value;

priv->g_ctx.num_streams =

of_property_count_strings(gmsl, “streams”);

if (priv->g_ctx.num_streams <= 0) {

dev_err(dev, “zuojisi: No streams found\n”);

err = -EINVAL;

goto error;

}

for (i = 0; i < priv->g_ctx.num_streams; i++) {

of_property_read_string_index(gmsl, “streams”, i,

&str_value1[i]);

if (!str_value1[i]) {

dev_err(dev, “zuojisi: invalid stream info\n”);

goto error;

}

if (!strcmp(str_value1[i], “raw12”)) {

priv->g_ctx.streams[i] =

GMSL_CSI_DT_RAW_12;

} else if (!strcmp(str_value1[i], “embed”)) {

priv->g_ctx.streams[i] =

GMSL_CSI_DT_EMBED;

} else if (!strcmp(str_value1[i], “ued-u1”)) {

priv->g_ctx.streams[i] =

GMSL_CSI_DT_UED_U1;

} else if (!strcmp(str_value1[i], “yuv16”)) {

priv->g_ctx.streams[i] =

GMSL_CSI_DT_YUV16;

} else {

dev_err(dev, “zuojisi: invalid stream data type\n”);

goto error;

}

}

priv->g_ctx.sensor_dev = dev;

return 0;

error:

dev_err(dev, “zuojisi: board setup failed\n”);

if(err==0) err=-EINVAL;

return err;

}

/* ========== PROBE ========== */

static int @0x@0ximx390_5200_9295_probe(struct i2c_client *client,

const struct i2c_device_id *id)

{

struct device *dev = &client->dev;

struct device_node *node = dev->of_node;

struct tegracam_device *tc_dev;

struct z_imx390_5200_9295 *priv;

int err;

dev_info(dev, “zuojisi: probing v4l2 sensor @0x%x (FAKE I2C)\n”,client->addr);

if (!IS_ENABLED(CONFIG_OF) || !node)

return -EINVAL;

priv = devm_kzalloc(dev, sizeof(struct z_imx390_5200_9295), GFP_KERNEL);

if (!priv) {

dev_err(dev, “zuojisi: unable to allocate memory!\n”);

return -ENOMEM;

}

tc_dev = devm_kzalloc(dev,

sizeof(struct tegracam_device), GFP_KERNEL);

if (!tc_dev)

return -ENOMEM;

priv->i2c_client = tc_dev->client = client;

tc_dev->dev = dev;

strncpy(tc_dev->name, “z_imx390_5200_9295”, sizeof(tc_dev->name));

tc_dev->dev_regmap_config = &sensor_regmap_config;

tc_dev->sensor_ops = &z_imx390_5200_9295_common_ops;

tc_dev->v4l2sd_internal_ops = &z_imx390_5200_9295_subdev_internal_ops;

tc_dev->tcctrl_ops = &z_imx390_5200_9295_ctrl_ops;

err = z_imx390_5200_9295_board_setup(priv);

if (err) {

dev_err(dev, “zuojisi: board setup failed\n”);

return err;

}

z_max96724_lock_link(priv->dser_dev);

if ( z_max96724_check_link_status(priv->dser_dev, priv->des_link) ){

z_max96724_unlock_link(priv->dser_dev);

dev_err(dev, “zuojisi: link_%c is occupied\n”,‘A’+priv->des_link);

return -EINVAL;

}

err = tegracam_device_register(tc_dev);

if (err) {

z_max96724_unlock_link(priv->dser_dev);

dev_err(dev, “zuojisi: tegra camera driver registration failed\n”);

return err;

}

priv->tc_dev = tc_dev;

priv->s_data = tc_dev->s_data;

priv->subdev = &tc_dev->s_data->subdev;

tegracam_set_privdata(tc_dev, (void *)priv);

z_max96724_monopolize_link(priv->dser_dev, priv->des_link);

/* Skip all I2C initialization - other SoC handles it */

dev_info(dev, “zuojisi: Skipping all I2C sensor init (FAKE mode)\n”);

z_max96724_enable_link(priv->dser_dev, priv->des_link);

z_max96724_restore_link(priv->dser_dev);

z_max96724_unlock_link(priv->dser_dev);

err = tegracam_v4l2subdev_register(tc_dev, true);

if (err) {

dev_err(dev, “zuojisi: tegra camera subdev registration failed\n”);

return err;

}

dev_info(&client->dev, “zuojisi:Detected z_imx390_5200_9295 sensor (FAKE mode)\n”);

return 0;

}

static int z_imx390_5200_9295_remove(struct i2c_client *client)

{

struct camera_commo@@0xx_data *s_data = to_camera_common_data(&client->dev);

struct z_imx390_5200_9295 *priv = (struct z_imx390_5200_9295 *)s_data->priv;

tegracam_v4l2subdev_unregister(priv->tc_dev);

tegracam_device_unregister(priv->tc_dev);

dev_info(&client->dev,“zuojisi, z_imx390_5200_9295_remove sensor @0x%x.\n”,client->addr);

return 0;

}

static const struct i2c_device_id z_imx390_5200_9295_id[] = {

{ “z_imx390_5200_9295”, 0 },

{ }

};

MODULE_DEVICE_TABLE(i2c, z_imx390_5200_9295_id);

static struct i2c_driver z_imx390_5200_9295_i2c_driver = {

.driver = {

.name = “z_imx390_5200_9295”,

.owner = THIS_MODULE,

.of_match_table = of_match_ptr(z_imx390_5200_9295_of_match),

},

.probe = z_imx390_5200_9295_probe,

.remove = z_imx390_5200_9295_remove,

.id_table = z_imx390_5200_9295_id,

};

static int __init z_imx390_5200_9295_init(void)

{

mutex_init(&serdes_lock__);

return i2c_add_driver(&z_imx390_5200_9295_i2c_driver);

}

static void __exit z_imx390_5200_9295_exit(void)

{

mutex_destroy(&serdes_lock__);

i2c_del_driver(&z_imx390_5200_9295_i2c_driver);

}

late_initcall(z_imx390_5200_9295_init);

module_exit(z_imx390_5200_9295_exit);

MODULE_DESCRIPTION(“Media Controller driver for z_imx390_5200_9295 (FAKE I2C)”);

MODULE_AUTHOR(“zuojisi@163.com”);

MODULE_LICENSE(“GPL v2”);

vi-output, z_im-5079 [003] … 1715.109986: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

 kworker/7:2-184     \[007\] .......  1715.159274: rtcpu_vinotify_event: tstamp:54404995900 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1740957553984 data:0x799e300010000000      

 kworker/7:2-184     \[007\] .......  1715.159277: rtcpu_vinotify_event: tstamp:54404996042 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1740957591808 data:0x0000000031000001      

 kworker/7:2-184     \[007\] .......  1715.159278: rtcpu_vinotify_event: tstamp:54404996197 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:1740957611328 data:0x0000000007020001    

 kworker/7:2-184     \[007\] .......  1715.159279: rtcpu_vinotify_event: tstamp:54404996334 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1740958622816 data:0x799e2d0010000000      

 kworker/7:2-184     \[007\] .......  1715.159280: rtcpu_vinotify_event: tstamp:54404996488 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1740958661280 data:0x0000000031000002      

 kworker/7:2-184     \[007\] .......  1717.571164: rtcpu_nvcsi_intr: tstamp:54481761270 class:GLOBAL type:PHY_INTR0 phy:1 cil:0 st:0 vc:0 status:0x01c00000                                         

 kworker/7:2-184     \[007\] .......  1717.571168: rtcpu_nvcsi_intr: tstamp:54481761270 class:GLOBAL type:PHY_INTR0 phy:1 cil:1 st:0 vc:0 status:0x00c00000                                         

 kworker/7:2-184     \[007\] .......  1717.627394: rtcpu_vinotify_error: tstamp:54482880375 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743452050432 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.627399: rtcpu_vinotify_event: tstamp:54483121774 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743451995488 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.627399: rtcpu_vinotify_event: tstamp:54483121930 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743452050432 data:0x00000000000003c9    

vi-output, z_im-5080 [006] … 1717.668125: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-5079 [003] … 1717.668640: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

vi-output, z_im-5079 [003] … 1717.669716: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

 kworker/7:2-184     \[007\] .......  1717.683184: rtcpu_vinotify_error: tstamp:54483922016 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743485382752 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.683188: rtcpu_vinotify_event: tstamp:54484098254 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743481556480 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.683189: rtcpu_vinotify_event: tstamp:54484098407 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743485327808 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.683190: rtcpu_vinotify_event: tstamp:54484098543 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743485382752 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.683190: rtcpu_vinotify_event: tstamp:54484917625 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743514888928 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.683191: rtcpu_vinotify_event: tstamp:54484917764 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1743517278624 data:0x799e300010000000      

 kworker/7:2-184     \[007\] .......  1717.683192: rtcpu_vinotify_error: tstamp:54484963652 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743518715200 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.739168: rtcpu_vinotify_event: tstamp:54485368019 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1743517420192 data:0x0000000031000001      

 kworker/7:2-184     \[007\] .......  1717.739170: rtcpu_vinotify_event: tstamp:54485368162 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:1743517439712 data:0x0000000007020001    

 kworker/7:2-184     \[007\] .......  1717.739171: rtcpu_vinotify_event: tstamp:54485368316 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1743518356096 data:0x799e2d0010000000      

 kworker/7:2-184     \[007\] .......  1717.739171: rtcpu_vinotify_event: tstamp:54485368455 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1743518397536 data:0x0000000031000002      

 kworker/7:2-184     \[007\] .......  1717.739172: rtcpu_vinotify_event: tstamp:54485368604 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743518660224 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.739173: rtcpu_vinotify_event: tstamp:54485368735 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743518715200 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.739174: rtcpu_vinotify_error: tstamp:54486005283 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743552047456 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.739175: rtcpu_vinotify_event: tstamp:54486344505 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743548221216 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.739176: rtcpu_vinotify_event: tstamp:54486344641 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743551992544 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.739177: rtcpu_vinotify_event: tstamp:54486344793 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743552047456 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.739177: rtcpu_vinotify_error: tstamp:54487046922 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743585379968 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.795170: rtcpu_vinotify_event: tstamp:54487321043 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743581553696 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.795173: rtcpu_vinotify_event: tstamp:54487321192 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743585325024 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.795173: rtcpu_vinotify_event: tstamp:54487321325 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743585379968 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.795176: rtcpu_vinotify_error: tstamp:54488088556 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743618712256 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.795176: rtcpu_vinotify_event: tstamp:54488297488 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743614885984 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.795177: rtcpu_vinotify_event: tstamp:54488297621 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743618657280 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.795177: rtcpu_vinotify_event: tstamp:54488297778 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743618712256 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.851336: rtcpu_vinotify_event: tstamp:54489009599 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743648218464 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.851340: rtcpu_vinotify_error: tstamp:54489130199 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743652044736 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.851341: rtcpu_vinotify_event: tstamp:54489470116 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743651989792 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.851342: rtcpu_vinotify_event: tstamp:54489470252 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743652044736 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.851343: rtcpu_vinotify_error: tstamp:54490171834 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743685377024 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.851344: rtcpu_vinotify_event: tstamp:54490446612 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743681550752 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.851344: rtcpu_vinotify_event: tstamp:54490446747 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743685322048 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.851345: rtcpu_vinotify_event: tstamp:54490446899 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743685377024 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.907165: rtcpu_vinotify_error: tstamp:54491213473 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743718709504 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.907167: rtcpu_vinotify_event: tstamp:54491423088 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743714883264 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.907168: rtcpu_vinotify_event: tstamp:54491423240 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743718654560 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.907169: rtcpu_vinotify_event: tstamp:54491423375 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743718709504 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.907169: rtcpu_vinotify_error: tstamp:54492255108 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743752041792 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.963333: rtcpu_vinotify_event: tstamp:54492399580 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743748215520 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.963335: rtcpu_vinotify_event: tstamp:54492399717 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743751986848 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.963337: rtcpu_vinotify_event: tstamp:54492399868 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743752041792 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.963340: rtcpu_vinotify_error: tstamp:54493296741 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743785374112 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1717.963340: rtcpu_vinotify_event: tstamp:54493376073 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743781547872 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1717.963341: rtcpu_vinotify_event: tstamp:54493376222 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743785319200 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1717.963342: rtcpu_vinotify_event: tstamp:54493376354 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743785374112 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1718.019172: rtcpu_vinotify_error: tstamp:54494339360 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743818706560 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1718.019176: rtcpu_vinotify_event: tstamp:54494339666 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743814880320 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1718.019176: rtcpu_vinotify_event: tstamp:54494339800 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743818651616 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1718.019177: rtcpu_vinotify_event: tstamp:54494791641 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743818706560 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1718.019178: rtcpu_vinotify_event: tstamp:54495280501 cch:-1 vi:1 tag:FE channel:0x00 frame:0 vi_tstamp:1743848212576 data:0x0000000000000022                 

 kworker/7:2-184     \[007\] .......  1718.019179: rtcpu_vinotify_error: tstamp:54495380027 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743852038848 data:0x00000000000003c9    

 kworker/7:2-184     \[007\] .......  1718.019180: rtcpu_vinotify_event: tstamp:54495769114 cch:-1 vi:1 tag:FS channel:0x00 frame:0 vi_tstamp:1743851983872 data:0x0000000000000012                 

 kworker/7:2-184     \[007\] .......  1718.019181: rtcpu_vinotify_event: tstamp:54495769250 cch:-1 vi:1 tag:CHANSEL_NOMATCH channel:0x04 frame:0 vi_tstamp:1743852038848 data:0x00000000000003c9    

vi-output, z_im-5080 [006] … 1720.228274: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-5079 [003] … 1720.228508: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

vi-output, z_im-5079 [003] … 1720.229598: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

 kworker/7:2-184     \[007\] .......  1720.271080: rtcpu_vinotify_event: tstamp:54565105623 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1746077144832 data:0x799e300010000000      

 kworker/7:2-184     \[007\] .......  1720.271083: rtcpu_vinotify_event: tstamp:54565105759 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1746077182688 data:0x0000000031000001      

 kworker/7:2-184     \[007\] .......  1720.271084: rtcpu_vinotify_event: tstamp:54565105912 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:1746077202208 data:0x0000000007020001    

 kworker/7:2-184     \[007\] .......  1720.271085: rtcpu_vinotify_event: tstamp:54565106057 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1746078244608 data:0x799e2d0010000000      

 kworker/7:2-184     \[007\] .......  1720.271086: rtcpu_vinotify_event: tstamp:54565106209 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1746078283072 data:0x0000000031000002      

vi-output, z_im-5080 [004] … 1722.788104: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-5079 [003] … 1722.788464: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

vi-output, z_im-5079 [003] … 1722.789552: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

 kworker/7:2-184     \[007\] .......  1722.846968: rtcpu_vinotify_event: tstamp:54645184579 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1748637108256 data:0x799e300010000000      

 kworker/7:2-184     \[007\] .......  1722.846971: rtcpu_vinotify_event: tstamp:54645184736 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1748637146144 data:0x0000000031000001      

 kworker/7:2-184     \[007\] .......  1722.846972: rtcpu_vinotify_event: tstamp:54645184871 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:1748637165632 data:0x0000000007020001    

 kworker/7:2-184     \[007\] .......  1722.846973: rtcpu_vinotify_event: tstamp:54645185023 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1748638179904 data:0x799e2d0010000000      

 kworker/7:2-184     \[007\] .......  1722.846974: rtcpu_vinotify_event: tstamp:54645185167 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1748638218368 data:0x0000000031000002      

vi-output, z_im-5080 [004] … 1725.348144: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-5079 [003] … 1725.348293: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

vi-output, z_im-5079 [003] … 1725.349261: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

 kworker/7:2-184     \[007\] .......  1725.374859: rtcpu_vinotify_event: tstamp:54724908566 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1751196951072 data:0x799e300010000000      

 kworker/7:2-184     \[007\] .......  1725.374863: rtcpu_vinotify_event: tstamp:54724908707 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1751196988928 data:0x0000000031000001      

 kworker/7:2-184     \[007\] .......  1725.374864: rtcpu_vinotify_event: tstamp:54725360920 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:1751197087808 data:0x0000000007020001    

 kworker/7:2-184     \[007\] .......  1725.374865: rtcpu_vinotify_event: tstamp:54725361059 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1751197909088 data:0x799e2d0010000000      

 kworker/7:2-184     \[007\] .......  1725.374865: rtcpu_vinotify_event: tstamp:54725361214 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1751197947552 data:0x0000000031000002      

vi-output, z_im-5080 [004] … 1727.908049: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-5079 [003] … 1727.908201: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

vi-output, z_im-5079 [003] … 1727.909129: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

 kworker/7:2-184     \[007\] .......  1727.910771: rtcpu_vinotify_event: tstamp:54804951244 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1753756885696 data:0x799e300010000000      

 kworker/7:2-184     \[007\] .......  1727.910774: rtcpu_vinotify_event: tstamp:54804951398 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1753756923520 data:0x0000000031000001      

 kworker/7:2-184     \[007\] .......  1727.910774: rtcpu_vinotify_event: tstamp:54804951533 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:1753756943040 data:0x0000000007020001    

 kworker/7:2-184     \[007\] .......  1727.910775: rtcpu_vinotify_event: tstamp:54804951685 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1753757763456 data:0x799e2d0010000000      

 kworker/7:2-184     \[007\] .......  1727.910775: rtcpu_vinotify_event: tstamp:54804951817 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1753757801920 data:0x0000000031000002      

vi-output, z_im-5080 [004] … 1730.468098: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-5079 [003] … 1730.468251: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

vi-output, z_im-5079 [003] … 1730.469338: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

 kworker/7:2-184     \[007\] .......  1730.486668: rtcpu_vinotify_event: tstamp:54885030383 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1756316885056 data:0x799e300010000000      

 kworker/7:2-184     \[007\] .......  1730.486672: rtcpu_vinotify_event: tstamp:54885030521 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1756316922912 data:0x0000000031000001      

 kworker/7:2-184     \[007\] .......  1730.486673: rtcpu_vinotify_event: tstamp:54885030677 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:1756316945216 data:0x0000000007020001    

 kworker/7:2-184     \[007\] .......  1730.486674: rtcpu_vinotify_event: tstamp:54885030812 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1756317956768 data:0x799e2d0010000000      

 kworker/7:2-184     \[007\] .......  1730.486674: rtcpu_vinotify_event: tstamp:54885030965 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1756317995232 data:0x0000000031000002      

vi-output, z_im-5080 [004] … 1733.027992: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-5079 [003] … 1733.029457: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

vi-output, z_im-5079 [003] … 1733.029608: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:388 pid:5079 tid:5079

 kworker/7:2-184     \[007\] .......  1733.074556: rtcpu_vinotify_event: tstamp:54964945904 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1758878097824 data:0x799e300010000000      

 kworker/7:2-184     \[007\] .......  1733.074560: rtcpu_vinotify_event: tstamp:54964946065 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1758878135680 data:0x0000000031000001      

 kworker/7:2-184     \[007\] .......  1733.074561: rtcpu_vinotify_event: tstamp:54964946201 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:1758878182784 data:0x0000000007020001    

 kworker/7:2-184     \[007\] .......  1733.074562: rtcpu_vinotify_event: tstamp:54965402499 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:1758878322912 data:0x799e2d0010000000      

 kworker/7:2-184     \[007\] .......  1733.074563: rtcpu_vinotify_event: tstamp:54965402638 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp

*** Please note that this reply is generated by LLM automatically ***

To write a driver for the NVIDIA Jetson Orin NX, you need to create a device tree overlay that defines the hardware module and its properties. The device tree overlay should include the following:

  1. overlay-name: a unique name for the hardware module.
  2. jetson-header-name: the expansion header with which the hardware module is associated.
  3. compatible: the combination of Jetson module and carrier board that the overlay supports.

In your case, since you are using the MIPI CSI connector, you should set jetson-header-name to Jetson 22pin CSI Connector.

To configure the I2S and Codec DAI Link, you need to define a DAI link with a unique link-name and specify the cpu and codec properties. The cpu property should point to the SoC audio interface’s device node, and the codec property should point to the codec board’s device node.

In your case, you can override the I2S1 DAI link used by an SGTL5000 audio codec, as shown in the example:

&i2s1_to_codec {
    link-name = "fe-pi-audio-z-v2";
    bitclock-master;
    frame-master;

    codec {
        sound-dai = <&sgtl5000>;
        prefix = “H40-SGTL”;
    };
};

Note that the DAI link instance associated with the 40-pin GPIO expansion header is Jetson device-specific.

To write a driver for the GMSL adapter board, you can use the zmax96724 driver as a reference. The zmax96724 driver is a GMSL Deserializer driver that provides functions for locking and unlocking the link, monopolizing the link, and enabling and disabling the link.

You can also use the zimx39052009295 driver as a reference, which is a sensor driver that provides functions for setting up the sensor, starting and stopping streaming, and handling power management.

To write a driver for the NVIDIA Jetson Orin NX, you need to create a device tree overlay that defines the hardware module and its properties, and then use the zmax96724 and zimx39052009295 drivers as references to implement the necessary functions for the GMSL adapter board.

Here is an example of how you can create a device tree overlay for the GMSL adapter board:

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/tegra-gpio.h>

/ {
    compatible = "nvidia,tegra234-ape";
    model = "NVIDIA Jetson Orin NX";
    status = "okay";

    i2c@3160000 {
        zmax96724@27 {
            compatible = "zuojisizmax96724";
            reg = <0x27>;
            status = "okay";
        };
    };

    i2c@31e0000 {
        zimx39052009295@10 {
            compatible = "zuojisizimx39052009295";
            reg = <0x10>;
            status = "okay";
        };
    };

    overlay-name = "GMSL-Adapter-Board";
    jetson-header-name = "Jetson 22pin CSI Connector";
    compatible = "nvidia,tegra234-ape";
};

Note that this is just an example, and you may need to modify it to fit your specific use case.

To write a driver for the GMSL adapter board, you can use the following code as a reference:

#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/tegra-gpio.h>

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Your Name");
MODULE_DESCRIPTION("GMSL Adapter Board Driver");

static int gmsl_adapter_board_probe(struct i2c_client *client)
{
    struct zmax96724 *priv;
    int err;

    priv = devm_kzalloc(&client->dev, sizeof(struct zmax96724), GFP_KERNEL);
    if (!priv)
        return -ENOMEM;

    priv->i2c_client = client;
    priv->regmap = devm_regmap_init_i2c(&client->dev, &zmax96724_regmap_config);
    if (IS_ERR(priv->regmap))
        return PTR_ERR(priv->regmap);

    err = zmax96724_lock_link(priv);
    if (err)
        return err;

    err = zmax96724_monopolize_link(priv, 0);
    if (err)
        return err;

    err = zmax96724_enable_link(priv, 0);
    if (err)
        return err;

    return 0;
}

static int gmsl_adapter_board_remove(struct i2c_client *client)
{
    struct zmax96724 *priv;

    priv = dev_get_drvdata(&client->dev);
    if (!priv)
        return 0;

    zmax96724_unlock_link(priv);
    zmax96724_disable_link(priv, 0);

    return 0;
}

static const struct i2c_device_id gmsl_adapter_board_id[] = {
    { "zmax96724", 0 },
    { }
};

MODULE_DEVICE_TABLE(i2c, gmsl_adapter_board_id);

static struct i2c_driver gmsl_adapter_board_driver = {
    .driver = {
        .name = "gmsl-adapter-board",
        .owner = THIS_MODULE,
    },
    .probe = gmsl_adapter_board_probe,
    .remove = gmsl_adapter_board_remove,
    .id_table = gmsl_adapter_board_id,
};

module_i2c_driver(gmsl_adapter_board_driver);

Note that this is just an example, and you may need to modify it to fit your specific use case.

To write a driver for the NVIDIA Jetson Orin NX, you need to create a device tree overlay that defines the hardware module and its properties, and then use the zmax96724 and zimx39052009295 drivers as references to implement the necessary functions for the GMSL adapter board.

You can use the following code as a reference:

#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/tegra-gpio.h>

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Your Name");
MODULE_DESCRIPTION("NVIDIA Jetson Orin NX Driver");

static int jetson_orin_nx_probe(struct platform_device *pdev)
{
    struct device_node *np = pdev->dev.of_node;
    struct i2c_client *client;
    struct zmax96724 *priv;
    int err;

    client = of_find_i2c_device_by_node(np, "zmax96724");
    if (!client)
        return -ENODEV;

    priv = devm_kzalloc(&pdev->dev, sizeof(struct zmax96724), GFP_KERNEL);
    if (!priv)
        return -ENOMEM;

    priv->i2c_client = client;
    priv->regmap = devm_regmap_init_i2c(&client->dev, &zmax96724_regmap_config);
    if (IS_ERR(priv->regmap))
        return PTR_ERR(priv->regmap);

    err = zmax96724_lock_link(priv);
    if (err)
        return err;

    err = zmax96724_monopolize_link(priv, 0);
    if (err)
        return err;

    err = zmax96724_enable_link(priv, 0);
    if (err)
        return err;

    return 0;
}

static int jetson_orin_nx_remove(struct platform_device *pdev)
{
    struct device_node *np = pdev->dev.of_node;
    struct i2c_client *client;
    struct zmax96724 *priv;

    client = of_find_i2c_device_by_node(np, "zmax96724");
    if (!client)
        return 0;

    priv = dev_get_drvdata(&client->dev);
    if (!priv)
        return 0;

    zmax96724_unlock_link(priv);
    zmax96724_disable_link(priv, 0);

    return 0;
}

static const struct of_device_id jetson_orin_nx_id[] = {
    { .compatible = "nvidia,tegra234-ape" },
    { }
};

MODULE_DEVICE_TABLE(of, jetson_orin_nx_id);

static struct platform_driver jetson_orin_nx_driver = {
    .driver = {
        .name = "jetson-orin-nx",
        .owner = THIS_MODULE,
        .of_match_table = jetson_orin_nx_id,
    },
    .probe = jetson_orin_nx_probe,
    .remove = jetson_orin_nx_remove,
};

module_platform_driver(jetson_orin_nx_driver);

Note that this is just an example, and you may need to modify it to fit your specific use case.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

HI!,This is quite different from what I’m currently experiencing. I don’t quite understand it.

hello 1194400158

it looks you’re having device node registered, but you’re having issues when fetching the stream.

let me give you VI tracing logs with a success image capture as an example
here must be one pair of CHANSEL_PXL_SOF/CHANSEL_PXL_EOF to indicate a frame has detected by VI engine.
afterwards, it’s ATOMP_FRAME_DONE to indicate it’s complete writing a frame to memory.

rtcpu_vinotify_event: tstamp:4058867917 cch:-1 vi:0 tag:CSIMUX_STREAM channel:0x00 frame:0 vi_tstamp:129874754944 data:0x0000000000000001
rtcpu_vinotify_event: tstamp:4059206674 cch:0 vi:0 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:129891804896 data:0x0000000800000000
rtcpu_vinotify_event: tstamp:4059206818 cch:0 vi:0 tag:CHANSEL_PXL_SOF channel:0x23 frame:1 vi_tstamp:129891808928 data:0x0000000000000001
rtcpu_vinotify_event: tstamp:4059206976 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:1 vi_tstamp:129891815424 data:0x0000000008020001
rtcpu_vinotify_error: tstamp:4060164160 cch:0 vi:0 tag:CSIMUX_FRAME channel:0x00 frame:1 vi_tstamp:129925171392 data:0x00000000000000a0
rtcpu_vinotify_event: tstamp:4060166846 cch:0 vi:0 tag:CHANSEL_PXL_EOF channel:0x23 frame:1 vi_tstamp:129923836800 data:0x0000000004370002
rtcpu_vinotify_event: tstamp:4060167015 cch:0 vi:0 tag:ATOMP_FRAME_DONE channel:0x23 frame:1 vi_tstamp:129923837312 data:0x0000000000000000

I understand what you mean by this normal log, but right now, I do it by first controlling max96724 mipi through other SOC, and then starting gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1536, framerate=(fraction)30/1’ ! “xvimagesink -ev” would be

vi-output, z_im-3756 [004] … 695.238000: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

gst-launch-1.0-3749 [005] … 695.238196: tegra_channel_set_stream: enable : 0x0

gst-launch-1.0-3749 [005] … 695.238198: tegra_channel_set_stream: z_imx390_5200_9295 9-0013 : 0x0

gst-launch-1.0-3749 [005] … 695.238225: tegra_channel_set_stream: 13e00000.host1x:nvcsi@15a00000- : 0x0

gst-launch-1.0-3749 [005] … 695.238227: csi_s_stream: enable : 0x0

gst-launch-1.0-3749 [006] … 695.242859: tegra_channel_set_power: z_imx390_5200_9295 9-0013 : 0x0

gst-launch-1.0-3749 [006] … 695.242896: camera_common_s_power: status : 0x0

gst-launch-1.0-3749 [006] … 695.242913: tegra_channel_set_power: 13e00000.host1x:nvcsi@15a00000- : 0x0

gst-launch-1.0-3749 [006] … 695.242915: csi_s_power: enable : 0x0

gst-launch-1.0-3749 [006] … 695.292138: tegra_channel_close: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-4026 [003] … 698.704322: tegra_channel_open: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-4026 [003] … 698.704429: tegra_channel_close: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-4026 [003] … 698.704441: tegra_channel_open: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-4026 [003] … 698.704539: tegra_channel_close: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-4026 [003] … 698.704551: tegra_channel_open: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-4026 [003] … 698.704653: tegra_channel_close: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-4026 [003] … 698.704664: tegra_channel_open: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-4026 [003] … 698.704683: tegra_channel_close: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-4026 [003] … 698.710854: tegra_channel_open: vi-output, z_imx390_5200_9295 9

v4l2src0:src-4028    \[006\] .......   698.728511: tegra_channel_set_power: z_imx390_5200_9295 9-0013 : 0x1                                                                                         

v4l2src0:src-4028    \[006\] .......   698.728521: camera_common_s_power: status : 0x1                                                                                                              

v4l2src0:src-4028    \[006\] .......   698.728543: tegra_channel_set_power: 13e00000.host1x:nvcsi@15a00000- : 0x1                                                                                   

v4l2src0:src-4028    \[006\] .......   698.728545: csi_s_power: enable : 0x1                                                                                                                        

v4l2src0:src-4028    \[006\] .......   698.729342: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13                                                                                       

vi-output, z_im-4030 [006] … 698.729885: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 698.729892: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 698.729893: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 698.729894: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

v4l2src0:src-4028    \[006\] .......   698.729918: tegra_channel_set_stream: enable : 0x1                                                                                                           

v4l2src0:src-4028    \[006\] .......   698.732244: tegra_channel_set_stream: 13e00000.host1x:nvcsi@15a00000- : 0x1                                                                                  

v4l2src0:src-4028    \[006\] .......   698.732246: csi_s_stream: enable : 0x1                                                                                                                       

v4l2src0:src-4028    \[006\] .......   698.732469: tegra_channel_set_stream: z_imx390_5200_9295 9-0013 : 0x1                                                                                        

 kworker/2:2-182     \[002\] .......   698.732917: rtcpu_vinotify_event: tstamp:22639351493 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:724459031232 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   698.732919: rtcpu_vinotify_event: tstamp:22639351656 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:724459073312 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   698.732919: rtcpu_vinotify_event: tstamp:22639351793 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:724459091488 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   698.732920: rtcpu_vinotify_event: tstamp:22639351946 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:724459111808 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   698.732920: rtcpu_vinotify_event: tstamp:22639352082 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:724459154176 data:0x0000000031000002       

vi-output, z_im-4031 [007] … 701.382291: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 701.434805: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 701.460038: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 701.485483: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   701.488837: rtcpu_vinotify_event: tstamp:22723896925 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:727163937984 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   701.488839: rtcpu_vinotify_event: tstamp:22723897061 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:727163980064 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   701.488839: rtcpu_vinotify_event: tstamp:22723897217 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:727164001760 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   701.488840: rtcpu_vinotify_event: tstamp:22724981860 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:727189148768 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   701.488840: rtcpu_vinotify_event: tstamp:22724982017 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:727189191456 data:0x0000000031000002       

vi-output, z_im-4031 [004] … 703.942089: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 703.956273: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 703.982237: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 704.007103: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   704.016752: rtcpu_vinotify_event: tstamp:22803107982 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:729685388192 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   704.016755: rtcpu_vinotify_event: tstamp:22803108142 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:729685435072 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   704.016756: rtcpu_vinotify_event: tstamp:22803108280 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:729685456736 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   704.016757: rtcpu_vinotify_event: tstamp:22803650606 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:729711324320 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   704.016758: rtcpu_vinotify_event: tstamp:22803650744 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:729711367072 data:0x0000000031000002       

vi-output, z_im-4031 [004] … 706.502066: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 706.515922: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 706.540978: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   706.552687: rtcpu_vinotify_event: tstamp:22882860959 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:732245055872 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   706.552690: rtcpu_vinotify_event: tstamp:22882861095 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:732245097920 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   706.552691: rtcpu_vinotify_event: tstamp:22882861248 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:732245119584 data:0x0000000007020001     

vi-output, z_im-4030 [006] … 706.566542: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   706.612668: rtcpu_vinotify_event: tstamp:22883946818 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:732270089568 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   706.612672: rtcpu_vinotify_event: tstamp:22883946980 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:732270132256 data:0x0000000031000002       

vi-output, z_im-4031 [004] … 709.061155: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 709.075873: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   709.076618: rtcpu_vinotify_event: tstamp:22962658332 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:734804972576 data:0x799e300010000000       

vi-output, z_im-4030 [006] … 709.101476: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 709.126322: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   709.132590: rtcpu_vinotify_event: tstamp:22963157178 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:734805129888 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   709.132593: rtcpu_vinotify_event: tstamp:22963157314 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:734805151552 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   709.132595: rtcpu_vinotify_event: tstamp:22963700383 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:734830566112 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   709.132596: rtcpu_vinotify_event: tstamp:22963700520 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:734830608832 data:0x0000000031000002       

vi-output, z_im-4031 [004] … 711.620985: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 711.635779: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 711.661445: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   711.664513: rtcpu_vinotify_event: tstamp:23042910889 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:737364884704 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   711.664517: rtcpu_vinotify_event: tstamp:23042911028 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:737364926784 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   711.664518: rtcpu_vinotify_event: tstamp:23042911182 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:737364948448 data:0x0000000007020001     

vi-output, z_im-4030 [006] … 711.686530: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   711.720488: rtcpu_vinotify_event: tstamp:23043995416 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:737390627104 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   711.720490: rtcpu_vinotify_event: tstamp:23043995578 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:737390669856 data:0x0000000031000002       

vi-output, z_im-4031 [004] … 714.181156: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 714.195707: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 714.221348: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   714.244426: rtcpu_vinotify_event: tstamp:23122664547 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:739924820000 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   714.244430: rtcpu_vinotify_event: tstamp:23122664701 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:739924862048 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   714.244431: rtcpu_vinotify_event: tstamp:23122664836 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:739924883712 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   714.244432: rtcpu_vinotify_event: tstamp:23123749666 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:739950456704 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   714.244433: rtcpu_vinotify_event: tstamp:23123749805 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:739950499424 data:0x0000000031000002       

vi-output, z_im-4030 [006] … 714.246651: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4031 [004] … 716.741116: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 716.755583: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   716.768350: rtcpu_vinotify_event: tstamp:23202651343 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:742484707168 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   716.768353: rtcpu_vinotify_event: tstamp:23202651479 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:742484749216 data:0x0000000031000001       

vi-output, z_im-4030 [006] … 716.781159: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 716.806051: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   716.828343: rtcpu_vinotify_event: tstamp:23203176754 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:742484859136 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   716.828347: rtcpu_vinotify_event: tstamp:23203719766 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:742510308704 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   716.828348: rtcpu_vinotify_event: tstamp:23203719924 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:742510351424 data:0x0000000031000002       

vi-output, z_im-4031 [004] … 719.301209: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 719.315548: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 719.342221: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   719.356270: rtcpu_vinotify_event: tstamp:23282930499 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:745044662528 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   719.356273: rtcpu_vinotify_event: tstamp:23282930656 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:745044704608 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   719.356274: rtcpu_vinotify_event: tstamp:23282930792 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:745044726272 data:0x0000000007020001     

vi-output, z_im-4030 [006] … 719.366736: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   719.412262: rtcpu_vinotify_event: tstamp:23284016137 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:745071324992 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   719.412265: rtcpu_vinotify_event: tstamp:23284016273 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:745071367680 data:0x0000000031000002       

vi-output, z_im-4031 [004] … 721.861225: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 721.875446: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   721.880190: rtcpu_vinotify_event: tstamp:23362683462 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:747604576576 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   721.880193: rtcpu_vinotify_event: tstamp:23362683598 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:747604618656 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   721.880194: rtcpu_vinotify_event: tstamp:23362683751 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:747604640320 data:0x0000000007020001     

vi-output, z_im-4030 [006] … 721.900877: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 721.925207: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   721.936190: rtcpu_vinotify_event: tstamp:23363769438 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:747629962592 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   721.936193: rtcpu_vinotify_event: tstamp:23363769608 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:747630005280 data:0x0000000031000002       

vi-output, z_im-4031 [004] … 724.421213: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-4030 [006] … 724.435619: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

vi-output, z_im-4030 [006] … 724.461216: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

 kworker/2:2-182     \[002\] .......   724.480099: rtcpu_vinotify_event: tstamp:23442653179 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:750164739360 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   724.480101: rtcpu_vinotify_event: tstamp:23442653336 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:750164781440 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   724.480102: rtcpu_vinotify_event: tstamp:23442653472 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:750164807904 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   724.480102: rtcpu_vinotify_event: tstamp:23443467858 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:750190325824 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   724.480102: rtcpu_vinotify_event: tstamp:23443467996 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:750190368544 data:0x0000000031000002       

vi-output, z_im-4030 [006] … 724.486494: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:4030 tid:4030

If you run first gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1536, framerate=(fraction)30/1’ ! xvimagesink -ev Then when configuring max96724, there will be

 kworker/2:2-182     \[002\] .......   607.480324: rtcpu_string: tstamp:19786290792 id:0x04010000 str:"VM0 deactivating."                                                                           

gst-launch-1.0-3749 [002] … 615.865505: tegra_channel_open: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-3749 [002] … 615.865614: tegra_channel_close: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-3749 [002] … 615.865626: tegra_channel_open: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-3749 [002] … 615.865723: tegra_channel_close: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-3749 [002] … 615.865733: tegra_channel_open: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-3749 [002] … 615.865825: tegra_channel_close: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-3749 [002] … 615.865836: tegra_channel_open: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-3749 [002] … 615.865852: tegra_channel_close: vi-output, z_imx390_5200_9295 9

gst-launch-1.0-3749 [002] … 615.873917: tegra_channel_open: vi-output, z_imx390_5200_9295 9

v4l2src0:src-3751    \[000\] .......   615.892472: tegra_channel_set_power: z_imx390_5200_9295 9-0013 : 0x1                                                                                         

v4l2src0:src-3751    \[000\] .......   615.892645: camera_common_s_power: status : 0x1                                                                                                              

v4l2src0:src-3751    \[000\] .......   615.892667: tegra_channel_set_power: 13e00000.host1x:nvcsi@15a00000- : 0x1                                                                                   

v4l2src0:src-3751    \[000\] .......   615.892669: csi_s_power: enable : 0x1                                                                                                                        

v4l2src0:src-3751    \[000\] .......   615.894188: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13                                                                                       

vi-output, z_im-3755 [006] … 615.904114: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

vi-output, z_im-3755 [006] … 615.904125: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

vi-output, z_im-3755 [006] … 615.904127: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

vi-output, z_im-3755 [006] … 615.904128: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

v4l2src0:src-3751    \[000\] .......   615.904158: tegra_channel_set_stream: enable : 0x1                                                                                                           

v4l2src0:src-3751    \[001\] .......   615.908087: tegra_channel_set_stream: 13e00000.host1x:nvcsi@15a00000- : 0x1                                                                                  

v4l2src0:src-3751    \[001\] .......   615.908091: csi_s_stream: enable : 0x1                                                                                                                       

v4l2src0:src-3751    \[000\] .......   615.908464: tegra_channel_set_stream: z_imx390_5200_9295 9-0013 : 0x1                                                                                        

 kworker/2:2-182     \[002\] .......   615.951767: rtcpu_string: tstamp:20050878125 id:0x04010000 str:"VM0 activating."                                                                             

 kworker/2:2-182     \[002\] .......   615.951773: rtcpu_vinotify_event: tstamp:20051506846 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:641633123200 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   615.951774: rtcpu_vinotify_event: tstamp:20051506984 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:641633129632 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   615.951774: rtcpu_vinotify_event: tstamp:20051507139 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:641633132640 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   615.951775: rtcpu_vinotify_event: tstamp:20051507277 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:641633174912 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   615.951775: rtcpu_vinotify_event: tstamp:20051507431 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:641633181376 data:0x0000000031000002       

vi-output, z_im-3756 [003] … 618.441055: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-3755 [006] … 618.498914: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

vi-output, z_im-3755 [004] … 618.524239: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

 kworker/2:2-182     \[002\] .......   618.543862: rtcpu_vinotify_event: tstamp:20132345457 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:644228066528 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   618.543866: rtcpu_vinotify_event: tstamp:20132345613 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:644228108608 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   618.543867: rtcpu_vinotify_event: tstamp:20132345748 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:644228130304 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   618.543868: rtcpu_vinotify_event: tstamp:20133431265 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:644253346688 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   618.543869: rtcpu_vinotify_event: tstamp:20133431401 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:644253389440 data:0x0000000031000002       

vi-output, z_im-3755 [004] … 618.549193: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

vi-output, z_im-3756 [003] … 621.000132: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-3755 [004] … 621.014838: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

vi-output, z_im-3755 [004] … 621.040274: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

vi-output, z_im-3755 [004] … 621.065573: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

 kworker/2:2-182     \[002\] .......   621.071558: rtcpu_vinotify_event: tstamp:20211014192 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:646743943872 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   621.071560: rtcpu_vinotify_event: tstamp:20211014337 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:646743985952 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   621.071561: rtcpu_vinotify_event: tstamp:20211014491 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:646744007616 data:0x0000000007020001     

 kworker/2:2-182     \[002\] .......   621.071561: rtcpu_vinotify_event: tstamp:20211556829 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:646769382816 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   621.071561: rtcpu_vinotify_event: tstamp:20211556986 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:646769425536 data:0x0000000031000002       

vi-output, z_im-3756 [003] … 623.559955: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1536 fmt 13

vi-output, z_im-3755 [004] … 623.574763: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

 kworker/2:2-182     \[002\] .......   623.595475: rtcpu_vinotify_event: tstamp:20290749170 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:649303879456 data:0x799e300010000000       

 kworker/2:2-182     \[002\] .......   623.595477: rtcpu_vinotify_event: tstamp:20291255727 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:649304036736 data:0x0000000031000001       

 kworker/2:2-182     \[002\] .......   623.595478: rtcpu_vinotify_event: tstamp:20291255863 cch:0 vi:1 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:649304058400 data:0x0000000007020001     

vi-output, z_im-3755 [004] … 623.600312: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

vi-output, z_im-3755 [004] … 623.624812: vi_task_submit: class_id:48 ch:0 syncpt_id:31 syncpt_thresh:447 pid:3755 tid:3755

 kworker/2:2-182     \[002\] .......   623.655486: rtcpu_vinotify_event: tstamp:20291797782 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:649329434656 data:0x799e2d0010000000       

 kworker/2:2-182     \[002\] .......   623.655489: rtcpu_vinotify_event: tstamp:20291797920 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:649329477408 data:0x0000000031000002       

 kworker/2:2-182     \[002\] .......   624.327470: rtcpu_nvcsi_intr: tstamp:20313991650 class:GLOBAL type:PHY_INTR0 phy:1 cil:0 st:0 vc:0 status:0x01c00000                                         

 kworker/2:2-182     \[002\] .......   624.327473: rtcpu_nvcsi_intr: tstamp:20313991650 class:GLOBAL type:PHY_INTR0 phy:1 cil:1 st:0 vc:0 status:0x00c00000 

No images could be captured.I need your help.

The second situation has an additional amount compared to the first one.

 kworker/2:2-182     \[002\] .......   624.327470: rtcpu_nvcsi_intr: tstamp:20313991650 class:GLOBAL type:PHY_INTR0 phy:1 cil:0 st:0 vc:0 status:0x01c00000                                         

 kworker/2:2-182     \[002\] .......   624.327473: rtcpu_nvcsi_intr: tstamp:20313991650 class:GLOBAL type:PHY_INTR0 phy:1 cil:1 st:0 vc:0 status:0x00c00000

it shows calibration done, which is correct message reported.

hello 1194400158,

it looks you have several cameras connected to GMSL adapter board,
please try reduce the number and running with lower data-rate for testing.

Thank you for your guidance. But I’m not quite understanding. Is this related to the rate? My project requirement is 2000M per lane. There are a total of 4 1920*1536 cameras. And I found that this log is related to whether I configure 96724 first or start the image acquisition first.

tegra234-p3737-camera-zuojisi-overlay.txt (15.1 KB)

This is my device tree file. Could you please help me check if there are any errors in what I have written? I am using CAM1 4lane. Thank you very much.

hello 1194400158,

there’re 4 cameras via VC-ID. you may reduce the nodes for testing with single camera.

please double check serdes_pix_clk_hz, it’s the output clock rate for the serializer/deserializer chip.
see-also developer guide, SerDes Pixel Clock.