From nobody Thu Apr 2 23:31:27 2026 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1B553DBD50 for ; Wed, 4 Mar 2026 19:09:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772651349; cv=none; b=R/u9FDRvk9vMWPmcL7rxrfW52/uwNzcLUTnM4hndLo1SMCyvG9fuKn22lkEeei55sWgSC6j5R0ZVPJ4MrFL2UYCBtuuJSpcwBazWu9cJhe3BkqmYtMFCwYLPd8y3Un/q0hqBsmwYCZECObivO3LsuYl2i6drQy0MdfBgl+Y5erY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772651349; c=relaxed/simple; bh=9fourSTkhAQgs826lDee9RWvteRmPy4uNjN8cDjQdI4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=N84sf0dd04ROXWxo1CnlndZdt4WQQKtKY6BzRY/tVO/jvC8LtbxCnbCWQHcVuhqOfp8IFK0mbgJ4ucZA/1vIQAGIdzTaOUYI7RDclk7WjsCdDEkv4f0IbeonQJim11adk8nkaX4aSrPQUMNjuLqmtQiR4FCuw57A6TvtmJbBUtQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=packett.cool; spf=pass smtp.mailfrom=packett.cool; dkim=pass (2048-bit key) header.d=packett.cool header.i=@packett.cool header.b=FWLB7JfV; arc=none smtp.client-ip=95.215.58.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=packett.cool Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=packett.cool Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=packett.cool header.i=@packett.cool header.b="FWLB7JfV" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=packett.cool; s=key1; t=1772651334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=QWi/D71MzwCQILqzVZa58xbV1qWKBRrD+N8wo4wzvp4=; b=FWLB7JfVVzHFldVFEYMTdyggmlDcnB2bZ5K+JuBkBD5aj2xqENWGIs9tBVi3P0f8NiVHMn dku0FStjqqwBaR3BLCj0Y9gkLp60T9oNkrdeOAE982JEVDLZNCelZ0rkyPVAeEqIMKdLqe DMMTxbSVwjf3NoYv1HYcPPI5FAa0yMMNewvfaMx3zkL+NAYfQ+G2L+dwCBb6dJwkATRCmJ jdhZjP4LxElu6o0mvIpkLV04f2JEgFveTTByBSDH4IK2gj7rp5iHU+gQyLcnMYHEX/g+9O VFQ01zQf7e74QGNm1Yxow3/DR1/z2w9SZyldsoe1VoVSoTYC6WsMWwD7rxDs6w== From: Val Packett To: Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Bjorn Andersson , Wesley Cheng , Neil Armstrong Cc: Val Packett , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] phy: qcom: qmp-combo: Move pipe_clk on/off to common Date: Wed, 4 Mar 2026 16:06:23 -0300 Message-ID: <20260304190827.176988-1-val@packett.cool> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Keep the USB pipe clock working when the phy is in DP-only mode, because the dwc controller still needs it for USB 2.0 over the same Type-C port. Tested with the BenQ RD280UA monitor which has a downstream-facing port for data passthrough that's manually switchable between USB 2 and 3, corresponding to 4-lane and 2-lane DP respectively. Note: the suspend/resume callbacks were already gating the enable/disable of this clock only on init_count and not usb_init_count! Reviewed-by: Neil Armstrong Reviewed-by: Konrad Dybcio Signed-off-by: Val Packett --- v3: Pull suggestion/fix and R-b v2: https://lore.kernel.org/all/20260228220634.22778-2-val@packett.cool/ --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualco= mm/phy-qcom-qmp-combo.c index 93f1aa10d400..cdcfad2e86b1 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -3691,6 +3691,13 @@ static int qmp_combo_com_init(struct qmp_combo *qmp,= bool force) if (ret) goto err_assert_reset; =20 + /* In DP-only mode, the pipe clk is still required for USB2 */ + ret =3D clk_prepare_enable(qmp->pipe_clk); + if (ret) { + dev_err(qmp->dev, "pipe_clk enable failed err=3D%d\n", ret); + goto err_disable_clocks; + } + qphy_setbits(com, QPHY_V3_DP_COM_POWER_DOWN_CTRL, SW_PWRDN); =20 /* override hardware control for reset of qmp phy */ @@ -3749,6 +3756,8 @@ static int qmp_combo_com_init(struct qmp_combo *qmp, = bool force) =20 return 0; =20 +err_disable_clocks: + clk_bulk_disable_unprepare(qmp->num_clks, qmp->clks); err_assert_reset: reset_control_bulk_assert(cfg->num_resets, qmp->resets); err_disable_regulators: @@ -3768,6 +3777,7 @@ static int qmp_combo_com_exit(struct qmp_combo *qmp, = bool force) =20 reset_control_bulk_assert(cfg->num_resets, qmp->resets); =20 + clk_disable_unprepare(qmp->pipe_clk); clk_bulk_disable_unprepare(qmp->num_clks, qmp->clks); =20 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); @@ -3871,12 +3881,6 @@ static int qmp_combo_usb_power_on(struct phy *phy) =20 qmp_configure(qmp->dev, serdes, cfg->serdes_tbl, cfg->serdes_tbl_num); =20 - ret =3D clk_prepare_enable(qmp->pipe_clk); - if (ret) { - dev_err(qmp->dev, "pipe_clk enable failed err=3D%d\n", ret); - return ret; - } - /* Tx, Rx, and PCS configurations */ qmp_configure_lane(qmp->dev, tx, cfg->tx_tbl, cfg->tx_tbl_num, 1); qmp_configure_lane(qmp->dev, tx2, cfg->tx_tbl, cfg->tx_tbl_num, 2); @@ -3922,8 +3926,6 @@ static int qmp_combo_usb_power_off(struct phy *phy) struct qmp_combo *qmp =3D phy_get_drvdata(phy); const struct qmp_phy_cfg *cfg =3D qmp->cfg; =20 - clk_disable_unprepare(qmp->pipe_clk); - /* PHY reset */ qphy_setbits(qmp->pcs, cfg->regs[QPHY_SW_RESET], SW_RESET); =20 --=20 2.52.0