Thread (36 messages) 36 messages, 4 authors, 2022-01-15

[RFC v5 net-next 13/13] mfd: ocelot: add ocelot-pinctrl as a supported child interface

flat view
STALE1753d

From: Colin Foster <colin.foster@in-advantage.com>
Date: 2021-12-18 21:50:48
Also in: linux-gpio, lkml
Subsystem: multifunction devices (mfd), ocelot external switch control, the rest · Maintainers: Lee Jones, Colin Foster, Linus Torvalds

Revision v5 (2 revisions archived).

Revisions (2)
  1. v4
  2. v5 current [diff against previous]
The ocelot-pinctrl device is able to be utilized by ocelot_mfd. This simply
enables that child driver.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---
 drivers/mfd/ocelot-core.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff --git a/drivers/mfd/ocelot-core.c b/drivers/mfd/ocelot-core.c
index c67e433f467c..71e062934812 100644
--- a/drivers/mfd/ocelot-core.c
+++ b/drivers/mfd/ocelot-core.c
@@ -113,7 +113,22 @@ static const struct resource vsc7512_miim1_resources[] = {
 	},
 };
 
+static const struct resource vsc7512_pinctrl_resources[] = {
+	{
+		.start = 0x71070034,
+		.end = 0x7107009f,
+		.name = "gcb_gpio",
+		.flags = IORESOURCE_MEM,
+	},
+};
+
 static const struct mfd_cell vsc7512_devs[] = {
+	{
+		.name = "pinctrl-ocelot",
+		.of_compatible = "mscc,ocelot-pinctrl",
+		.num_resources = ARRAY_SIZE(vsc7512_pinctrl_resources),
+		.resources = vsc7512_pinctrl_resources,
+	},
 	{
 		.name = "ocelot-miim1",
 		.of_compatible = "mscc,ocelot-miim",
@@ -164,6 +179,10 @@ int ocelot_mfd_init(struct ocelot_mfd_config *config)
 
 	ret = mfd_add_devices(dev, PLATFORM_DEVID_NONE, vsc7512_devs,
 			      ARRAY_SIZE(vsc7512_devs), NULL, 0, NULL);
+	if (ret) {
+		dev_err(dev, "error adding mfd devices\n");
+		return ret;
+	}
 
 	dev_info(dev, "ocelot mfd core setup complete\n");
 
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help