GPIO issue on Xavier, pin value does not change using a driver

Hi guys,
I have a problem trying to use a gpio from the camera connector on the Xavier with JetPack 4.2 L4T-R32,
i assign the reset pin in the device tree

reset-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(T, 6) GPIO_ACTIVE_HIGH>;

(this is the pin 446), in the device driver i set this pin value to LOW or HIGH and i can see the value assigned correctly with sudo cat /sys/kernel/debug/gpio

gpio-446 (                    |cam_reset_gpio      ) out hi

but when i measured the pin state using a voltmeter i got 0v, i tested with GPIO_ACTIVE_LOW but i still got 0v.

Using sudo su, i checked /sys/class/gpio/gpio446/, this path was created by the driver using the gpio library (the pin state was in output mode with value 1).
This is something strange, if i write again these values

echo out > direction
echo 1 > value

the pin does change from 0v to ~1.5v.

I cannot understand what is wrong, i did the same process in a TX2 and the pin does change (pin number 457 in TX2) according to the driver gpio_set_value.

I will appreciate any help to understand what is wrong on the Xavier driver or the gpio configuration.

hello greivin.fallas,

may I double confirm your issue.
please check below to confirm we’re understand correctly.

did you mean the reset GPIO values is not changed by define the reset GPIO in device tree “and” using the kernel function gpio_set_value() to toggle the pin value.
you could see the GPIO value changed when you running with superuser to overwrite the pin values.

hello greivin.fallas,

one more question, how about using pinmux spreadsheet to have this configuration.
are you still able to see pin value does not change issue?

Hi JerryChang,

It is actually fixed, i don’t really understand why but the DTB was not including some dtsi files (fragments with overwrites) and it was causing my issue.

I created a custom DTB based on Xavier’s device tree to control the camera connector and the final DTB did not include some parts (DTC did not show any issue).


hello greivin.fallas,

since there are some hierarchy to make final DTB file for your target board.
I’m assume your configuration has been overwrite or by delete for later dtsi files.

you could use the DTC binary to have quick verification by disassembler the dtb file into txt file.
for example,

$ dtc -I dtb -O dts -o output.txt tegra.dtb