mirror of https://github.com/armbian/build.git
50 lines
1.5 KiB
Diff
50 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: John Doe <john.doe@somewhere.on.planet>
|
|
Date: Sat, 30 Aug 2025 14:20:46 +0800
|
|
Subject: net: ethernet: realtek: add r8169 LED configuration from OF
|
|
|
|
Signed-off-by: retro98boy <retro98boy@qq.com>
|
|
---
|
|
drivers/net/ethernet/realtek/r8169_main.c | 11 ++++++++++
|
|
1 file changed, 11 insertions(+)
|
|
|
|
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
|
|
index 111111111111..222222222222 100644
|
|
--- a/drivers/net/ethernet/realtek/r8169_main.c
|
|
+++ b/drivers/net/ethernet/realtek/r8169_main.c
|
|
@@ -21,6 +21,7 @@
|
|
#include <linux/in.h>
|
|
#include <linux/io.h>
|
|
#include <linux/ip.h>
|
|
+#include <linux/of.h>
|
|
#include <linux/tcp.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/dma-mapping.h>
|
|
@@ -2382,6 +2383,15 @@ void r8169_apply_firmware(struct rtl8169_private *tp)
|
|
}
|
|
}
|
|
|
|
+static void rtl8168_led_of_init(struct rtl8169_private *tp)
|
|
+{
|
|
+ struct device *d = tp_to_dev(tp);
|
|
+ u32 val;
|
|
+
|
|
+ if (!of_property_read_u32(d->of_node, "realtek,led-data", &val))
|
|
+ RTL_W16(tp, LED_CTRL, val);
|
|
+}
|
|
+
|
|
static void rtl8168_config_eee_mac(struct rtl8169_private *tp)
|
|
{
|
|
/* Adjust EEE LED frequency */
|
|
@@ -3399,6 +3409,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
|
|
rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000);
|
|
|
|
rtl8168_config_eee_mac(tp);
|
|
+ rtl8168_led_of_init(tp);
|
|
|
|
RTL_W8(tp, DLLPR, RTL_R8(tp, DLLPR) & ~PFM_EN);
|
|
RTL_W8(tp, MISC_1, RTL_R8(tp, MISC_1) & ~PFM_D3COLD_EN);
|
|
--
|
|
Armbian
|
|
|