diff options
author | Claudiu Manoil <claudiu.manoil@nxp.com> | 2019-11-14 17:03:21 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-15 12:32:16 -0800 |
commit | dc3de2a294eab8b1375f96eb4cf2a1d5edfcc9ab (patch) | |
tree | 7ba8008564e6b6dfafe0d21608aae23aec6f5212 /drivers/net/ethernet/mscc/ocelot.h | |
parent | net: mscc: ocelot: move resource ioremap and regmap init to common code (diff) | |
download | linux-dev-dc3de2a294eab8b1375f96eb4cf2a1d5edfcc9ab.tar.xz linux-dev-dc3de2a294eab8b1375f96eb4cf2a1d5edfcc9ab.zip |
net: mscc: ocelot: filter out ocelot SoC specific PCS config from common path
The adjust_link routine should be generic enough to be (re)used by
any SoC that integrates a switch core compatible with the Ocelot
core switch driver. Currently all configurations are generic except
for the PCS settings that are SoC specific. Move these out to the
Ocelot SoC/board instance.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc/ocelot.h')
-rw-r--r-- | drivers/net/ethernet/mscc/ocelot.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot.h b/drivers/net/ethernet/mscc/ocelot.h index b5802cea7cc4..7e28434c22c1 100644 --- a/drivers/net/ethernet/mscc/ocelot.h +++ b/drivers/net/ethernet/mscc/ocelot.h @@ -435,13 +435,19 @@ enum ocelot_tag_prefix { }; struct ocelot_port; +struct ocelot; struct ocelot_stat_layout { u32 offset; char name[ETH_GSTRING_LEN]; }; +struct ocelot_ops { + void (*pcs_init)(struct ocelot *ocelot, int port); +}; + struct ocelot { + const struct ocelot_ops *ops; struct device *dev; struct regmap *targets[TARGET_MAX]; @@ -553,7 +559,7 @@ struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res); int ocelot_init(struct ocelot *ocelot); void ocelot_deinit(struct ocelot *ocelot); -int ocelot_chip_init(struct ocelot *ocelot); +int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops); int ocelot_probe_port(struct ocelot *ocelot, u8 port, void __iomem *regs, struct phy_device *phy); |