Commit 8f17a6a8 authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge branch 'net-phy-marvell-88q2xxx-cleanup'



Dimitri Fedrau says:

====================
net: phy: marvell-88q2xxx: cleanup

- align defines
- order includes alphabetically
- enable temperature sensor in mv88q2xxx_config_init

Signed-off-by: default avatarDimitri Fedrau <dima.fedrau@gmail.com>
====================

Link: https://patch.msgid.link/20250214-marvell-88q2xxx-cleanup-v1-0-71d67c20f308@gmail.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 01072dea 6c806720
Loading
Loading
Loading
Loading
+37 −40
Original line number Diff line number Diff line
@@ -7,10 +7,10 @@
 * Copyright (C) 2024 Liebherr-Electronics and Drives GmbH
 */
#include <linux/ethtool_netlink.h>
#include <linux/hwmon.h>
#include <linux/marvell_phy.h>
#include <linux/of.h>
#include <linux/phy.h>
#include <linux/hwmon.h>

#define PHY_ID_88Q2220_REVB0				(MARVELL_PHY_ID_88Q2220 | 0x1)
#define PHY_ID_88Q2220_REVB1				(MARVELL_PHY_ID_88Q2220 | 0x2)
@@ -513,6 +513,15 @@ static int mv88q2xxx_config_init(struct phy_device *phydev)
			return ret;
	}

	/* Enable temperature sense */
	if (priv->enable_temp) {
		ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
				     MDIO_MMD_PCS_MV_TEMP_SENSOR2,
				     MDIO_MMD_PCS_MV_TEMP_SENSOR2_DIS_MASK, 0);
		if (ret < 0)
			return ret;
	}

	return 0;
}

@@ -903,18 +912,6 @@ static int mv88q222x_revb1_revb2_config_init(struct phy_device *phydev)

static int mv88q222x_config_init(struct phy_device *phydev)
{
	struct mv88q2xxx_priv *priv = phydev->priv;
	int ret;

	/* Enable temperature sense */
	if (priv->enable_temp) {
		ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
				     MDIO_MMD_PCS_MV_TEMP_SENSOR2,
				     MDIO_MMD_PCS_MV_TEMP_SENSOR2_DIS_MASK, 0);
		if (ret < 0)
			return ret;
	}

	if (phydev->c45_ids.device_ids[MDIO_MMD_PMAPMD] == PHY_ID_88Q2220_REVB0)
		return mv88q222x_revb0_config_init(phydev);
	else