[BPI-R64] red LED


on r64 there are 2 GPIO-LEDS defined in dts, if i enable LEDS_GPIO in my kernel i can switch on the green one with this command:

echo 1 > /sys/class/leds/bpi-r64\:pio\:green/brightness

but the red one is always on like the blue one which is not defined in dts.

as on r2 the red led was also fixed and defined in dts i want to ask if it is possible to switch it by such command

regards Frank

According to the schematics the red led is wired to GPIO 88:

this matches the definition in dts: unfortunately, as you stated, the red led can not be switched on/off by using /sys/class/led…

Perhaps someone from bpi team can tell, whether the schematics are not correct here?

The patch below adds definition for the blue LED, which is available and can be switched using /sys/class/led after applying the patch.

Index: linux-5.4.8/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
--- linux-5.4.8.orig/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
+++ linux-5.4.8/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
@@ -56,6 +56,12 @@
        leds {
                compatible = "gpio-leds";
+               blue {
+                       label = "bpi-r64:pio:blue";
+                       gpios = <&pio 85 GPIO_ACTIVE_LOW>;
+                       default-state = "keep";
+               };
                green {
                        label = "bpi-r64:pio:green";
                        gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
1 Like

are you sure it is GPIO_ACTIVE_LOW ?

also i noticed 3 additional LEDs (D1,D2,D7) between pcie-slots, maybe these can also be driven?

@sinovoip any info about red led?

Yes, I have tested it… active_low makes the blue led behaving as expected.

The 3 additional LEDs (between the mpcie-slots) are wired to the mpcie-slots (according to schematics):

  • D1: CN8 WWAN (not validated)
  • D2: CN8 Wifi (works/validated using iwlwifi, which exports LED to /sys/class/led )
  • D7: CN25 Wifi (works/validated using iwlwifi, which exports LED to /sys/class/led)
1 Like

ok, you’re right, 1 switches on and 0 off (with active low), by default it was on