lede/package/kernel/r8125/patches/300-r8125-add-LED-configuration-from-OF.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d9b7f9c144 kernel: r8125: update to v9.016.00
Changelog: https://github.com/openwrt/rtl8125/compare/9.015.00...9.016.00

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-09 18:00:18 +08:00

42 lines
1.2 KiB
Diff

--- a/src/r8125_n.c
+++ b/src/r8125_n.c
@@ -44,6 +44,7 @@
#include <linux/etherdevice.h>
#include <linux/delay.h>
#include <linux/mii.h>
+#include <linux/of.h>
#include <linux/if_vlan.h>
#include <linux/crc32.h>
#include <linux/interrupt.h>
@@ -14808,6 +14809,22 @@ rtl8125_restore_phy_fuse_dout(struct rtl
}
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);
@@ -15309,6 +15326,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);
rtl8125_backup_led_select(tp);
tp->wol_opts = rtl8125_get_hw_wol(tp);