mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-05-18 12:26:41 +00:00
Manually rebuild hack patches: - 200-tools_portability.patch - 204-module_strip.patch - 210-darwin_scripts_include.patch - 251-kconfig.patch - 421-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch - 610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch - 721-net-add-packet-mangeling.patch - 725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch - 760-net-usb-r8152-add-LED-configuration-from-OF.patch - 800-GPIO-add-named-gpio-exports.patch - 901-debloat_sock_diag.patch - 902-debloat_proc.patch - 904-debloat_dma_buf.patch - 910-kobject_uevent.patch - 911-kobject_add_broadcast_uevent.patch - 930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> [ improve commit title ] Link: https://github.com/openwrt/openwrt/pull/16547 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
75 lines
1.9 KiB
Diff
75 lines
1.9 KiB
Diff
From 82985725e071f2a5735052f18e109a32aeac3a0b Mon Sep 17 00:00:00 2001
|
|
From: David Bauer <mail@david-bauer.net>
|
|
Date: Sun, 26 Jul 2020 02:38:31 +0200
|
|
Subject: [PATCH] net: usb: r8152: add LED configuration from OF
|
|
|
|
This adds the ability to configure the LED configuration register using
|
|
OF. This way, the correct value for board specific LED configuration can
|
|
be determined.
|
|
|
|
Signed-off-by: David Bauer <mail@david-bauer.net>
|
|
---
|
|
drivers/net/usb/r8152.c | 23 +++++++++++++++++++++++
|
|
1 file changed, 23 insertions(+)
|
|
|
|
--- a/drivers/net/usb/r8152.c
|
|
+++ b/drivers/net/usb/r8152.c
|
|
@@ -12,6 +12,7 @@
|
|
#include <linux/ethtool.h>
|
|
#include <linux/phy.h>
|
|
#include <linux/usb.h>
|
|
+#include <linux/of.h>
|
|
#include <linux/crc32.h>
|
|
#include <linux/if_vlan.h>
|
|
#include <linux/uaccess.h>
|
|
@@ -7047,6 +7048,22 @@ static void rtl_tally_reset(struct r8152
|
|
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
|
|
}
|
|
|
|
+static int r8152_led_configuration(struct r8152 *tp)
|
|
+{
|
|
+ u32 led_data;
|
|
+ int ret;
|
|
+
|
|
+ ret = of_property_read_u32(tp->udev->dev.of_node, "realtek,led-data",
|
|
+ &led_data);
|
|
+
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_LEDSEL, led_data);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static void r8152b_init(struct r8152 *tp)
|
|
{
|
|
u32 ocp_data;
|
|
@@ -7088,6 +7105,8 @@ static void r8152b_init(struct r8152 *tp
|
|
ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
|
|
ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
|
|
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
|
|
+
|
|
+ r8152_led_configuration(tp);
|
|
}
|
|
|
|
static void r8153_init(struct r8152 *tp)
|
|
@@ -7228,6 +7247,8 @@ static void r8153_init(struct r8152 *tp)
|
|
tp->coalesce = COALESCE_SLOW;
|
|
break;
|
|
}
|
|
+
|
|
+ r8152_led_configuration(tp);
|
|
}
|
|
|
|
static void r8153b_init(struct r8152 *tp)
|
|
@@ -7310,6 +7331,8 @@ static void r8153b_init(struct r8152 *tp
|
|
rtl_tally_reset(tp);
|
|
|
|
tp->coalesce = 15000; /* 15 us */
|
|
+
|
|
+ r8152_led_configuration(tp);
|
|
}
|
|
|
|
static void r8153c_init(struct r8152 *tp)
|