summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2009-04-07 02:01:43 +0000
committerDavid S. Miller <davem@davemloft.net>2009-04-13 14:51:25 -0700
commitdcd07be3ffab7d20f4d498369e7526f6f4945257 (patch)
tree00d4eb7adcf9d1cf0219143454e8729a131c3408 /drivers/net/phy
parenta8729eb302a5b5da8b0b4d29582c42648a2e0f12 (diff)
phylib: Add interrupt source check function to M88E1121R driver
Add did_interrupt() function to check if a PHY port really caused an interrupt. This is needed in the case of shared PHY interrupt pin configuration to stop interrupt event processing for PHY ports which didn't cause an interrupt. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/marvell.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index e9f436ba800..7a3ec9d39a9 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -458,6 +458,18 @@ static int marvell_read_status(struct phy_device *phydev)
return 0;
}
+static int m88e1121_did_interrupt(struct phy_device *phydev)
+{
+ int imask;
+
+ imask = phy_read(phydev, MII_M1011_IEVENT);
+
+ if (imask & MII_M1011_IMASK_INIT)
+ return 1;
+
+ return 0;
+}
+
static struct phy_driver marvell_drivers[] = {
{
.phy_id = 0x01410c60,
@@ -520,6 +532,7 @@ static struct phy_driver marvell_drivers[] = {
.read_status = &marvell_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
+ .did_interrupt = &m88e1121_did_interrupt,
.driver = { .owner = THIS_MODULE },
},
{