diff options
| author | Markus Stockhausen | 2026-01-27 07:33:34 +0000 |
|---|---|---|
| committer | Robert Marko | 2026-01-31 10:19:14 +0000 |
| commit | 5731993557e55e2b491474382318d85718930cb4 (patch) | |
| tree | 0fbd29418c4141bcef51587b4f78514d2311dd7c | |
| parent | 75fd2497acb25f77528c7aa73470f303a98f8b63 (diff) | |
| download | openwrt-5731993557e55e2b491474382318d85718930cb4.tar.gz | |
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@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21741
Signed-off-by: Robert Marko <robimarko@gmail.com>
| -rw-r--r-- | target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c | 12 |
1 files 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; |