[rock-3a] I want to control GPIO0_C3

I want to control wifi, so I want to change GPIO0_C2 from Low to High, but I can’t do it. Do I need to check the Driver Tree, etc.?

[script]
bt_reg_onoff () {
gpioset gpiochip0 19=0
sleep .5
gpioset gpiochip0 19=1
}

[check]
root@r3a-19:# gpioinfo gpiochip0
gpiochip0 - 32 lines:
line 0: unnamed unused input active-high
line 1: unnamed unused input active-high
line 2: unnamed unused output active-high
line 3: unnamed “interrupt” input active-high [used]
line 4: unnamed “cd” input active-low [used]
line 5: unnamed “vcc5v0-usb-otg-regulator” output active-high [used]
line 6: unnamed “vcc5v0-usb-host-regulator” output active-high [used]
line 7: unnamed unused input active-high
line 8: unnamed unused input active-high
line 9: unnamed unused input active-high
line 10: unnamed unused input active-high
line 11: unnamed unused input active-high
line 12: unnamed unused input active-high
line 13: unnamed unused input active-high
line 14: unnamed unused input active-high
line 15: unnamed “blue:heartbeat” output active-high [used]
line 16: unnamed unused input active-high
line 17: unnamed unused input active-high
line 18: unnamed unused output active-high
line 19: unnamed unused output active-high
line 20: unnamed unused input active-high
line 21: unnamed unused input active-high
line 22: unnamed unused input active-high
line 23: unnamed unused input active-high
line 24: unnamed unused input active-high
line 25: unnamed unused input active-high
line 26: unnamed unused input active-high
line 27: unnamed “interrupt” input active-high [used]
line 28: unnamed “vcc3v3-pcie-regulator” output active-high [used]
line 29: unnamed “vcc5v0-usb-hub-regulator” output active-high [used]
line 30: unnamed unused input active-high
line 31: unnamed unused input active-high

The gpio line corresponding to GPIO0_C2 is 18, you can refer to the following document:

https://docs.radxa.com/en/rock3/rock3a/app-development/gpiod#convert-vendor-gpio-to-libgpiod

I want control HOST_WAKE_BT_H_3V3 = GPIO0_C3 (not GPIO0_C2)

image

My mistake.

Does anyone know how to control GPIO0_C3?

Do you want to control it at the application level or do you mean you want to control it in the underlying device tree?

my-led-overlay.dts
/dts-v1/;
/plugin/;

/ {
        fragment@0 {
                target-path = "/";

                __overlay__ {
                        leds {
                                compatible = "gpio-leds";

                                gpio0_C2 {
                                        label = "gpio0-C2:pwr";
                                        gpios = <&gpio0 18 0>; /* GPIO_ACTIVE_HIGH */
                                        default-state = "none";
                                };
                        };
                };
        };
};

sudo armbian-add-overlay my-led-overlay.dts

Can be controled via sysfs:
sudo bash -c "echo default-on > /sys/class/leds/gpio0-C2\:pwr/trigger" (as HIGH level)
sudo bash -c "echo none > /sys/class/leds/gpio0-C2\:pwr/trigger" (as LOW level)