[openwrt/openwrt] realtek: mdio: add regmap to bus structure
LEDE Commits
lede-commits at lists.infradead.org
Sat Jan 31 02:19:22 PST 2026
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5731993557e55e2b491474382318d85718930cb4
commit 5731993557e55e2b491474382318d85718930cb4
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue Jan 27 08:33:34 2026 +0100
realtek: mdio: add regmap to bus structure
To convert the existing sw_xxx() commands the bus needs a regmap.
This is derived from the parent mfd node like in all other Realtek
drivers.
Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21741
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
.../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
index 97fe300108..eebf6d5274 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-only
+#include <linux/fwnode.h>
#include <linux/fwnode_mdio.h>
-#include <linux/mutex.h>
-#include <linux/of_mdio.h>
-#include <linux/of_net.h>
-#include <linux/of_platform.h>
+#include <linux/mfd/syscon.h>
+#include <linux/of.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/types.h>
@@ -175,6 +174,7 @@
struct rtmdio_ctrl {
+ struct regmap *map;
const struct rtmdio_config *cfg;
int page[RTMDIO_MAX_PORT];
bool raw[RTMDIO_MAX_PORT];
@@ -899,6 +899,10 @@ static int rtmdio_probe(struct platform_device *pdev)
ctrl = bus->priv;
ctrl->cfg = (const struct rtmdio_config *)device_get_match_data(dev);
+ ctrl->map = syscon_node_to_regmap(pdev->dev.of_node->parent);
+ if (IS_ERR(ctrl->map))
+ return PTR_ERR(ctrl->map);
+
for (addr = 0; addr < RTMDIO_MAX_PORT; addr++)
ctrl->smi_bus[addr] = -1;
More information about the lede-commits
mailing list