Using CAM0_MCLK, embedded in CSI Connector, as GPIO


i am trying to use the CAM0_MCLK Pin, which is embedded in the CSI Connector as a GPIO Pin, as my current project requires this. How can I do this?

From the Pinmux Spreadsheet, this Pin should be Pin 116. I already tried changed its usage in the Device Tree by the Spreadsheet, but i still cant access the Pin.

Can you help with this problem

Best regards,

Which GPIO? GPIO PS.0?
Maybe add TEGRA_GPIO(S, 0) 0 to gpios of gpio@6000d000 to try.



I think this worked. The documentation around the Pinmux Spreadsheet is very weak and confusing. Plus using the TEGRA_GPIO() Function in my device tree would bring a error when compiling (i coulnd even include the gpio.h file) So worked my way around it:

I calculated the Pin Number from the Port Number and its Offset. Example for the CAM0_MCLK:

CAM0_MCLK is defined in the Pinmux Spreadsheet as GPIO3_PS.00. Which means it is From the Port S, which has the Port Number 18. The .00 represent the Offset. The Formula for the Pin Number is: Port Number * 8 + Offset. Which is 144 for the CAM0_MCLK, or 0x90 in Hexadecimal Terms.

The Port Numbers are defined in the Kernel Source under kernel_src/kernel/nvidia/include/dt-bindings/gpio/tegra194-gpio.h

So in my device tree in gpio@6000d00 under default. I added the 0x90 to gpio-output-low. After compiling and loading the device tree, I could export Pin 144 and set it state.

Your reply helped to get into the right direction.

Thank you

Include file could be tegra-gpio.h at …/kernel/kernel-4.9/include/dt-bindings/gpio/ instead of tegra194-gpio.h

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