diff mbox

[U-Boot,6/7] net: phy: Add phy_interface_is_sgmii to phy.h

Message ID 1460131707-8496-6-git-send-email-dmurphy@ti.com
State Accepted
Commit 3c221af3c3bb4eadc0899f611c8b25bb95a1e09f
Delegated to: Joe Hershberger
Headers show

Commit Message

Dan Murphy April 8, 2016, 4:08 p.m. UTC
Add a helper to phy.h to identify whether the
phy is configured for SGMII all variables.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 include/phy.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Mugunthan V N April 11, 2016, 5:37 a.m. UTC | #1
On Friday 08 April 2016 09:38 PM, Dan Murphy wrote:
> Add a helper to phy.h to identify whether the
> phy is configured for SGMII all variables.
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>

Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>

Regards
Mugunthan V N
Michal Simek April 11, 2016, 7:06 a.m. UTC | #2
On 8.4.2016 18:08, Dan Murphy wrote:
> Add a helper to phy.h to identify whether the
> phy is configured for SGMII all variables.
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  include/phy.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/include/phy.h b/include/phy.h
> index 7b2d1ff..ef3eb51 100644
> --- a/include/phy.h
> +++ b/include/phy.h
> @@ -288,6 +288,17 @@ static inline bool phy_interface_is_rgmii(struct phy_device *phydev)
>  		phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID;
>  }
>  
> +/**
> + * phy_interface_is_sgmii - Convenience function for testing if a PHY interface
> + * is SGMII (all variants)
> + * @phydev: the phy_device struct
> + */
> +static inline bool phy_interface_is_sgmii(struct phy_device *phydev)
> +{
> +	return phydev->interface >= PHY_INTERFACE_MODE_SGMII &&
> +		phydev->interface <= PHY_INTERFACE_MODE_QSGMII;
> +}
> +
>  /* PHY UIDs for various PHYs that are referenced in external code */
>  #define PHY_UID_CS4340  0x13e51002
>  #define PHY_UID_TN2020	0x00a19410
> 

Reviewed-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal
diff mbox

Patch

diff --git a/include/phy.h b/include/phy.h
index 7b2d1ff..ef3eb51 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -288,6 +288,17 @@  static inline bool phy_interface_is_rgmii(struct phy_device *phydev)
 		phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID;
 }
 
+/**
+ * phy_interface_is_sgmii - Convenience function for testing if a PHY interface
+ * is SGMII (all variants)
+ * @phydev: the phy_device struct
+ */
+static inline bool phy_interface_is_sgmii(struct phy_device *phydev)
+{
+	return phydev->interface >= PHY_INTERFACE_MODE_SGMII &&
+		phydev->interface <= PHY_INTERFACE_MODE_QSGMII;
+}
+
 /* PHY UIDs for various PHYs that are referenced in external code */
 #define PHY_UID_CS4340  0x13e51002
 #define PHY_UID_TN2020	0x00a19410