export IO expansion chip's gpio to userspace

Hi there,
I tied to export the CAM2_PWDN and CAM2_RST on J22 of TX1 to user space by claim it as a gpio in our hardware’s device tree node, and then exported the port using gpio_request and gpio_export in its driver, those two pin are from TX1’s TCA9539 IO expansion port, and were exported as gpio999 and gpio1000 in /sys/class/gpio, the problem is that I can not control it by echo high and low to its value, do anyone know what the trick is? Thank you.


By “high” and “low”, do you mean those names literally, or are you using “1” and “0”? If not “1” and “0”, try that.

Sorry for that, it mean “1”, and “0”, so I cannot control this IO. Any other idea? since the GPIO is on io expander, pinmux is not needed, right?

By definition any GPIO needs a correct PINMUX setting (it’s “general use”)…the question is what it is by default. One thing to consider is that “/sys/class/gpio/” has files “export” and “unexport”…if the GPIO is mapped for general use there would likely be a symbolic link naming the gpio in that directory…else something else could have hold of it. If you can echo to the export the right GPIO number without error and the GPIO then shows up there, then you’ve probably set it up correctly.