Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 703e495f authored by Dilip Kota's avatar Dilip Kota
Browse files

msm: emac: Improve wake-on-lan interrupt handler



AT803x is a single port external phy, whereas QCA8337
is a multi port external phy, so differentiate the AT803x
interrupt handling from QCA8337.

Change-Id: I8b833ad4b4466a7c6154b48a87db8542e3479ba4
Signed-off-by: default avatarDilip Kota <dkota@codeaurora.org>
parent f67a2861
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -1163,9 +1163,11 @@ static irqreturn_t emac_wol_isr(int irq, void *data)


	for (i = 0; i < QCA8337_NUM_PHYS ; i++) {
	for (i = 0; i < QCA8337_NUM_PHYS ; i++) {
		ret = mdiobus_read(adpt->phydev->bus, i, MII_INT_STATUS);
		ret = mdiobus_read(adpt->phydev->bus, i, MII_INT_STATUS);

		if ((ret & LINK_SUCCESS_INTERRUPT) || (ret & LINK_SUCCESS_BX) ||
		if ((ret & LINK_SUCCESS_INTERRUPT) || (ret & LINK_SUCCESS_BX))
		    (ret & WOL_INT))
			val |= 1 << i;
			val |= 1 << i;
		if (QCA8337_PHY_ID != adpt->phydev->phy_id)
			break;
	}
	}


	pm_runtime_mark_last_busy(netdev->dev.parent);
	pm_runtime_mark_last_busy(netdev->dev.parent);
@@ -1174,7 +1176,7 @@ static irqreturn_t emac_wol_isr(int irq, void *data)
	if (!pm_runtime_status_suspended(adpt->netdev->dev.parent)) {
	if (!pm_runtime_status_suspended(adpt->netdev->dev.parent)) {
		if (val)
		if (val)
			emac_wol_gpio_irq(adpt, false);
			emac_wol_gpio_irq(adpt, false);
		if (val & WOL_INT)
		if (ret & WOL_INT)
			__pm_stay_awake(&adpt->link_wlock);
			__pm_stay_awake(&adpt->link_wlock);
	}
	}
	return IRQ_HANDLED;
	return IRQ_HANDLED;