Could someone give me an example of configuring an IO Expander ( TCA6408, TCA8539, …) as output to be used in a sensor node’s reset-gpios property, please ?
so, you’re going to enable TCA6408 multiplexer,
had you already configure those GPIO definition? you should see reference driver to have implementation.
for example,
HI @JerryChang ,
Thanks for your reply. It is clear for me about defining gpio inputs as well as outputs low and high. I’m specially interested in reset-gpios definition which is not recognized. I would like to know why
i2c@2 {
}
is there and should it be inside
tca6408_21: tca6408@21 {
};
Also, in case if the camera sensor is plugged into different i2c bus, what would happen, please ?
i2c@2 this may not necessary for your use-case, it’s recap from the reference drivers,
it’s a six camera module to share the i2c bus (0x36) with pca9548. it muxes i2c address by using i2c@0 to i2c@5.
for example, $L4T_Sources/r32.6.1/Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-camera-e3333-a00.dtsi
please replace that with the actual sensor i2c address if you’re having camera modules define without mux.
thanks
Thanks again for your reply. I would like to make a little bit clearer the case without i2c mux. For example, if my sensor is hooked to a different i2c bus saying i2c@3160000, How should I replace the above i2c@2 node ? Could i2c@3160000 be inside tca6408@21 and same level of tca6408_21_outlow, tca6408_21_outhigh, tca6408_21_input, etc?
i2c@3180000 {
tca6408_21: tca6408@21 { // Begin of tca6408_21
compatible = "ti,tca6408";
gpio-controller;
#gpio-cells = <2>;
reg = <0x21>;
vcc-supply = <&p2822_vdd_1v8_cvb>;
tca6408_21_outlow {
gpio-hog;
gpios = <0 0 1 0 ...>;
output-low;
label = "tca6408_21_outlow_0",
"tca6408_21_outlow_1",
...
tca6408_21_outhigh {
status = "disabled";
};
tca6408_21_input {
status = "disabled";
};
i2c@3160000 {
ov5693_c@36 {
pwdn-gpios = <&tca6408_21 0 GPIO_ACTIVE_HIGH>;
reset-gpios = <&tca6408_21 1 GPIO_ACTIVE_HIGH>;
...
};
}; // End of i2c@3160000
}; // End of tca6408_21: tca6408@21
}; // End of i2c@3180000
Or should i2c@3160000 be same level as i2c@3180000, please ?
And should we list out the gpios’ indexes (0 and 1 for example) :
The provided example , $L4T_Sources/r32.6.1/Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-camera-e3333-a00.dtsi is quite clear. I just have some small doubts :
Should we list out all of the GPIOs’ indexes or just one(s) we use? For example, if the reset-gpios is for my sensor is on output #7, then which one below is correct :
gpios = <0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0>;
or
gpios = <7 0>;
The reset-gpios of my sensor is active-low i.e a low level (0V) on that gpio will cause the reset. Therefore, do I need to define inversely :