net: dsa: ocelot: felix: add interface for custom regmaps
Add an interface so that non-mmio regmaps can be used Signed-off-by: Colin Foster <colin.foster@in-advantage.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
49af6a7620
commit
242bd0c10b
@ -1028,7 +1028,7 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports)
|
||||
res.start += felix->switch_base;
|
||||
res.end += felix->switch_base;
|
||||
|
||||
target = ocelot_regmap_init(ocelot, &res);
|
||||
target = felix->info->init_regmap(ocelot, &res);
|
||||
if (IS_ERR(target)) {
|
||||
dev_err(ocelot->dev,
|
||||
"Failed to map device memory space\n");
|
||||
@ -1065,7 +1065,7 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports)
|
||||
res.start += felix->switch_base;
|
||||
res.end += felix->switch_base;
|
||||
|
||||
target = ocelot_regmap_init(ocelot, &res);
|
||||
target = felix->info->init_regmap(ocelot, &res);
|
||||
if (IS_ERR(target)) {
|
||||
dev_err(ocelot->dev,
|
||||
"Failed to map memory space for port %d\n",
|
||||
|
@ -50,6 +50,8 @@ struct felix_info {
|
||||
enum tc_setup_type type, void *type_data);
|
||||
void (*port_sched_speed_set)(struct ocelot *ocelot, int port,
|
||||
u32 speed);
|
||||
struct regmap *(*init_regmap)(struct ocelot *ocelot,
|
||||
struct resource *res);
|
||||
};
|
||||
|
||||
extern const struct dsa_switch_ops felix_switch_ops;
|
||||
|
@ -2240,6 +2240,7 @@ static const struct felix_info felix_info_vsc9959 = {
|
||||
.prevalidate_phy_mode = vsc9959_prevalidate_phy_mode,
|
||||
.port_setup_tc = vsc9959_port_setup_tc,
|
||||
.port_sched_speed_set = vsc9959_sched_speed_set,
|
||||
.init_regmap = ocelot_regmap_init,
|
||||
};
|
||||
|
||||
static irqreturn_t felix_irq_handler(int irq, void *data)
|
||||
|
@ -1104,6 +1104,7 @@ static const struct felix_info seville_info_vsc9953 = {
|
||||
.mdio_bus_free = vsc9953_mdio_bus_free,
|
||||
.phylink_validate = vsc9953_phylink_validate,
|
||||
.prevalidate_phy_mode = vsc9953_prevalidate_phy_mode,
|
||||
.init_regmap = ocelot_regmap_init,
|
||||
};
|
||||
|
||||
static int seville_probe(struct platform_device *pdev)
|
||||
|
Loading…
x
Reference in New Issue
Block a user