Jetson TK1 CSI2 driver example


I would like to interface custom camera sensor board with Jetson Tk1. I would like to develop linux tegra driver to communicate with custom sensor board. I have been trying to find CSI2 example code in jetson Tk1 but have not been to find it. Can you please help me know the location of CSI2 example driver source code.


Please download the document from below link and reference to the “Sensor Driver Programming Guide” chapter

Thanks for your quick response. The sensor that we would like to integrate with Jetson TK1 does not support standard I2C for sensor controls, it uses SPI. SPI driver for sensor control (power up/power down) is working, I would like to understand how to develop driver to be able to register camera, configure MIPI receiver and receive frames

You can use the ov5693.c as reference and using the regmap to access the spi REG.
You can try devm_regmap_init_spi() to initial the spi regmap after that you can use the regmap_read/regmap_write function to access the sensor via SPI interface.

There are two ov5693.c-files, one in media/i2c and another in media/platform/tegra. The code is not identical, but both ceate an i2c-driver “ov5693” compatible to “nvidia,ov5693”. Which is the correct one and why are there two? And then there is the file media/i2c/soc_camera/ov5693_v4l.c, which seems to do the same thing again. What’s the purpose of that one?
I must admit that I find the kernel-source and the device-trees to be extremely confusing. The term “ov5693” appears more than 1000 times in dozens of files. How complicated can the support of a specific sensor get? It’s frustrating.

For TK1 you should reference to below one.

I’m using the TX1. What’s the correct file for this?

For TX1 you should reference to kernel/drivers/media/i2c/ov5693.c

Hi Shane,

Thanks for your response. I am not able to find file media/i2c/soc_camera/ov5693_v4l.c. I am using L4T R21.4.


You should find it at …/kernel/drivers/media/i2c/soc_camera/ov5693_v4l2.c or imx135_v4l2.c or ar0261_v4l2.c