This is how OEM is using leds for LAN + WLAN.
ledc@191E000 {
compatible = "qca,ledc";
reg = <0x191e000 0x20070>;
reg-names = "ledc_base_addr";
qcom,tcsr_ledc_values = <0x320193 0x00 0x00 0x00 0x00 0xffffffff 0xffffffff 0xffffffff 0x7d0820 0x00 0x10482094 0x3ffffe1>;
qcom,ledc_blink_indices_cnt = <0x06>;
qcom,ledc_blink_indices = <0x0f 0x0e 0x0d 0x0c 0x0b 0x0a 0x17>;
qcom,ledc_blink_idx_src_pair = <0x06 0x14>;
status = "ok";
pinctrl-0 = <0x2f>;
pinctrl-names = "default";
led_lan_g {
label = "led_lan_g";
linux,default-trigger = "none";
};
led_lan_o {
label = "led_lan_o";
linux,default-trigger = "none";
};
led_2g_b {
label = "led_2g_b";
linux,default-trigger = "none";
};
led_2g_g {
label = "led_2g_g";
linux,default-trigger = "none";
};
led_5g_b {
label = "led_5g_b";
linux,default-trigger = "none";
};
led_5g_g {
label = "led_5g_g";
linux,default-trigger = "none";
};
};
And in a script they do this
usage()
{
echo -n "Usage : /etc/netgear_leds.sh <all|colour|led> <on|off>
Valid arguments are :
2g_blue - Turn on/off 2.4G WLAN Blue colour LED
2g_green - Turn on/off 2.4G WLAN Green colour LED"
if [ ${WLAN_NUM_RADIOS} = "3" ]; then
echo -n "
5g_low_blue - Turn on/off 5G_LOW WLAN Blue colour LED
5g_low_green - Turn on/off 5G_LOW WLAN Green colour LED
5g_high_blue - Turn on/off 5G_HIGH WLAN Blue colour LED
5g_high_green - Turn on/off 5G_HIGH WLAN Green colour LED"
else echo -n "
5g_blue - Turn on/off 5G WLAN Blue colour LED
5g_green - Turn on/off 5G WLAN Green colour LED"
fi
echo "
pwr_green - Turn on/off Power Green LED
pwr_red - Turn on/off Power Red LED
pwr_blue - Turn on/off Power Blue LED"
if [ ${ETH_NUM_PORTS} = "2" ]; then
echo -n "
lan1_green - Turn on/off LAN1 Green LED
lan1_amber - Turn on/off LAN1 Orange LED
lan2_green - Turn on/off LAN2 Green LED
lan2_amber - Turn on/off LAN2 Orange LED"
else echo -n "
lan_green - Turn on/off LAN Green LED
lan_amber - Turn on/off LAN Orange LED"
fi
echo "
blue - Turn on/off all Blue LEDs
green - Turn on/off all Green LEDs
red - Turn on/off all Red LEDs
amber - Turn on/off all Amber LEDs
all - Turn on/off all LEDs
Example:
/etc/netgear_leds.sh pwr_red off
/etc/netgear_leds.sh all on"
exit 1
}
And some of this
RESET_DELAY_ON=75
RESET_DELAY_OFF=75
DELAY_ON=1000
DELAY_OFF=1000
led_set_attr() {
[ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2"
}
led_timer() {
led_set_attr $1 "trigger" "timer"
led_set_attr $1 "delay_on" "$2"
led_set_attr $1 "delay_off" "$3"
}
led_on() {
led_set_attr $1 "trigger" "none"
led_set_attr $1 "brightness" 255
}
led_off() {
led_set_attr $1 "trigger" "none"
led_set_attr $1 "brightness" 0
}
start_pwr_led_blink_green()
{
led_timer led_pwr_g $DELAY_ON $DELAY_OFF
}
stop_pwr_led_blink_green()
{
led_off led_pwr_g
}
Is this a smiliar way(ish) to how Verizon CR1000A is doing it?