@@ -15,6 +15,7 @@
#include <linux/phy_fixed.h>
#include <linux/of_net.h>
#include <linux/of_mdio.h>
+#include <linux/of_irq.h>
#include <linux/mdio.h>
#include <linux/list.h>
#include <net/rtnetlink.h>
@@ -1119,6 +1120,13 @@ static int dsa_slave_phy_connect(struct dsa_slave_priv *p,
return -ENODEV;
}
+ /*
+ * If the PHY has a link IRQ associated with it in the device tree,
+ * then assign it so it can be claimed by the core.
+ */
+ if (of_irq_count(p->dp->dn))
+ p->phy->irq = irq_of_parse_and_map(p->dp->dn, 0);
+
/* Use already configured phy mode */
if (p->phy_interface == PHY_INTERFACE_MODE_NA)
p->phy_interface = p->phy->interface;
PHYs attached to DSAs may provide IRQs from GPIOs or other interrupt controllers in the device tree. For these cases, we need to go and grab the IRQ before registering the slave so the PHY core can grab and enable this IRQ. Cc: Antti Seppälä <a.seppala@gmail.com> Cc: Roman Yeryomin <roman@advem.lv> Cc: Colin Leitner <colin.leitner@googlemail.com> Cc: Gabor Juhos <juhosg@openwrt.org> Cc: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- net/dsa/slave.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.13.6