net: dsa: mv88e6xxx: Add MDIO interrupts for internal PHYs
When registering an MDIO bus, it is possible to pass an array of interrupts, one per address on the bus. phylib will then associate the interrupt to the PHY device, if no other interrupt is provided. Some of the global2 interrupts are PHY interrupts. Place them into the MDIO bus structure. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committad av
David S. Miller

förälder
bc3931557d
incheckning
6f88284f3b
@@ -1107,6 +1107,38 @@ out:
|
||||
return err;
|
||||
}
|
||||
|
||||
int mv88e6xxx_g2_irq_mdio_setup(struct mv88e6xxx_chip *chip,
|
||||
struct mii_bus *bus)
|
||||
{
|
||||
int phy, irq, err, err_phy;
|
||||
|
||||
for (phy = 0; phy < chip->info->num_internal_phys; phy++) {
|
||||
irq = irq_find_mapping(chip->g2_irq.domain, phy);
|
||||
if (irq < 0) {
|
||||
err = irq;
|
||||
goto out;
|
||||
}
|
||||
bus->irq[chip->info->port_base_addr + phy] = irq;
|
||||
}
|
||||
return 0;
|
||||
out:
|
||||
err_phy = phy;
|
||||
|
||||
for (phy = 0; phy < err_phy; phy++)
|
||||
irq_dispose_mapping(bus->irq[phy]);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void mv88e6xxx_g2_irq_mdio_free(struct mv88e6xxx_chip *chip,
|
||||
struct mii_bus *bus)
|
||||
{
|
||||
int phy;
|
||||
|
||||
for (phy = 0; phy < chip->info->num_internal_phys; phy++)
|
||||
irq_dispose_mapping(bus->irq[phy]);
|
||||
}
|
||||
|
||||
int mv88e6xxx_g2_setup(struct mv88e6xxx_chip *chip)
|
||||
{
|
||||
u16 reg;
|
||||
|
Referens i nytt ärende
Block a user