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

 - mapphone-mdm6600 runtime pm & pinctrl handling fixes

 - Qualcomm qmp usb pcs register fixes, qmp pcie register size warning
   fix, m31 fixes for wrong pointer in PTR_ERR and dropping wrong vreg
   check, qmp combo fix for 8550 power config register

 - realtek usb fix for debugfs_create_dir() and kconfig dependency

* tag 'phy-fixes-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
  phy: realtek: Realtek PHYs should depend on ARCH_REALTEK
  phy: qualcomm: Fix typos in comments
  phy: qcom-qmp-combo: initialize PCS_USB registers
  phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1
  phy: qcom: m31: Remove unwanted qphy->vreg is NULL check
  phy: realtek: usb: Drop unnecessary error check for debugfs_create_dir()
  phy: qcom: phy-qcom-m31: change m31_ipq5332_regs to static
  phy: qcom: phy-qcom-m31: fix wrong pointer pass to PTR_ERR()
  dt-bindings: phy: qcom,ipq8074-qmp-pcie: fix warning regarding reg size
  phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p
  phy: qcom-qmp-usb: initialize PCS_USB registers
  phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins
  phy: mapphone-mdm6600: Fix runtime PM for remove
  phy: mapphone-mdm6600: Fix runtime disable on probe
parents 70e65afc 089667aa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ examples:

    phy@84000 {
        compatible = "qcom,ipq6018-qmp-pcie-phy";
        reg = <0x0 0x00084000 0x0 0x1000>;
        reg = <0x00084000 0x1000>;

        clocks = <&gcc GCC_PCIE0_AUX_CLK>,
                 <&gcc GCC_PCIE0_AHB_CLK>,
+18 −20
Original line number Diff line number Diff line
@@ -122,16 +122,10 @@ static int phy_mdm6600_power_on(struct phy *x)
{
	struct phy_mdm6600 *ddata = phy_get_drvdata(x);
	struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE];
	int error;

	if (!ddata->enabled)
		return -ENODEV;

	error = pinctrl_pm_select_default_state(ddata->dev);
	if (error)
		dev_warn(ddata->dev, "%s: error with default_state: %i\n",
			 __func__, error);

	gpiod_set_value_cansleep(enable_gpio, 1);

	/* Allow aggressive PM for USB, it's only needed for n_gsm port */
@@ -160,11 +154,6 @@ static int phy_mdm6600_power_off(struct phy *x)

	gpiod_set_value_cansleep(enable_gpio, 0);

	error = pinctrl_pm_select_sleep_state(ddata->dev);
	if (error)
		dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
			 __func__, error);

	return 0;
}

@@ -456,6 +445,7 @@ static void phy_mdm6600_device_power_off(struct phy_mdm6600 *ddata)
{
	struct gpio_desc *reset_gpio =
		ddata->ctrl_gpios[PHY_MDM6600_RESET];
	int error;

	ddata->enabled = false;
	phy_mdm6600_cmd(ddata, PHY_MDM6600_CMD_BP_SHUTDOWN_REQ);
@@ -471,6 +461,17 @@ static void phy_mdm6600_device_power_off(struct phy_mdm6600 *ddata)
	} else {
		dev_err(ddata->dev, "Timed out powering down\n");
	}

	/*
	 * Keep reset gpio high with padconf internal pull-up resistor to
	 * prevent modem from waking up during deeper SoC idle states. The
	 * gpio bank lines can have glitches if not in the always-on wkup
	 * domain.
	 */
	error = pinctrl_pm_select_sleep_state(ddata->dev);
	if (error)
		dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
			 __func__, error);
}

static void phy_mdm6600_deferred_power_on(struct work_struct *work)
@@ -571,12 +572,6 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
	ddata->dev = &pdev->dev;
	platform_set_drvdata(pdev, ddata);

	/* Active state selected in phy_mdm6600_power_on() */
	error = pinctrl_pm_select_sleep_state(ddata->dev);
	if (error)
		dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
			 __func__, error);

	error = phy_mdm6600_init_lines(ddata);
	if (error)
		return error;
