# Sensor driver development

**URL:** <https://forums.developer.nvidia.com/t/sensor-driver-development/71542>\
**Category:** Jetson TX2\
**Created:** [March 15, 2019, 8:35am UTC](https://forums.developer.nvidia.com/t/sensor-driver-development/71542 "2019-03-15T08:35:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![albert.siu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@albert.siu](https://forums.developer.nvidia.com/u/albert.siu)\
**Post date:** [March 15, 2019, 8:35am UTC](https://forums.developer.nvidia.com/t/sensor-driver-development/71542/1 "2019-03-15T08:35:09Z")

</div>

I am developing a driver for OV2740 is TX2.

My hardware setup is as below:  
TX2 → Deserializer [DS90UB954] → Serializer [DS90UB953] → OV2740 (no EEPROM)

I follow the information I obtain form my previous enquire to build the driver.  
[https://devtalk.nvidia.com/default/topic/1048192/jetson-tx2/ov2740-driver-development/](https://devtalk.nvidia.com/default/topic/1048192/jetson-tx2/ov2740-driver-development/)

I build by kernel with the following command:

```auto
TEGRA_KERNEL_OUT=$HOME/workspace/kernel-out/kernel
mkdir -p $TEGRA_KERNEL_OUT

cd ~/workspace/sources_albert/kernel/kernel-4.4
make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra18_cti_defconfig

make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j6

sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image /boot/Image
sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra186-tx2-cti-ASG006-IMX185-3CAM.dtb /boot/dtb/tegra186-tx2-cti-ASG006-IMX185-3CAM.dtb
sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install

```

I can build the driver successfully as no error and I can figure out the “ov2740.o” object after execute the above code:

My situation is as below:

1. TX2 can’t detect the sensor after reboot TX2 [no “video\*” under /dev]. I already follow the section “Using Main Platform Device Tree File” of the “Tegra Linux Driver Package Development Guide 28.2 Release”.

My question is as below:

1. I the “Using Main Platform Device Tree File”, it said that I should edit the file “tegra186…dtsi” [step 1 and 2]. I can’t find this dtsi file. So I just skip these steps and follow step 3 and 4 to continuous my device registration process. Is it true that I can register my device successfully?

2. The command “dmesg | grep -I ov2740” don’t output any information. Am I right that it is due to TX2 can’t detect my sensor [no “veido\*” under /dev]?

3. I check my circuit and find that my sensor is power down by the GPIO of my Serializer. I think it is a reason that TX2 can’t detect my sensor. The GPIO of the Serializer can control by I2C. I would like to known how to modify my code to control the serializer?

4. The seriializer provide a I2C path to control the sensor. The device address of the serializer and sensor are different. Is it true I should use the serializer I2C device address instead of using the sensor I2C device address when coding my driver?

5. How to access those sensor I2C register as it is behind the seializer?

Sorry I am new in TX2, Linux and this serializer so may be asking some silly question.

Thx.

---

<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:** [March 15, 2019, 9:07am UTC](https://forums.developer.nvidia.com/t/sensor-driver-development/71542/2 "2019-03-15T09:07:37Z")

</div>

The “Using Main Platform Device Tree File” step 1 should be talked about the xxxx.dts instead of xxxx.dtsi

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 6:31pm UTC](https://forums.developer.nvidia.com/t/sensor-driver-development/71542/3 "2021-10-18T18:31:49Z")

</div>

Closed on October 18, 2021, 6:31pm UTC


