Failed to access CAM0_PWDN pin

Is it possible to access CAM0_PWDN/CAM1_MCLK03 pins as GPIO on AGX Xavier?

I tried to access CAM0_PWDN/CAM1_MCLK03/DAP6_SCLK_PA0 pins as read/write GPIO pin, but got error message “bash: echo: write error: Invalid argument”

Here are the steps I did.

  1. get pinmux number from AGX pinmux_confg=iguration file.
    CAM0_PWDN — GPIO3_PH.06 – pin 62
    CAM1_MCLK03 — EXTPERIPH2_CLK
    DAP6_SCLK_PA0 — GPIO3.PA.01 – pin 1

  2. echo 1 (62) > export – got error
    error message
    root@jetson-0423318034979:/sys/class/gpio# echo 1 > export
    bash: echo: write error: Invalid argument
    root@jetson-0423318034979:/sys/class/gpio# echo 62 > export
    bash: echo: write error: Invalid argument

  3. the thing is echo 492 >export ok
    ok message
    root@jetson-0423318034979:/sys/class/gpio# echo 492 > export
    root@jetson-0423318034979:/sys/class/gpio# cd gpio492
    root@jetson-0423318034979:/sys/class/gpio/gpio492# ls
    root@jetson-0423318034979:/sys/class/gpio/gpio492# echo out > direction
    root@jetson-0423318034979:/sys/class/gpio/gpio492# echo 1 > value
    root@jetson-0423318034979:/sys/class/gpio/gpio492# cat value
    1
    root@jetson-0423318034979:/sys/class/gpio/gpio492# echo 0 > value
    root@jetson-0423318034979:/sys/class/gpio/gpio492# cat value
    0

Did I miss any?
Thank you for any advice.

hello HuiW,

you should consider the allocation range of the GPIOs, please check Tegra Linux Driver Package TX2 Adaptation Guide, see [GPIO Changes] chapter to understand the GPIO mapping formulas.

you might check GPIO allocation ranges of each GPIO groups following below.

$ dmesg | grep gpiochip
[    1.075992] gpiochip_setup_dev: registered GPIOs 288 to 511 on device: gpiochip0 (tegra-gpio)
[    1.084449] gpiochip_setup_dev: registered GPIOs 248 to 287 on device: gpiochip1 (tegra-gpio-aon)
[    1.171551] gpiochip_setup_dev: registered GPIOs 240 to 247 on device: gpiochip2 (tca6408)
[    1.284035] gpiochip_setup_dev: registered GPIOs 232 to 239 on device: gpiochip3 (max77620-gpio)