From mboxrd@z Thu Jan 1 00:00:00 1970 From: Esben Haabendal Subject: Re: [PATCH] net: phy: marvell: Enable interrupt function on LED2 pin Date: Fri, 06 Apr 2018 19:10:58 +0200 Message-ID: <871sfs1crh.fsf@gmail.com> References: <20180405133504.12257-1-esben.haabendal@gmail.com> <4d9e0665abf7408988fc4ce20c26a08f@bgmail102.nvidia.com> <20180405144355.GB32663@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain Cc: Bhadram Varka , Rasmus Villemoes , Florian Fainelli , open list , "netdev\@vger.kernel.org" To: Andrew Lunn Return-path: In-Reply-To: <20180405144355.GB32663@lunn.ch> (Andrew Lunn's message of "Thu, 5 Apr 2018 16:43:55 +0200") Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Andrew Lunn writes: >> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index >> 0e0978d8a0eb..f03a510f1247 100644 >> --- a/drivers/net/phy/marvell.c >> +++ b/drivers/net/phy/marvell.c >> @@ -457,6 +457,21 @@ static int marvell_of_reg_init(struct phy_device >> *phydev) } #endif /* CONFIG_OF_MDIO */ >> >> +static int m88e1318_config_intr(struct phy_device *phydev) { >> + int err; >> + >> + err = marvell_config_intr(phydev); >> + if (err) >> + return err; >> + >> + /* Setup LED[2] as interrupt pin (active low) */ >> + return phy_modify(phydev, MII_88E1318S_PHY_LED_TCR, >> + MII_88E1318S_PHY_LED_TCR_FORCE_INT, >> + MII_88E1318S_PHY_LED_TCR_INTn_ENABLE | >> + MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW); >> >> Can we move this part of the code to m88e1121_config_init() ? >> >> Every time whether we disable or enable the interrupts this part of code >> will execute. > > Yes, doing this once would be better. But please allow the LED pin to > be used as an LED when not using interrupts. phy_interrupt_is_valid() > should be involved somehow. This should be addressed in v2 of the patch which I have already posted. /Esben