--- a/src/r8125_n.c +++ b/src/r8125_n.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -14265,6 +14266,22 @@ rtl8125_setup_mqs_reg(struct rtl8125_pri } static void +rtl8125_led_configuration(struct rtl8125_private *tp) +{ + u32 led_data[4]; + int i, ret; + + const int led_regs[] = { 0x18, 0x86, 0x84, 0x96 }; + ret = of_property_read_u32_array(tp->pci_dev->dev.of_node, + "led-data", led_data, 4); + if (!ret) { + for (i = 0; i < 4; i++) { + RTL_W16(tp, led_regs[i], led_data[i]); + } + } +} + +static void rtl8125_init_software_variable(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); @@ -14720,6 +14737,7 @@ rtl8125_init_software_variable(struct ne else if (tp->InitRxDescType == RX_DESC_RING_TYPE_4) tp->rtl8125_rx_config &= ~EnableRxDescV4_1; + rtl8125_led_configuration(tp); tp->NicCustLedValue = RTL_R16(tp, CustomLED); tp->wol_opts = rtl8125_get_hw_wol(tp);