# How to build a custom v4l2 driver as a module in 24.1

**URL:** <https://forums.developer.nvidia.com/t/how-to-build-a-custom-v4l2-driver-as-a-module-in-24-1/44907>\
**Category:** Jetson TX1\
**Created:** [September 13, 2016, 4:36am UTC](https://forums.developer.nvidia.com/t/how-to-build-a-custom-v4l2-driver-as-a-module-in-24-1/44907 "2016-09-13T04:36:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![forever3000](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/forever3000/32/11004_2.png) [@forever3000](https://forums.developer.nvidia.com/u/forever3000)\
**Post date:** [September 13, 2016, 4:36am UTC](https://forums.developer.nvidia.com/t/how-to-build-a-custom-v4l2-driver-as-a-module-in-24-1/44907/1 "2016-09-13T04:36:02Z")

</div>

Dear all,

I spent some days on this issue but look like the menuconfig in this release is so complicated. I want to build my own v4l2 driver (same as OV5693) so I tried to modify the .config file, then I got imx135\_v4l2.ko (this is my module) and tegra\_camera module.

As I understand, the tegra\_camera will use vi2\_probe function to call to v4l2 driver probe. But I can not link vi2\_probe to my own v4l2 driver, if I define CONFIG\_SOC\_CAMERA\_PLATFORM it will link to virtual hardware, if I didn’t define CONFIG\_SOC\_CAMERA\_PLATFORM nothing happen.

Thanks

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [November 16, 2016, 7:21am UTC](https://forums.developer.nvidia.com/t/how-to-build-a-custom-v4l2-driver-as-a-module-in-24-1/44907/2 "2016-11-16T07:21:27Z")

</div>

Suggest to move to r24.2 to follow the document from below link and reference to the “Sensor Driver Programming Guide” chapter to bring up your sensor.

---

<div class="post-metadata">

**Author:** ![DavidSoto-RidgeRun](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/davidsoto-ridgerun/32/273049_2.png) [@DavidSoto-RidgeRun](https://forums.developer.nvidia.com/u/DavidSoto-RidgeRun)\
**Post date:** [November 17, 2016, 1:04pm UTC](https://forums.developer.nvidia.com/t/how-to-build-a-custom-v4l2-driver-as-a-module-in-24-1/44907/3 "2016-11-17T13:04:58Z")

</div>

Check the V4L2 chapter in the L4T Documentation that you can download from [Jetson Download Center | NVIDIA Developer](https://developer.nvidia.com/embedded/downloads)

I would suggest you to move to media controller in R24.2. If you are using soc\_camera, when loading the modules are you running similar steps to these? [Toshiba TC358743 Linux driver for Jetson TX1 - RidgeRun Developer Connection](https://developer.ridgerun.com/wiki/index.php?title=Toshiba_TC358743_Linux_driver_for_Tegra_X1#Mount_the_kernel_module)

Do you see the module mounted after running lsmod?

---

<div class="post-metadata">

**Author:** ![forever3000](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/forever3000/32/11004_2.png) [@forever3000](https://forums.developer.nvidia.com/u/forever3000)\
**Post date:** [November 17, 2016, 1:32pm UTC](https://forums.developer.nvidia.com/t/how-to-build-a-custom-v4l2-driver-as-a-module-in-24-1/44907/4 "2016-11-17T13:32:49Z")

</div>

Hi DavidSoto,

After many modifications, I can insmod my own custom camera module on R24.1. I will move to R24.2 soon.

Thanks

---

<div class="post-metadata">

**Author:** ![DavidSoto-RidgeRun](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/davidsoto-ridgerun/32/273049_2.png) [@DavidSoto-RidgeRun](https://forums.developer.nvidia.com/u/DavidSoto-RidgeRun)\
**Post date:** [November 17, 2016, 1:35pm UTC](https://forums.developer.nvidia.com/t/how-to-build-a-custom-v4l2-driver-as-a-module-in-24-1/44907/5 "2016-11-17T13:35:04Z")

</div>

Hi, that is great. We had some problems related to framerate in the past when using soc\_camera, that is why I recommend media controller. Good job getting it working

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 18, 2021, 7:00pm UTC](https://forums.developer.nvidia.com/t/how-to-build-a-custom-v4l2-driver-as-a-module-in-24-1/44907/6 "2021-10-18T19:00:45Z")

</div>

Closed on October 18, 2021, 7:00pm UTC


