[Jetpack-6.2] /dev/videox not created

Any message by the insmod nv_toto.ko command?

No error message for the original code copied from nv_imx219.c

#if defined(NV_I2C_DRIVER_STRUCT_PROBE_WITHOUT_I2C_DEVICE_ID_ARG) /* Linux 6.3 */
static int toto_probe(struct i2c_client *client)
#else
static int toto_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
#endif
{
	struct device *dev = &client->dev;
	struct tegracam_device *tc_dev;
	struct toto *priv;
	int err;

	dev_dbg(dev, "probing v4l2 sensor at addr 0x%0x\n", client->addr);

	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
		return -EINVAL;

	priv = devm_kzalloc(dev,
			sizeof(struct toto), GFP_KERNEL);
	if (!priv)
		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, "toto", sizeof(tc_dev->name));
	tc_dev->dev_regmap_config = &sensor_regmap_config;
	tc_dev->sensor_ops = &toto_common_ops;
	tc_dev->v4l2sd_internal_ops = &toto_subdev_internal_ops;
	tc_dev->tcctrl_ops = &toto_ctrl_ops;

	err = tegracam_device_register(tc_dev);
	if (err) {
		dev_err(dev, "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);

	err = toto_board_setup(priv);
	if (err) {
		tegracam_device_unregister(tc_dev);
		dev_err(dev, "board setup failed\n");
		return err;
	}

	err = tegracam_v4l2subdev_register(tc_dev, true);
	if (err) {
		tegracam_device_unregister(tc_dev);
		dev_err(dev, "tegra camera subdev registration failed\n");
		return err;
	}

	dev_dbg(dev, "detected toto sensor\n");

	return 0;
}

and :

nvidia@ORNN:~$ sudo dmesg | grep subdev
[   10.796184] tegra-camrtc-capture-vi tegra-capture-vi: subdev 13e00000.host1x:nvcsi@15a00000- bound

Should I modify dev_dbg() to dev_info() ?

Hello @ShaneCCC,

Now that I could see that probing message of my pseudo module :

nvidia@ORNN:~$ sudo dmesg  | grep toto
[sudo] password for nvidia: 
[   12.684287] toto 7-0010: supply vana not found, using dummy regulator
[   12.688709] toto 7-0010: supply vif not found, using dummy regulator
[   12.689177] toto 7-0010: supply vdig not found, using dummy regulator
[   12.690989] toto 7-0010: toto_power_get: unable to request reset_gpio (-16)
[   12.690993] toto 7-0010: unable to power get
[   12.690995] toto 7-0010: tegra camera driver registration failed
[   12.698484] toto: probe of 7-0010 failed with error -14

The root cause was that I follow an incomplete instruction for compiling the kernel, modules, device-trees from source. And this instruction lacks of a crucial command in step #4 of the official instruction for building the jetson linux kernel :

$ cp kernel/kernel-jammy-src/arch/arm64/boot/Image \
  <install-path>/Linux_for_Tegra/kernel/Image

Also, it was my subjection that an OOT module had nothing to do with the kernel image (but I did enable the MCP23S08 IO-expander for controlling the reset-gpios of the camera in reality ).

Now looking at the error messages, I think I am facing another issue with the reset-gpio controlled by the aforementioned MCP23S08 which should be filed in another ticket.

Thanks for your support.

Hi @ShaneCCC,

I commented out the following line in the device-tree in order to focus on the camera itself:

//                reset-gpios = <&mcp23008_27 3 GPIO_ACTIVE_LOW>;

But still got error :

nvidia@ORNN:~$ sudo dmesg | grep toto
[    3.796936] i2c i2c-7: Failed to register i2c client toto at 0x10 (-16)
[    3.796941] i2c i2c-7: of_i2c: Failure registering /bus@0/i2c@c250000/toto_a@10
[    3.796947] i2c i2c-7: Failed to create I2C device for /bus@0/i2c@c250000/toto_a@10

Could you instruct, please ?

Best regards,
Khang.

The error EBUSY (-16) could be device tree contain the driver inclusion for the same slave address twice or the second time the driver was attempted to be assigned to this address manually without unbinding it first.

Maybe try modify the slave address to try.

1 Like

Hi @ShaneCCC,

Yes it was the conflict btw the sensor node in the board’s device-tree and the same node in the testing device-tree overlay.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.