> On 4. Aug 2024, at 16:28, Steffen Beyer <stef...@beyer.io> wrote:
> 
> rkgpio0 at rkpinctrl0
> rkgpio1 at rkpinctrl0
> rkgpio2 at rkpinctrl0
> rkgpio3 at rkpinctrl0
> rkgpio4 at rkpinctrl0

Is it possible to access GPIO and the connected LEDs?

My understanding is, that gpioleds should access the device tree:

        leds {
                compatible = "gpio-leds";

                sys_led: led-0 {
                        label = "sys_led";
                        gpios = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "heartbeat";
                        pinctrl-names = "default";
                        pinctrl-0 = <&sys_led_pin>;
                };

                wan_led: led-1 {
                        label = "wan_led";
                        gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>;
                        pinctrl-names = "default";
                        pinctrl-0 = <&wan_led_pin>;
                };

                lan1_led: led-2 {
                        label = "lan1_led";
                        gpios = <&gpio1 RK_PC3 GPIO_ACTIVE_HIGH>;
                        pinctrl-names = "default";
                        pinctrl-0 = <&lan1_led_pin>;
                };

                lan2_led: led-3 {
                        label = "lan2_led";
                        gpios = <&gpio1 RK_PC4 GPIO_ACTIVE_HIGH>;
                        pinctrl-names = "default";
                        pinctrl-0 = <&lan2_led_pin>;
                };
        };

…and make those available, but:

        gpioleds0 at mainbus0: no LEDs

Further, I tried in /etc/rc.securelevel:

        echo -n ' gpio'
        /usr/sbin/gpioctl gpio1 0 set out led0
        /usr/sbin/gpioctl gpio1 1 set out led1
        /usr/sbin/gpioctl gpio1 2 set out led2
        /usr/sbin/gpioctl gpio1 3 set out led3

…but:

        # gpioctl gpio1 0 1
        gpioctl: /dev/gpio1: Device not configured

How is it supposed to work?

Reply via email to