Re: [PATCH] net: phy: tja11xx: Add IRQ support to the driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/28/19 8:21 PM, Florian Fainelli wrote:
> On 5/28/19 11:16 AM, Marek Vasut wrote:
>> Add support for handling the TJA11xx PHY IRQ signal.
>>
>> Signed-off-by: Marek Vasut <marex@xxxxxxx>
>> Cc: Andrew Lunn <andrew@xxxxxxx>
>> Cc: Florian Fainelli <f.fainelli@xxxxxxxxx>
>> Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
>> Cc: Heiner Kallweit <hkallweit1@xxxxxxxxx>
>> Cc: Jean Delvare <jdelvare@xxxxxxxx>
>> Cc: linux-hwmon@xxxxxxxxxxxxxxx
>> ---
>>  drivers/net/phy/nxp-tja11xx.c | 32 ++++++++++++++++++++++++++++++++
>>  1 file changed, 32 insertions(+)
>>
>> diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c
>> index b705d0bd798b..0be9fe9a9604 100644
>> --- a/drivers/net/phy/nxp-tja11xx.c
>> +++ b/drivers/net/phy/nxp-tja11xx.c
>> @@ -40,6 +40,8 @@
>>  #define MII_INTSRC_TEMP_ERR		BIT(1)
>>  #define MII_INTSRC_UV_ERR		BIT(3)
>>  
>> +#define MII_INTEN			22
>> +
>>  #define MII_COMMSTAT			23
>>  #define MII_COMMSTAT_LINK_UP		BIT(15)
>>  
>> @@ -239,6 +241,30 @@ static int tja11xx_read_status(struct phy_device *phydev)
>>  	return 0;
>>  }
>>  
>> +static int tja11xx_config_intr(struct phy_device *phydev)
>> +{
>> +	int ret;
>> +
>> +	if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
>> +		ret = phy_write(phydev, MII_INTEN, 0xcfef);
> 
> It would be nice to define the shifts and masks being used here. Other
> than that, this looks good.

OK

-- 
Best regards,
Marek Vasut



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux