mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 15:02:32 +00:00
3da861ccca
Refreshed all patches. The following patches were manually changed: * 610-netfilter_match_bypass_default_checks.patch * 611-netfilter_match_bypass_default_table.patch * 802-can-0002-can-rx-offload-fix-long-lines.patch * 802-can-0003-can-rx-offload-can_rx_offload_compare-fix-typo.patch * 802-can-0004-can-rx-offload-can_rx_offload_irq_offload_timestamp-.patch * 802-can-0005-can-rx-offload-can_rx_offload_reset-remove-no-op-fun.patch * 802-can-0006-can-rx-offload-Prepare-for-CAN-FD-support.patch * 802-can-0018-can-flexcan-use-struct-canfd_frame-for-CAN-classic-f.patch The can-dev.ko model was moved in the upstream kernel. Compile-tested on: x86/64, armvirt/64, ath79/generic Runtime-tested on: x86/64, armvirt/64, ath79/generic Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
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
|
|
@@ -11,6 +11,7 @@
|
|
#include <linux/mii.h>
|
|
#include <linux/ethtool.h>
|
|
#include <linux/usb.h>
|
|
+#include <linux/of.h>
|
|
#include <linux/crc32.h>
|
|
#include <linux/if_vlan.h>
|
|
#include <linux/uaccess.h>
|
|
@@ -4335,6 +4336,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;
|
|
@@ -4376,6 +4393,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)
|
|
@@ -4510,6 +4529,8 @@ static void r8153_init(struct r8152 *tp)
|
|
tp->coalesce = COALESCE_SLOW;
|
|
break;
|
|
}
|
|
+
|
|
+ r8152_led_configuration(tp);
|
|
}
|
|
|
|
static void r8153b_init(struct r8152 *tp)
|
|
@@ -4586,6 +4607,8 @@ static void r8153b_init(struct r8152 *tp
|
|
rtl_tally_reset(tp);
|
|
|
|
tp->coalesce = 15000; /* 15 us */
|
|
+
|
|
+ r8152_led_configuration(tp);
|
|
}
|
|
|
|
static int rtl8152_pre_reset(struct usb_interface *intf)
|