From: Heiner Kallweit Subject: Re: [PATCH V3] net: phy: tja11xx: Add TJA11xx PHY driver Date: Sat, 22 Dec 2018 21:51:13 +0100 Message-ID: References: <20181221233552.3741-1-marex@denx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Andrew Lunn , Florian Fainelli To: Marek Vasut , netdev@vger.kernel.org Return-path: Received: from mail-wm1-f65.google.com ([209.85.128.65]:50425 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731411AbeLVUvW (ORCPT ); Sat, 22 Dec 2018 15:51:22 -0500 Received: by mail-wm1-f65.google.com with SMTP id n190so8304191wmd.0 for ; Sat, 22 Dec 2018 12:51:21 -0800 (PST) In-Reply-To: <20181221233552.3741-1-marex@denx.de> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 22.12.2018 00:35, Marek Vasut wrote: > Add driver for the NXP TJA1100 and TJA1101 PHYs. These PHYs are special > BroadRReach 100BaseT1 PHYs used in automotive. > > Signed-off-by: Marek Vasut > Cc: Andrew Lunn > Cc: Florian Fainelli > Cc: Heiner Kallweit > --- > V2: - Use phy_modify(), phy_{set,clear}_bits() > - Drop enable argument of tja11xx_enable_link_control() > - Use PHY_BASIC_T1_FEATURES and dont modify supported/advertised > features in config_init callback > - Use genphy_soft_reset() instead of opencoding the reset sequence. > - Drop the aneg parts, since the PHY datasheet claims it does not > support aneg > V3: - Replace clr with mask > - Add hwmon support > - Check commstat in tja11xx_read_status() only if link is up > - Use PHY_ID_MATCH_MODEL() > --- > drivers/net/phy/Kconfig | 6 + > drivers/net/phy/Makefile | 1 + > drivers/net/phy/nxp-tja11xx.c | 424 ++++++++++++++++++++++++++++++++++ > 3 files changed, 431 insertions(+) > create mode 100644 drivers/net/phy/nxp-tja11xx.c [...] > +static int tja11xx_hwmon_read(struct device *dev, > + enum hwmon_sensor_types type, > + u32 attr, int channel, long *value) > +{ > + struct phy_device *phydev = dev_get_drvdata(dev); > + int ret; > + > + switch (attr) { > + case hwmon_in_lcrit_alarm: > + ret = phy_read(phydev, MII_INTSRC); > + if (ret < 0) > + return ret; > + > + *value = !!(ret & MII_INTSRC_TEMP_ERR); > + return 0; > + case hwmon_temp_crit_alarm: > + ret = phy_read(phydev, MII_INTSRC); > + if (ret < 0) > + return ret; > + > + *value = !!(ret & MII_INTSRC_TEMP_ERR); > + return 0; > + default: > + return -EOPNOTSUPP; > + } > +} This looks like a copy & paste error, in both cases you're doing the same.