@@ -627,10 +622,12 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
	pm_runtime_put_autosuspend(ddata->dev);

cleanup:
	if (error < 0)
	if (error < 0) {
		phy_mdm6600_device_power_off(ddata);
		pm_runtime_disable(ddata->dev);
		pm_runtime_dont_use_autosuspend(ddata->dev);
	}

	return error;
}

@@ -639,6 +636,7 @@ static void phy_mdm6600_remove(struct platform_device *pdev)
	struct phy_mdm6600 *ddata = platform_get_drvdata(pdev);
	struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET];

	pm_runtime_get_noresume(ddata->dev);
	pm_runtime_dont_use_autosuspend(ddata->dev);
	pm_runtime_put_sync(ddata->dev);
	pm_runtime_disable(ddata->dev);
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ static int qcom_apq8064_sata_phy_init(struct phy *generic_phy)
		return ret;
	}

	/* SATA phy calibrated succesfully, power up to functional mode */
	/* SATA phy calibrated successfully, power up to functional mode */
	writel_relaxed(0x3E, base + SATA_PHY_POW_DWN_CTRL1);
	writel_relaxed(0x01, base + SATA_PHY_RX_IMCAL0);
	writel_relaxed(0x01, base + SATA_PHY_TX_IMCAL0);
+3 −4
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ struct m31_priv_data {
	unsigned int			nregs;
};

struct m31_phy_regs m31_ipq5332_regs[] = {
static struct m31_phy_regs m31_ipq5332_regs[] = {
	{
		USB_PHY_CFG0,
		UTMI_PHY_OVERRIDE_EN,
@@ -172,7 +172,6 @@ static int m31usb_phy_init(struct phy *phy)

	ret = clk_prepare_enable(qphy->clk);
	if (ret) {
		if (qphy->vreg)
		regulator_disable(qphy->vreg);
		dev_err(&phy->dev, "failed to enable cfg ahb clock, %d\n", ret);
		return ret;
@@ -256,7 +255,7 @@ static int m31usb_phy_probe(struct platform_device *pdev)

	qphy->vreg = devm_regulator_get(dev, "vdda-phy");
	if (IS_ERR(qphy->vreg))
		return dev_err_probe(dev, PTR_ERR(qphy->phy),
		return dev_err_probe(dev, PTR_ERR(qphy->vreg),
						"failed to get vreg\n");

	phy_set_drvdata(qphy->phy, qphy);
+5 −1
Original line number Diff line number Diff line
@@ -859,10 +859,10 @@ static const struct qmp_phy_init_tbl sm8550_usb3_pcs_tbl[] = {
	QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_PCS_TX_RX_CONFIG, 0x0c),
	QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG1, 0x4b),
	QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG5, 0x10),
	QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
};

static const struct qmp_phy_init_tbl sm8550_usb3_pcs_usb_tbl[] = {
	QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
	QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
	QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
	QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L, 0x40),
@@ -2555,6 +2555,7 @@ static int qmp_combo_usb_power_on(struct phy *phy)
	void __iomem *tx2 = qmp->tx2;
	void __iomem *rx2 = qmp->rx2;
	void __iomem *pcs = qmp->pcs;
	void __iomem *pcs_usb = qmp->pcs_usb;
	void __iomem *status;
	unsigned int val;
	int ret;
@@ -2576,6 +2577,9 @@ static int qmp_combo_usb_power_on(struct phy *phy)

	qmp_combo_configure(pcs, cfg->pcs_tbl, cfg->pcs_tbl_num);

	if (pcs_usb)
		qmp_combo_configure(pcs_usb, cfg->pcs_usb_tbl, cfg->pcs_usb_tbl_num);

	if (cfg->has_pwrdn_delay)
		usleep_range(10, 20);

Loading