diff mbox series

[RFC,v3,net-next,08/10] net: mscc: ocelot: felix: add ability to enable a CPU / NPI port

Message ID 20210814025003.2449143-9-colin.foster@in-advantage.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series add support for VSC75XX control over SPI | expand

Checks

Context Check Description
netdev/apply fail Patch does not apply to net-next
netdev/tree_selection success Clearly marked for net-next

Commit Message

Colin Foster Aug. 14, 2021, 2:50 a.m. UTC
For the vsc7512 ocelot SPI driver, the CPU interface port needs to be enabled,
but can't be enabled via ocelot_adjust_link since it doesn't have a phylink.
This adds a hook so the port can be manually enabled.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---
 drivers/net/dsa/ocelot/felix.c | 5 +++++
 drivers/net/dsa/ocelot/felix.h | 1 +
 2 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 77644deb4a35..33c0c7bc3e58 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -492,8 +492,13 @@  static void felix_teardown_tag_8021q(struct dsa_switch *ds, int cpu)
  */
 static void felix_npi_port_init(struct ocelot *ocelot, int port)
 {
+	struct felix *felix = ocelot_to_felix(ocelot);
+
 	ocelot->npi = port;
 
+	if (felix->info->enable_npi_port)
+		felix->info->enable_npi_port(ocelot);
+
 	ocelot_write(ocelot, QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK_M |
 		     QSYS_EXT_CPU_CFG_EXT_CPU_PORT(port),
 		     QSYS_EXT_CPU_CFG);
diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h
index 25f664ef4947..c872705115bc 100644
--- a/drivers/net/dsa/ocelot/felix.h
+++ b/drivers/net/dsa/ocelot/felix.h
@@ -47,6 +47,7 @@  struct felix_info {
 					u32 speed);
 	struct regmap *(*init_regmap)(struct ocelot *ocelot,
 				      struct resource *res);
+	void	(*enable_npi_port)(struct ocelot *ocelot);
 };
 
 extern const struct dsa_switch_ops felix_switch_ops;