Commit fc9eae25 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull phy fixes from Vinod Koul:

 - Qualcomm PCS table fix for ufs phy

 - TI device node reference fix

 - Common prop kconfig fix

 - lynx CDR lock workaround for lanes disabled

 - usb disconnect function fix of k1 driver

* tag 'phy-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
  phy: qcom: qmp-ufs: Fix SM8650 PCS table for Gear 4
  phy: ti: j721e-wiz: Fix device node reference leak in wiz_get_lane_phy_types()
  phy: k1-usb: add disconnect function support
  phy: lynx-28g: skip CDR lock workaround for lanes disabled in the device tree
  phy: make PHY_COMMON_PROPS Kconfig symbol conditionally user-selectable
parents a516c618 81af9e40
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
menu "PHY Subsystem"

config PHY_COMMON_PROPS
	bool
	bool "PHY common properties" if KUNIT_ALL_TESTS
	help
	  This parses properties common between generic PHYs and Ethernet PHYs.

@@ -16,8 +16,7 @@ config PHY_COMMON_PROPS

config PHY_COMMON_PROPS_TEST
	tristate "KUnit tests for PHY common props" if !KUNIT_ALL_TESTS
	select PHY_COMMON_PROPS
	depends on KUNIT
	depends on KUNIT && PHY_COMMON_PROPS
	default KUNIT_ALL_TESTS
	help
	  This builds KUnit tests for the PHY common property API.
+2 −0
Original line number Diff line number Diff line
@@ -1069,6 +1069,8 @@ static void lynx_28g_cdr_lock_check(struct work_struct *work)

	for (i = 0; i < LYNX_28G_NUM_LANE; i++) {
		lane = &priv->lane[i];
		if (!lane->phy)
			continue;

		mutex_lock(&lane->phy->mutex);

+1 −2
Original line number Diff line number Diff line
@@ -990,6 +990,7 @@ static const struct qmp_phy_init_tbl sm8650_ufsphy_pcs[] = {
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_MULTI_LANE_CTRL1, 0x02),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_MID_TERM_CTRL1, 0x43),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PCS_CTRL1, 0xc1),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x33),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_LARGE_AMP_DRV_LVL, 0x0f),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_SIGDET_CTRL2, 0x68),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_POST_EMP_LVL_S4, 0x0e),
@@ -999,13 +1000,11 @@ static const struct qmp_phy_init_tbl sm8650_ufsphy_pcs[] = {
};

static const struct qmp_phy_init_tbl sm8650_ufsphy_g4_pcs[] = {
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x13),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_HSGEAR_CAPABILITY, 0x04),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_HSGEAR_CAPABILITY, 0x04),
};

static const struct qmp_phy_init_tbl sm8650_ufsphy_g5_pcs[] = {
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x33),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_HSGEAR_CAPABILITY, 0x05),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_HSGEAR_CAPABILITY, 0x05),
	QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_HS_G5_SYNC_LENGTH_CAPABILITY, 0x4d),
+14 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@
#define  PHY_CLK_HSTXP_EN		BIT(3)		/* clock hstxp enable */
#define  PHY_HSTXP_MODE			BIT(4)		/* 0: force en_txp to be 1; 1: no force */

#define PHY_K1_HS_HOST_DISC		0x40
#define  PHY_K1_HS_HOST_DISC_CLR		BIT(0)

#define PHY_PLL_DIV_CFG			0x98
#define  PHY_FDIV_FRACT_8_15		GENMASK(7, 0)
#define  PHY_FDIV_FRACT_16_19		GENMASK(11, 8)
@@ -142,9 +145,20 @@ static int spacemit_usb2phy_exit(struct phy *phy)
	return 0;
}

static int spacemit_usb2phy_disconnect(struct phy *phy, int port)
{
	struct spacemit_usb2phy *sphy = phy_get_drvdata(phy);

	regmap_update_bits(sphy->regmap_base, PHY_K1_HS_HOST_DISC,
			   PHY_K1_HS_HOST_DISC_CLR, PHY_K1_HS_HOST_DISC_CLR);

	return 0;
}

static const struct phy_ops spacemit_usb2phy_ops = {
	.init = spacemit_usb2phy_init,
	.exit = spacemit_usb2phy_exit,
	.disconnect = spacemit_usb2phy_disconnect,
	.owner = THIS_MODULE,
};

+2 −0
Original line number Diff line number Diff line
@@ -1425,6 +1425,7 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
			dev_err(dev,
				"%s: Reading \"reg\" from \"%s\" failed: %d\n",
				__func__, subnode->name, ret);
			of_node_put(serdes);
			return ret;
		}
		of_property_read_u32(subnode, "cdns,num-lanes", &num_lanes);
@@ -1439,6 +1440,7 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
		}
	}

	of_node_put(serdes);
	return 0;
}