Tca9539 extended GPIO, how to use tegra_SOC mode control

Hello, on the custom board,tca9539 extended GPIO, how to control these GPIO pins in gPIo.tegra_soc mode.

hello chao.zhang,

please check this thread as see-also, thanks

thanks for you answer.Let me be a little bit more specific.On the customized board, an MCU chip is added to communicate with NX through I2C(i2c@c240000). since NX has limited GPIO pins, I added GPIO pins through MCU,how do I modify the device tree so that Tegra_soc mode of Jetson.GPIO controls 8-way GPIO within the i2c@c240000 node?
The following two files are examples.

tegra194-p3668-common.dtsi (11.6 KB)
gpio-test.py (127 Bytes)

hello chao.zhang,

please check below example, it’s six ov5693 camera sensor they’re sharing GPIO via tca6408,
I’ve reduce the code snippet to show only single camera,
you may defined the pin, and assign the GPIO pin, pwdn-gpios to tca6408_21_outlow_0,
for example,

 	i2c@3180000 {
 		tca6408_21: tca6408@21 {
 			compatible = "ti,tca6408";
 			gpio-controller;
 			reg = <0x21>;

 			tca6408_21_outlow {
 				gpio-hog;
 				gpios = <0 0>;
 				output-low;
 				label = "tca6408_21_outlow_0",
 			};

...
 			i2c@2 {
 				reg = <2>;
 				ov5693_c@36 {
 					pwdn-gpios = <&tca6408_21 0 GPIO_ACTIVE_HIGH>;

note, the gpios = <0 0>;, 1st element mean the enumerate node, 2nd element means the default state. you may extent this if you have more than one GPIO need to be used.
after that, you may control pwdn-gpios via user-space.
thanks

Thanks, I’ll try.

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