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