aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/dsa/ocelot/felix.c
diff options
context:
space:
mode:
authorColin Foster <colin.foster@in-advantage.com>2023-01-27 11:35:53 -0800
committerJakub Kicinski <kuba@kernel.org>2023-01-30 21:07:20 -0800
commitdc454fa4b764ab75038e822dfc9a1b2526757a63 (patch)
tree857d3090634360b444e80ce9930552e070768765 /drivers/net/dsa/ocelot/felix.c
parentnet: dsa: felix: add configurable device quirks (diff)
downloadwireguard-linux-dc454fa4b764ab75038e822dfc9a1b2526757a63.tar.xz
wireguard-linux-dc454fa4b764ab75038e822dfc9a1b2526757a63.zip
net: dsa: felix: add support for MFD configurations
The architecture around the VSC7512 differs from existing felix drivers. In order to add support for all the chip's features (pinctrl, MDIO, gpio) the device had to be laid out as a multi-function device (MFD). One difference between an MFD and a standard platform device is that the regmaps are allocated to the parent device before the child devices are probed. As such, there is no need for felix to initialize new regmaps in these configurations, they can simply be requested from the parent device. Add support for MFD configurations by performing this request from the parent device. Signed-off-by: Colin Foster <colin.foster@in-advantage.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> # regression Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/ocelot/felix.c')
-rw-r--r--drivers/net/dsa/ocelot/felix.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 462a1a683996..d3ff6e8a82e9 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -1315,6 +1315,13 @@ static struct regmap *felix_request_regmap_by_name(struct felix *felix,
struct resource res;
int i;
+ /* In an MFD configuration, regmaps are registered directly to the
+ * parent device before the child devices are probed, so there is no
+ * need to initialize a new one.
+ */
+ if (!felix->info->resources)
+ return dev_get_regmap(ocelot->dev->parent, resource_name);
+
for (i = 0; i < felix->info->num_resources; i++) {
if (strcmp(resource_name, felix->info->resources[i].name))
continue;