2021-11-04 20:52:43 +00:00
|
|
|
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>
|
kernel: bump 5.15 to 5.15.145
Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.145
No patches needed a rebase.
23.05 backport:
Rebased patch mediatek/100-dts-update-mt7622-rfb1.patch due to
changes introduced in commit e37aa926447f ("arm64: dts: mediatek:
mt7622: fix memory node warning check") in version v5.15.143 and we
jumped over from v5.15.139 directly to v5.15.145.
Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3
23.05 backport:
Stijn:
Compile-tested: ath79/generic, ipq40xx/generic, mvebu/cortexa72, ramips/mt{7621,7620,76x8}, realtek/rtl{838x,930x}, 86/64.
Run-tested: cortexa72 (RB5009UG+S+IN), mt7621 (EAP615-Wall v1), rtl838x (GS1900-10HP, GS1900-8HP, GS108T v3).
Petr:
Compile-tested: ipq807x, mvebu/cortexa9
Run-tested: turris-omnia, prpl-haze
Tested-by: Stijn Segers <foss@volatilesystems.org> [23.05 testing]
Signed-off-by: John Audia <therealgraysky@proton.me>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [23.05 refresh]
(cherry picked from commit 8de4cc77a6d5c25e48566d0203f159287ac7f3fe)
2023-12-23 11:52:06 +00:00
|
|
|
@@ -6910,6 +6911,22 @@ static void rtl_tally_reset(struct r8152
|
2021-11-04 20:52:43 +00:00
|
|
|
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;
|
kernel: bump 5.15 to 5.15.145
Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.145
No patches needed a rebase.
23.05 backport:
Rebased patch mediatek/100-dts-update-mt7622-rfb1.patch due to
changes introduced in commit e37aa926447f ("arm64: dts: mediatek:
mt7622: fix memory node warning check") in version v5.15.143 and we
jumped over from v5.15.139 directly to v5.15.145.
Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3
23.05 backport:
Stijn:
Compile-tested: ath79/generic, ipq40xx/generic, mvebu/cortexa72, ramips/mt{7621,7620,76x8}, realtek/rtl{838x,930x}, 86/64.
Run-tested: cortexa72 (RB5009UG+S+IN), mt7621 (EAP615-Wall v1), rtl838x (GS1900-10HP, GS1900-8HP, GS108T v3).
Petr:
Compile-tested: ipq807x, mvebu/cortexa9
Run-tested: turris-omnia, prpl-haze
Tested-by: Stijn Segers <foss@volatilesystems.org> [23.05 testing]
Signed-off-by: John Audia <therealgraysky@proton.me>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [23.05 refresh]
(cherry picked from commit 8de4cc77a6d5c25e48566d0203f159287ac7f3fe)
2023-12-23 11:52:06 +00:00
|
|
|
@@ -6951,6 +6968,8 @@ static void r8152b_init(struct r8152 *tp
|
2021-11-04 20:52:43 +00:00
|
|
|
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)
|
kernel: bump 5.15 to 5.15.145
Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.145
No patches needed a rebase.
23.05 backport:
Rebased patch mediatek/100-dts-update-mt7622-rfb1.patch due to
changes introduced in commit e37aa926447f ("arm64: dts: mediatek:
mt7622: fix memory node warning check") in version v5.15.143 and we
jumped over from v5.15.139 directly to v5.15.145.
Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3
23.05 backport:
Stijn:
Compile-tested: ath79/generic, ipq40xx/generic, mvebu/cortexa72, ramips/mt{7621,7620,76x8}, realtek/rtl{838x,930x}, 86/64.
Run-tested: cortexa72 (RB5009UG+S+IN), mt7621 (EAP615-Wall v1), rtl838x (GS1900-10HP, GS1900-8HP, GS108T v3).
Petr:
Compile-tested: ipq807x, mvebu/cortexa9
Run-tested: turris-omnia, prpl-haze
Tested-by: Stijn Segers <foss@volatilesystems.org> [23.05 testing]
Signed-off-by: John Audia <therealgraysky@proton.me>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [23.05 refresh]
(cherry picked from commit 8de4cc77a6d5c25e48566d0203f159287ac7f3fe)
2023-12-23 11:52:06 +00:00
|
|
|
@@ -7091,6 +7110,8 @@ static void r8153_init(struct r8152 *tp)
|
2021-11-04 20:52:43 +00:00
|
|
|
tp->coalesce = COALESCE_SLOW;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ r8152_led_configuration(tp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void r8153b_init(struct r8152 *tp)
|
kernel: bump 5.15 to 5.15.145
Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.145
No patches needed a rebase.
23.05 backport:
Rebased patch mediatek/100-dts-update-mt7622-rfb1.patch due to
changes introduced in commit e37aa926447f ("arm64: dts: mediatek:
mt7622: fix memory node warning check") in version v5.15.143 and we
jumped over from v5.15.139 directly to v5.15.145.
Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3
23.05 backport:
Stijn:
Compile-tested: ath79/generic, ipq40xx/generic, mvebu/cortexa72, ramips/mt{7621,7620,76x8}, realtek/rtl{838x,930x}, 86/64.
Run-tested: cortexa72 (RB5009UG+S+IN), mt7621 (EAP615-Wall v1), rtl838x (GS1900-10HP, GS1900-8HP, GS108T v3).
Petr:
Compile-tested: ipq807x, mvebu/cortexa9
Run-tested: turris-omnia, prpl-haze
Tested-by: Stijn Segers <foss@volatilesystems.org> [23.05 testing]
Signed-off-by: John Audia <therealgraysky@proton.me>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [23.05 refresh]
(cherry picked from commit 8de4cc77a6d5c25e48566d0203f159287ac7f3fe)
2023-12-23 11:52:06 +00:00
|
|
|
@@ -7173,6 +7194,8 @@ static void r8153b_init(struct r8152 *tp
|
2021-11-04 20:52:43 +00:00
|
|
|
rtl_tally_reset(tp);
|
|
|
|
|
|
|
|
tp->coalesce = 15000; /* 15 us */
|
|
|
|
+
|
|
|
|
+ r8152_led_configuration(tp);
|
|
|
|
}
|
|
|
|
|
2022-03-21 14:21:45 +00:00
|
|
|
static void r8153c_init(struct r8152 *tp)
|