From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF947C32771 for ; Wed, 28 Sep 2022 15:29:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233791AbiI1P3M (ORCPT ); Wed, 28 Sep 2022 11:29:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234462AbiI1P2k (ORCPT ); Wed, 28 Sep 2022 11:28:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47DE55BC1D; Wed, 28 Sep 2022 08:28:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3536D61F1A; Wed, 28 Sep 2022 15:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B353C4315A; Wed, 28 Sep 2022 15:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=tvS36P2S9XHmxznZagbYvWndHnEKIMxvU+qgSB0teSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZJYNX/D6kZel16K/BsajAHpRRW52r2u+k1XxXAZzWnAIeGX8gbQrLNnQUhUUzzihB jHjxxd1mx+s3kRdWdOMrIWR7OQCCiiUqgLhoHKoK9G/cCxfmLtaLRTNi1Qu7BQH3wo HESlDettD3Flt8ChZK6t6WDO5IdoJQ1AG1Pt1zYchhbAcdQOETLxdlQcpwMn2Qzfnn OckQwHrd+P1zkRb3dz+1BN2TMTOaNI9aDAXOfPIE+TTYA4t+kvCf/s0N1uwKNUhUwA OM3VtUG37TxW5cBQUdeD6Ar0BL+t0gx3nekpfpybISK7ozm1jPTW5L9EgGs/7AYzfS M98h45Pt88KEw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzK-0007za-7x; Wed, 28 Sep 2022 17:28:42 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 01/13] phy: qcom-qmp: fix obsolete lane comments Date: Wed, 28 Sep 2022 17:28:10 +0200 Message-Id: <20220928152822.30687-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" All QMP drivers but the MSM8996 and combo ones handle exactly one PHY and the corresponding memory resources are not per-lane, but per PHY. Update the obsolete comments. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 2 +- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 2 +- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 +- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 2 +- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualco= mm/phy-qcom-qmp-combo.c index ad3b0aa22048..0cf1eb8a62f6 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -2669,7 +2669,7 @@ static int qmp_combo_create(struct device *dev, struc= t device_node *np, int id, qphy->cfg =3D cfg; qphy->serdes =3D serdes; /* - * Get memory resources for each phy lane: + * Get memory resources for each PHY: * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2. * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5 * For single lane PHYs: pcs_misc (optional) -> 3. diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy= /qualcomm/phy-qcom-qmp-pcie-msm8996.c index 0f8e739936ab..d9646bf5dc91 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c @@ -777,7 +777,7 @@ static int qmp_pcie_msm8996_create(struct device *dev, = struct device_node *np, i qphy->cfg =3D cfg; qphy->serdes =3D serdes; /* - * Get memory resources for each phy lane: + * Get memory resources for each PHY: * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2. */ qphy->tx =3D devm_of_iomap(dev, np, 0, NULL); diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcom= m/phy-qcom-qmp-pcie.c index dde398105f03..abf1cf1abf2c 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -2201,7 +2201,7 @@ static int qmp_pcie_create(struct device *dev, struct= device_node *np, int id, qphy->cfg =3D cfg; qphy->serdes =3D serdes; /* - * Get memory resources for each phy lane: + * Get memory resources for the PHY: * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2. * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5 * For single lane PHYs: pcs_misc (optional) -> 3. diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm= /phy-qcom-qmp-ufs.c index d21b977850b3..d7b35b715b95 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -1094,7 +1094,7 @@ static int qmp_ufs_create(struct device *dev, struct = device_node *np, int id, qphy->cfg =3D cfg; qphy->serdes =3D serdes; /* - * Get memory resources for each phy lane: + * Get memory resources for the PHY: * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2. * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5 * For single lane PHYs: pcs_misc (optional) -> 3. diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm= /phy-qcom-qmp-usb.c index f01b3022a10d..f8685eddbf80 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c @@ -2581,7 +2581,7 @@ int qmp_usb_create(struct device *dev, struct device_= node *np, int id, qphy->cfg =3D cfg; qphy->serdes =3D serdes; /* - * Get memory resources for each phy lane: + * Get memory resources for the PHY: * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2. * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5 * For single lane PHYs: pcs_misc (optional) -> 3. --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14669C32771 for ; Wed, 28 Sep 2022 15:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234735AbiI1P3n (ORCPT ); Wed, 28 Sep 2022 11:29:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234549AbiI1P2k (ORCPT ); Wed, 28 Sep 2022 11:28:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79F53C841B; Wed, 28 Sep 2022 08:28:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4890AB820FF; Wed, 28 Sep 2022 15:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD2F4C433C1; Wed, 28 Sep 2022 15:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378915; bh=FlE6h8pwjkf3YxOCM1WVtPdufU15JqT05C2XkkErZrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a34T922Wc/RVGXyKqiFxKH3p+H0UaEm7/wRVRVtjypNX4idxq0UutaCyDYyqe0Ix/ ZcUqx0OBqp948dY51RsywN8CQBVK5jG3DjrTZ+ic61x04vNWx7Ey3AA6gPpg2B9o5c DTk5Hsaz8jZ73d4tEDlu2+M5yGkqFYhWokIbmjuG/aF23knVMPOldyN1cubr9uL/IV eEcgUMZu4qAiMoFvbmNLQTpRhgHoq72mMFFu51HhdiGXKZqg6hcwyMCnM1N6VG1XoG d2+1vttCdu78Cd5A9Hyva7h8vg/u7Damsqz/ZCzdmtJdSUlDbLs3U+vozQTeGGJYsA 3rsluqKFVKqbQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzK-0007zc-BC; Wed, 28 Sep 2022 17:28:42 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 02/13] phy: qcom-qmp-combo: drop unused UFS reset Date: Wed, 28 Sep 2022 17:28:11 +0200 Message-Id: <20220928152822.30687-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Drop the unused UFS reset code which isn't used since the QMP driver split. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualco= mm/phy-qcom-qmp-combo.c index 0cf1eb8a62f6..e618e675e8ec 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -944,7 +944,6 @@ struct qmp_phy_dp_clks { * @phys: array of per-lane phy descriptors * @phy_mutex: mutex lock for PHY common block initialization * @init_count: phy common block initialization count - * @ufs_reset: optional UFS PHY reset handle */ struct qcom_qmp { struct device *dev; @@ -958,8 +957,6 @@ struct qcom_qmp { =20 struct mutex phy_mutex; int init_count; - - struct reset_control *ufs_reset; }; =20 static void qcom_qmp_v3_phy_dp_aux_init(struct qmp_phy *qphy); @@ -2027,8 +2024,6 @@ static int qmp_combo_com_exit(struct qmp_phy *qphy) return 0; } =20 - reset_control_assert(qmp->ufs_reset); - reset_control_bulk_assert(cfg->num_resets, qmp->resets); =20 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); @@ -2103,10 +2098,6 @@ static int qmp_combo_power_on(struct phy *phy) else qmp_combo_configure(pcs, cfg->regs, cfg->pcs_tbl, cfg->pcs_tbl_num); =20 - ret =3D reset_control_deassert(qmp->ufs_reset); - if (ret) - goto err_disable_pipe_clk; - if (cfg->has_pwrdn_delay) usleep_range(cfg->pwrdn_delay_min, cfg->pwrdn_delay_max); =20 --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74401C32771 for ; Wed, 28 Sep 2022 15:30:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234359AbiI1P37 (ORCPT ); Wed, 28 Sep 2022 11:29:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234650AbiI1P2n (ORCPT ); Wed, 28 Sep 2022 11:28:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7847F63F3B; Wed, 28 Sep 2022 08:28:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C72A5B820F7; Wed, 28 Sep 2022 15:28:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E50F2C433D7; Wed, 28 Sep 2022 15:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=2PNuiWS0wXqb3wfqtzEjmTZQ+QrEITCNR73xkCcLG0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V/hCKZjEil8MaDvKDtN/VSEHN027MWIFB7ldiymERCUtjtcBA96YDsfXUFHk7FEww NVRncGXCgZdxIXnZmUz1mS+gXaHQ9rMiuTc4w6zGj9/pWIpK9qhF4mMas5AQrz5e7e vje0tslum1iqkzghh66OP50K/1X69UL6Qr9AlXDQKCzkAt08hNbLpBq97y6vs3neVv iwfaR8y8TrACuqLgQK17wVy+3O3/dy0rqzyiPWtMMjbwAFdLuxaoVEpf3WirnJaNF4 DJelP6bN0jikvj183RpSoIjAeporai7eleYI9iB58Gj/tBtijTQetLR01Vit3ng40y j4/Bbi+et+B+g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzK-0007ze-EQ; Wed, 28 Sep 2022 17:28:42 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 03/13] phy: qcom-qmp-pcie: drop unused common-block registers Date: Wed, 28 Sep 2022 17:28:12 +0200 Message-Id: <20220928152822.30687-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Drop the common-block register defines that are unused since the QMP driver split. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcom= m/phy-qcom-qmp-pcie.c index abf1cf1abf2c..ec453f908f1d 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -77,11 +77,6 @@ struct qmp_phy_init_tbl { =20 /* set of registers with offsets different per-PHY */ enum qphy_reg_layout { - /* Common block control registers */ - QPHY_COM_SW_RESET, - QPHY_COM_POWER_DOWN_CONTROL, - QPHY_COM_START_CONTROL, - QPHY_COM_PCS_READY_STATUS, /* PCS registers */ QPHY_SW_RESET, QPHY_START_CTRL, @@ -99,10 +94,6 @@ static const unsigned int ipq_pciephy_gen3_regs_layout[Q= PHY_LAYOUT_SIZE] =3D { }; =20 static const unsigned int pciephy_regs_layout[QPHY_LAYOUT_SIZE] =3D { - [QPHY_COM_SW_RESET] =3D 0x400, - [QPHY_COM_POWER_DOWN_CONTROL] =3D 0x404, - [QPHY_COM_START_CONTROL] =3D 0x408, - [QPHY_COM_PCS_READY_STATUS] =3D 0x448, [QPHY_SW_RESET] =3D 0x00, [QPHY_START_CTRL] =3D 0x08, [QPHY_PCS_STATUS] =3D 0x174, --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 370F7C04A95 for ; Wed, 28 Sep 2022 15:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234440AbiI1P3Q (ORCPT ); Wed, 28 Sep 2022 11:29:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234465AbiI1P2k (ORCPT ); Wed, 28 Sep 2022 11:28:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D60FC5BC3D; Wed, 28 Sep 2022 08:28:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2C38961F11; Wed, 28 Sep 2022 15:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CA70C4314E; Wed, 28 Sep 2022 15:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=VdNtcbkIBrH0/XFAgmUdLGbjMPGlcd+m+wkbNoNVMFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dZzCP+vhXxPVwZlCcSMHJhjhHDkUCmKWk4naxdATyLqm/0RcoQSbdcBn1JuWnjDKY 2duwCvwszRxzvRPTMDi+WspTqhKiOGqYuLbxp9HrjkNwR46/2ZODKA+09S8Ubw+jim kyE5xZxmPMBBRb9RWnssf7WHN/QwO2qUSgWzL1KI/ToUV3U32IEjToVbmevH02LBU1 +IBGPC567wLdqfUczTBYv429ZmVJQKQepQegmzKhtLkwjUS5FSZaAxNFDRqFAOJvHW a0SEjVRSKmFojxldsFs8AidJJDMImGlMHfhrD/AjsMEDeRnrspE00PxfAISSr/Ge3o /2b46Qb2esGXQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzK-0007zg-Hg; Wed, 28 Sep 2022 17:28:42 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 04/13] phy: qcom-qmp-pcie: unify ipq registers Date: Wed, 28 Sep 2022 17:28:13 +0200 Message-Id: <20220928152822.30687-5-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The IPQ register array is identical to sm8250_pcie_regs_layout so drop the former. Signed-off-by: Johan Hovold Reviewed-by: Neil Armstrong --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcom= m/phy-qcom-qmp-pcie.c index ec453f908f1d..7b3f7e42edd5 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -86,13 +86,6 @@ enum qphy_reg_layout { QPHY_LAYOUT_SIZE }; =20 -static const unsigned int ipq_pciephy_gen3_regs_layout[QPHY_LAYOUT_SIZE] = =3D { - [QPHY_SW_RESET] =3D 0x00, - [QPHY_START_CTRL] =3D 0x44, - [QPHY_PCS_STATUS] =3D 0x14, - [QPHY_PCS_POWER_DOWN_CONTROL] =3D 0x40, -}; - static const unsigned int pciephy_regs_layout[QPHY_LAYOUT_SIZE] =3D { [QPHY_SW_RESET] =3D 0x00, [QPHY_START_CTRL] =3D 0x08, @@ -1492,7 +1485,7 @@ static const struct qmp_phy_cfg ipq8074_pciephy_gen3_= cfg =3D { .num_resets =3D ARRAY_SIZE(ipq8074_pciephy_reset_l), .vreg_list =3D NULL, .num_vregs =3D 0, - .regs =3D ipq_pciephy_gen3_regs_layout, + .regs =3D sm8250_pcie_regs_layout, =20 .start_ctrl =3D SERDES_START | PCS_START, .pwrdn_ctrl =3D SW_PWRDN | REFCLK_DRV_DSBL, @@ -1523,7 +1516,7 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = =3D { .num_resets =3D ARRAY_SIZE(ipq8074_pciephy_reset_l), .vreg_list =3D NULL, .num_vregs =3D 0, - .regs =3D ipq_pciephy_gen3_regs_layout, + .regs =3D sm8250_pcie_regs_layout, =20 .start_ctrl =3D SERDES_START | PCS_START, .pwrdn_ctrl =3D SW_PWRDN | REFCLK_DRV_DSBL, --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7EB8C04A95 for ; Wed, 28 Sep 2022 15:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234209AbiI1P32 (ORCPT ); Wed, 28 Sep 2022 11:29:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234528AbiI1P2k (ORCPT ); Wed, 28 Sep 2022 11:28:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 139F4B1C3; Wed, 28 Sep 2022 08:28:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5128161F06; Wed, 28 Sep 2022 15:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29694C4315B; Wed, 28 Sep 2022 15:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=0CIZwjTp4S6UVd9PWMy28ZB7xuGJAfjb72jJqca0pFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X4fZN1/9bFNFMxRJ+oCj9IOpEckyAUYMaunTAyqqMPd4Af4BMmL5AF8FqsqSe6Z0s cvICDVqeAOxlQumtP6mUDnfCcjgAM0im4Ogx/HSOynfUMbOC5kk+PrO+jnkyiJmwqQ nNbFaBthpNmTeoUuEOUeLyX6Em6McjmLt2jVMF50dafC/1OMHq0z2G9ntOWKL9wWoE VQVyBmDOogdONfmrwJDdY6TjEs/BUiRCzWKpMGPgzIMfYch9+hKlf94HNhl23asJqC kzP5EPzWdVz4/RtKqxPlqj+MCw12IuqdHcRdFeDh4zxgkGAoAia4MABjLsdiuLczBM irQhR1XCfoSXQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzK-0007zj-Ku; Wed, 28 Sep 2022 17:28:42 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 05/13] phy: qcom-qmp-pcie: unify sdm845 registers Date: Wed, 28 Sep 2022 17:28:14 +0200 Message-Id: <20220928152822.30687-6-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The SDM845 register array is identical to pciephy_regs_layout so drop the former. Signed-off-by: Johan Hovold Reviewed-by: Neil Armstrong --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcom= m/phy-qcom-qmp-pcie.c index 7b3f7e42edd5..4146545fdf5f 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -92,12 +92,6 @@ static const unsigned int pciephy_regs_layout[QPHY_LAYOU= T_SIZE] =3D { [QPHY_PCS_STATUS] =3D 0x174, }; =20 -static const unsigned int sdm845_qmp_pciephy_regs_layout[QPHY_LAYOUT_SIZE]= =3D { - [QPHY_SW_RESET] =3D 0x00, - [QPHY_START_CTRL] =3D 0x08, - [QPHY_PCS_STATUS] =3D 0x174, -}; - static const unsigned int sdm845_qhp_pciephy_regs_layout[QPHY_LAYOUT_SIZE]= =3D { [QPHY_SW_RESET] =3D 0x00, [QPHY_START_CTRL] =3D 0x08, @@ -1545,7 +1539,7 @@ static const struct qmp_phy_cfg sdm845_qmp_pciephy_cf= g =3D { .num_resets =3D ARRAY_SIZE(sdm845_pciephy_reset_l), .vreg_list =3D qmp_phy_vreg_l, .num_vregs =3D ARRAY_SIZE(qmp_phy_vreg_l), - .regs =3D sdm845_qmp_pciephy_regs_layout, + .regs =3D pciephy_regs_layout, =20 .start_ctrl =3D PCS_START | SERDES_START, .pwrdn_ctrl =3D SW_PWRDN | REFCLK_DRV_DSBL, --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8555C6FA8E for ; Wed, 28 Sep 2022 15:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232196AbiI1P3D (ORCPT ); Wed, 28 Sep 2022 11:29:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234334AbiI1P2i (ORCPT ); Wed, 28 Sep 2022 11:28:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06031367BB; Wed, 28 Sep 2022 08:28:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8BB5061F09; Wed, 28 Sep 2022 15:28:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEC9CC43470; Wed, 28 Sep 2022 15:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=UTlC61z7rj8etdEZLgSbUnXER0qpRtxBcRao+1tRt3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RT8d9c/Iva5E6cPgbHG8sKc7/neaWORUWab1UpvWBASKQfvCXgAVCxQwe+3TN8wfQ mz4J1/kfBIwQgsXwjc63b1kbtUb7VSAjA2GJt5XBpqgHqhTVFX/51rhJAZvd+gTitY MDNKUv/SI34sk0VYm1uFzeeff3qKiTSlsRe2q/n6GCJWm3K8SS2NLWxnJojvp4xhBE 0edyYL8iAch9M4RCFO55tZZyEWIgzXmClbgZKGYiwGPNTXoXuEpmUPXzl915S+j2YX mLOp+FG+2iEQkDcTi7H5ghTa18OI0vEAdVGWcoVH+r1qLczSKufuBQkB/uVRzaMCTM MzOeZhg2n8JCQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzK-0007zo-O8; Wed, 28 Sep 2022 17:28:42 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 06/13] phy: qcom-qmp-pcie: drop bogus register update Date: Wed, 28 Sep 2022 17:28:15 +0200 Message-Id: <20220928152822.30687-7-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since commit 0d58280cf1e6 ("phy: Update PHY power control sequence") the PHY is powered on before configuring the registers and only the MSM8996 PCIe PHY, which includes the POWER_DOWN_CONTROL register in its PCS initialisation table, may possibly require a second update afterwards. To make things worse, the POWER_DOWN_CONTROL register lies at a different offset on more recent SoCs so that the second update, which still used a hard-coded offset, would write to an unrelated register (e.g. a revision-id register on SC8280XP). As the MSM8996 PCIe PHY is now handled by a separate driver, simply drop the bogus register update. Fixes: e4d8b05ad5f9 ("phy: qcom-qmp: Use proper PWRDOWN offset for sm8150 U= SB") added support Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcom= m/phy-qcom-qmp-pcie.c index 4146545fdf5f..eea66c24cf7e 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -1953,12 +1953,6 @@ static int qmp_pcie_power_on(struct phy *phy) qmp_pcie_configure(pcs_misc, cfg->regs, cfg->pcs_misc_tbl, cfg->pcs_misc_= tbl_num); qmp_pcie_configure(pcs_misc, cfg->regs, cfg->pcs_misc_tbl_sec, cfg->pcs_m= isc_tbl_num_sec); =20 - /* - * Pull out PHY from POWER DOWN state. - * This is active low enable signal to power-down PHY. - */ - qphy_setbits(pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, cfg->pwrdn_ctrl); - if (cfg->has_pwrdn_delay) usleep_range(cfg->pwrdn_delay_min, cfg->pwrdn_delay_max); =20 --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67636C04A95 for ; Wed, 28 Sep 2022 15:29:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234242AbiI1P3I (ORCPT ); Wed, 28 Sep 2022 11:29:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234440AbiI1P2k (ORCPT ); Wed, 28 Sep 2022 11:28:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6269606BA; Wed, 28 Sep 2022 08:28:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 22E9B61F0C; Wed, 28 Sep 2022 15:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04E2CC43147; Wed, 28 Sep 2022 15:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=5I4DtEaOnP9RLKggdi6cYXbRFkIvn8agB7/xzNQlNKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nbaX8t8QpdHdZC4HUM3EA2Ykb68F3ti3weWpv3QWZqM2kGoBg9K4RsNP3aAbV9WbU 8alkKWiDosyK/gRCJd+E12e2ArA5bkZM1li6ukxy6jv+3H4Xu13Hoah7BgguhTOgFc X9ptOwuEQDej0aChB0T8ayhdZRcjFp1m/K/He+fd8FFt8auxkPcfrg8eXcq8LjFa9L Qb3NUjuBaO6zBTogvUhTGnf8yLjHTIwhCR1IeHh6FbNO4Q/6D2qO+ftqwKfrJpJcg4 0FcO/hXUQ6BwkGAVf1LJhGsWIMHabHpV0FmoD8cJdkpAXKdqosYBReRQ9Zq1fDhkwg VN0iuHA3eMO8A== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzK-0007zr-R2; Wed, 28 Sep 2022 17:28:42 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 07/13] phy: qcom-qmp-pcie: clean up power-down handling Date: Wed, 28 Sep 2022 17:28:16 +0200 Message-Id: <20220928152822.30687-8-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Always define the POWER_DOWN_CONTROL register instead of falling back to the v2 offset during power on and power off. Signed-off-by: Johan Hovold --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcom= m/phy-qcom-qmp-pcie.c index eea66c24cf7e..47cdb9ed80cd 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -90,12 +90,14 @@ static const unsigned int pciephy_regs_layout[QPHY_LAYO= UT_SIZE] =3D { [QPHY_SW_RESET] =3D 0x00, [QPHY_START_CTRL] =3D 0x08, [QPHY_PCS_STATUS] =3D 0x174, + [QPHY_PCS_POWER_DOWN_CONTROL] =3D 0x04, }; =20 static const unsigned int sdm845_qhp_pciephy_regs_layout[QPHY_LAYOUT_SIZE]= =3D { [QPHY_SW_RESET] =3D 0x00, [QPHY_START_CTRL] =3D 0x08, [QPHY_PCS_STATUS] =3D 0x2ac, + [QPHY_PCS_POWER_DOWN_CONTROL] =3D 0x04, }; =20 static const unsigned int sm8250_pcie_regs_layout[QPHY_LAYOUT_SIZE] =3D { @@ -1872,13 +1874,8 @@ static int qmp_pcie_init(struct phy *phy) if (ret) goto err_assert_reset; =20 - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) - qphy_setbits(pcs, - cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - else - qphy_setbits(pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, - cfg->pwrdn_ctrl); + qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); =20 return 0; =20 @@ -1995,13 +1992,8 @@ static int qmp_pcie_power_off(struct phy *phy) qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl); =20 /* Put PHY into POWER DOWN state: active low */ - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) { - qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - } else { - qphy_clrbits(qphy->pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, - cfg->pwrdn_ctrl); - } + qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); =20 return 0; } --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 219B4C04A95 for ; Wed, 28 Sep 2022 15:29:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233953AbiI1P27 (ORCPT ); Wed, 28 Sep 2022 11:28:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234350AbiI1P2i (ORCPT ); Wed, 28 Sep 2022 11:28:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B104647C4; Wed, 28 Sep 2022 08:28:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9865761F03; Wed, 28 Sep 2022 15:28:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E77D0C43140; Wed, 28 Sep 2022 15:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=eQzKq/JPEfw2X1Sdx9ak4sUQJdquDr6vcVCbsZTFJ9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rtJTvgev4jgCkemzBTZrtmCD3kjIODHSGH35FGUHHntNizfguReY0BVRqY40Co/TL Zcr0Z+nqL/xHvcAZRaqAImJOMiQ4pqZo7e6rwd0A07iX9SqU5adI/s9/mehbsflYr2 dawC7NVcZhVd25n+joVRS3le9q6aZbv0DHyLwZLSXXWSNVzesLnbHYgyw4h+Ry8MJq ZWCSI0EQ6/RJO6njrm1SuVkU1nXAT2Og4ySSjKtrtgodQPNgghIUFbSIsaDDq84It8 GP8F/gmYaJRwgiaGUTaRMja+Fz6L7fkID7xiFkCNIVObiqywDiC/XZEetz8IkZZCos Qm2r83DWypu/Q== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzK-0007zt-Ty; Wed, 28 Sep 2022 17:28:42 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 08/13] phy: qcom-qmp-pcie: move power-down update Date: Wed, 28 Sep 2022 17:28:17 +0200 Message-Id: <20220928152822.30687-9-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Move the power-down-control register update that powers on the PHY to the power-on handler so that it matches the power-off handler. Note that the power-on handler is currently always called directly after init. Signed-off-by: Johan Hovold --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcom= m/phy-qcom-qmp-pcie.c index 47cdb9ed80cd..150dc58147ce 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -1848,7 +1848,6 @@ static int qmp_pcie_init(struct phy *phy) struct qmp_phy *qphy =3D phy_get_drvdata(phy); struct qcom_qmp *qmp =3D qphy->qmp; const struct qmp_phy_cfg *cfg =3D qphy->cfg; - void __iomem *pcs =3D qphy->pcs; int ret; =20 /* turn on regulator supplies */ @@ -1874,9 +1873,6 @@ static int qmp_pcie_init(struct phy *phy) if (ret) goto err_assert_reset; =20 - qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - return 0; =20 err_assert_reset: @@ -1915,6 +1911,9 @@ static int qmp_pcie_power_on(struct phy *phy) unsigned int mask, val, ready; int ret; =20 + qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); + qmp_pcie_serdes_init(qphy); =20 ret =3D clk_prepare_enable(qphy->pipe_clk); --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80675C32771 for ; Wed, 28 Sep 2022 15:29:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234656AbiI1P3Y (ORCPT ); Wed, 28 Sep 2022 11:29:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234490AbiI1P2k (ORCPT ); Wed, 28 Sep 2022 11:28:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C745384E56; Wed, 28 Sep 2022 08:28:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3F0F461F0B; Wed, 28 Sep 2022 15:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25E53C4315C; Wed, 28 Sep 2022 15:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=RCDMsqIFvGXQJyg4OyLTudRn8PZLhfXKmmKAniUA9x0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J4P5Q9AxxbRgFWTHsC51H4zeQnt8102iWEUKGCWrHvC54L/2xJ59Hu0PhYuHU/XiA zrJieGFLvQtYEPRFY51cL+Sqdo5Zp/ojFRLKOS+MHfDjji5jDayioaHH9bswXgFVqv M7ItAXLWr8Nmh1fDEvKoG4Eb1GGHFXPu7OOkmsiVYljD6CxXdO7kKMR2iZScjGQOLN aAfEXeJW1zeknWOyg7gCMx3jYGnRdBoj/LEqjysD1yYpJp3oLjOy83inJ9SuOkqkS8 k4KCnVckEexM21gjsEhet9AkcQQy+TgErGeq/wEKWlLCO4OtGBwVSoyAvfDNFtexyS kUCRJ2mGuOt/w== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzL-0007zw-0C; Wed, 28 Sep 2022 17:28:43 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 09/13] phy: qcom-qmp-pcie-msm8996: clean up power-down handling Date: Wed, 28 Sep 2022 17:28:18 +0200 Message-Id: <20220928152822.30687-10-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This driver uses v2 registers only so drop the unnecessary POWER_DOWN_CONTROL override. Note that this register is already hard-coded when powering on the PHY. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy= /qualcomm/phy-qcom-qmp-pcie-msm8996.c index d9646bf5dc91..1960bd0513e9 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c @@ -91,7 +91,6 @@ enum qphy_reg_layout { QPHY_SW_RESET, QPHY_START_CTRL, QPHY_PCS_STATUS, - QPHY_PCS_POWER_DOWN_CONTROL, /* Keep last to ensure regs_layout arrays are properly initialized */ QPHY_LAYOUT_SIZE }; @@ -591,13 +590,8 @@ static int qmp_pcie_msm8996_power_off(struct phy *phy) qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl); =20 /* Put PHY into POWER DOWN state: active low */ - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) { - qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - } else { - qphy_clrbits(qphy->pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, - cfg->pwrdn_ctrl); - } + qphy_clrbits(qphy->pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, + cfg->pwrdn_ctrl); =20 return 0; } --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ED7AC04A95 for ; Wed, 28 Sep 2022 15:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234033AbiI1P3U (ORCPT ); Wed, 28 Sep 2022 11:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234489AbiI1P2k (ORCPT ); Wed, 28 Sep 2022 11:28:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCDD991D04; Wed, 28 Sep 2022 08:28:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B404A61F0A; Wed, 28 Sep 2022 15:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59BE9C4314A; Wed, 28 Sep 2022 15:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=09qcvulq5aMIFeYdnXKNSqkjHdo7ac6qqMsCzIMhtcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oCeJ7zCPGWyJtmEIYdZYWBgxGEGzsQt+3+5XvmuLVWqfMAiq2WcmX+xp2/Feuucr8 U6CxW6rhjxv8/XH5tynpXrpJKp1QrI9mJeiHHIs5XOfaR3bA17vRXVLpAglToSTuZ8 CNBkHcV8F6sLkUI1P5FWho36ygN8BGpBGyfu43xUbl3FJKaqP8RHEehZKd+7/osPgx KRF9eO6MZxPtOB55hobJOnG1cZ9mG+Wy3xnbkSMKJ2rIlDRGRnhjTVGsh93TInfyEe R/71XDeAzxW5u6a2cSSSKq5QP03KdX6YjSLzCrLb1jJGcbK8fOEpHRamEiwo2W9afS drITXWuzA3Vvw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzL-0007zz-3S; Wed, 28 Sep 2022 17:28:43 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 10/13] phy: qcom-qmp-combo: clean up power-down handling Date: Wed, 28 Sep 2022 17:28:19 +0200 Message-Id: <20220928152822.30687-11-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Always define the POWER_DOWN_CONTROL register instead of falling back to the v2 (and v3) offset during power on and power off. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualco= mm/phy-qcom-qmp-combo.c index e618e675e8ec..5665eb3c1556 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -121,6 +121,7 @@ static const unsigned int qmp_v3_usb3phy_regs_layout[QP= HY_LAYOUT_SIZE] =3D { [QPHY_SW_RESET] =3D 0x00, [QPHY_START_CTRL] =3D 0x08, [QPHY_PCS_STATUS] =3D 0x174, + [QPHY_PCS_POWER_DOWN_CONTROL] =3D 0x04, [QPHY_PCS_AUTONOMOUS_MODE_CTRL] =3D 0x0d8, [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] =3D 0x0dc, [QPHY_PCS_LFPS_RXTERM_IRQ_STATUS] =3D 0x170, @@ -1991,13 +1992,8 @@ static int qmp_combo_com_init(struct qmp_phy *qphy) qphy_clrbits(dp_com, QPHY_V3_DP_COM_SWI_CTRL, 0x03); qphy_clrbits(dp_com, QPHY_V3_DP_COM_SW_RESET, SW_RESET); =20 - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) - qphy_setbits(pcs, - cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - else - qphy_setbits(pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, - cfg->pwrdn_ctrl); + qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); =20 mutex_unlock(&qmp->phy_mutex); =20 @@ -2144,13 +2140,8 @@ static int qmp_combo_power_off(struct phy *phy) qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl); =20 /* Put PHY into POWER DOWN state: active low */ - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) { - qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - } else { - qphy_clrbits(qphy->pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, - cfg->pwrdn_ctrl); - } + qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); } =20 return 0; --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3702C04A95 for ; Wed, 28 Sep 2022 15:29:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234752AbiI1P3v (ORCPT ); Wed, 28 Sep 2022 11:29:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234616AbiI1P2l (ORCPT ); Wed, 28 Sep 2022 11:28:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DD1A5F9AD; Wed, 28 Sep 2022 08:28:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C5AE261F12; Wed, 28 Sep 2022 15:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B167DC43470; Wed, 28 Sep 2022 15:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=WuJsAZUgyp0wCyNm2QoREGEP0a7ostaCyBNlvLxye4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dI3vxBoRIVJWSh9KYH7AefT5sTCrlge943wnpU6OD9Vh9r+JVkQsIhstHx5MNUSLU he+7owecqhJV86/4MxzSMFZXBfccrF8QudCjQgNKFKZDgK9gsDfl8kIr25JToyGX3p Vpnfc+VIwMrLzB1MNYOlMO1xDTsID7vk5fAFUac/AJ7cmZeRiBRfBUqHxGQBydIfV8 2d88ee6SC6sx8G/MDm3QYTX2jOgTvKQsqprEkmSUJJLfoJWlUJ7w7viITZDek6u09M /3YaqN+uKSZSzxQrm6eQs1VYA1afrWJe/5rQ4WtpJ8UWcc7JfheoJ2DA+AtmfLR8UP QXC1jwafSrp3Q== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzL-000802-6j; Wed, 28 Sep 2022 17:28:43 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 11/13] phy: qcom-qmp-ufs: clean up power-down handling Date: Wed, 28 Sep 2022 17:28:20 +0200 Message-Id: <20220928152822.30687-12-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Always define the POWER_DOWN_CONTROL register instead of falling back to the v2 (and v4) offset during power on and power off. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm= /phy-qcom-qmp-ufs.c index d7b35b715b95..c8d86aecfe74 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -89,22 +89,26 @@ enum qphy_reg_layout { static const unsigned int msm8996_ufsphy_regs_layout[QPHY_LAYOUT_SIZE] =3D= { [QPHY_START_CTRL] =3D 0x00, [QPHY_PCS_READY_STATUS] =3D 0x168, + [QPHY_PCS_POWER_DOWN_CONTROL] =3D 0x04, }; =20 static const unsigned int sdm845_ufsphy_regs_layout[QPHY_LAYOUT_SIZE] =3D { [QPHY_START_CTRL] =3D 0x00, [QPHY_PCS_READY_STATUS] =3D 0x160, + [QPHY_PCS_POWER_DOWN_CONTROL] =3D 0x04, }; =20 static const unsigned int sm6115_ufsphy_regs_layout[QPHY_LAYOUT_SIZE] =3D { [QPHY_START_CTRL] =3D 0x00, [QPHY_PCS_READY_STATUS] =3D 0x168, + [QPHY_PCS_POWER_DOWN_CONTROL] =3D 0x04, }; =20 static const unsigned int sm8150_ufsphy_regs_layout[QPHY_LAYOUT_SIZE] =3D { [QPHY_START_CTRL] =3D QPHY_V4_PCS_UFS_PHY_START, [QPHY_PCS_READY_STATUS] =3D QPHY_V4_PCS_UFS_READY_STATUS, [QPHY_SW_RESET] =3D QPHY_V4_PCS_UFS_SW_RESET, + [QPHY_PCS_POWER_DOWN_CONTROL] =3D QPHY_V4_PCS_UFS_POWER_DOWN_CONTROL, }; =20 static const struct qmp_phy_init_tbl msm8996_ufs_serdes_tbl[] =3D { @@ -856,13 +860,8 @@ static int qmp_ufs_com_init(struct qmp_phy *qphy) if (ret) goto err_disable_regulators; =20 - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) - qphy_setbits(pcs, - cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - else - qphy_setbits(pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, - cfg->pwrdn_ctrl); + qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); =20 return 0; =20 @@ -996,13 +995,8 @@ static int qmp_ufs_power_off(struct phy *phy) qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl); =20 /* Put PHY into POWER DOWN state: active low */ - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) { - qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - } else { - qphy_clrbits(qphy->pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, - cfg->pwrdn_ctrl); - } + qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); =20 return 0; } --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 198E6C04A95 for ; Wed, 28 Sep 2022 15:29:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233867AbiI1P3d (ORCPT ); Wed, 28 Sep 2022 11:29:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234522AbiI1P2k (ORCPT ); Wed, 28 Sep 2022 11:28:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08A7DA896A; Wed, 28 Sep 2022 08:28:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5A8E961F08; Wed, 28 Sep 2022 15:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6580EC4314C; Wed, 28 Sep 2022 15:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378916; bh=Vlk4gD9dG2K7feWuy/Wd6MSx9GjtDSoq6AEyp2Fhlbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bg3wZHyEcAxnzybQMhODvCGaixjYhYtKNCHB8P47GLbKDIMEtUC3L++xpv9ZU0mRM vkMxbWHFtABVnAAE9SmZtxZCalliwvprtT5c0rYd9hUtf35wf7t6pxOQlboIfePNLx xOMDkbaMLUkK4CB4WjmuV8nLoOIHZYxWeT4CrCFYyhDs4OhxmfDnABPXkyWp/4DPT0 f9r3F3RT1FjmutfOLk+w4aB0tZrtzmWJD34g9XW66Wo7hTpQuOn/iNJGdRgBUnAdIu MAr5i0beopstgeFO7Q8mO8plSLhTzj8p8vHytaKLJV3JE6UsQQKgOiT1SPYMBnOUFK j1QoMsWTh+g3g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzL-000806-9c; Wed, 28 Sep 2022 17:28:43 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 12/13] phy: qcom-qmp-usb: clean up power-down handling Date: Wed, 28 Sep 2022 17:28:21 +0200 Message-Id: <20220928152822.30687-13-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Always define the POWER_DOWN_CONTROL register instead of falling back to the v2 (and v3) offset during power on and power off. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm= /phy-qcom-qmp-usb.c index f8685eddbf80..8acb5a3aeb95 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c @@ -126,6 +126,7 @@ static const unsigned int usb3phy_regs_layout[QPHY_LAYO= UT_SIZE] =3D { [QPHY_PCS_AUTONOMOUS_MODE_CTRL] =3D 0x0d4, [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] =3D 0x0d8, [QPHY_PCS_LFPS_RXTERM_IRQ_STATUS] =3D 0x178, + [QPHY_PCS_POWER_DOWN_CONTROL] =3D 0x04, }; =20 static const unsigned int qmp_v3_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] =3D= { @@ -135,6 +136,7 @@ static const unsigned int qmp_v3_usb3phy_regs_layout[QP= HY_LAYOUT_SIZE] =3D { [QPHY_PCS_AUTONOMOUS_MODE_CTRL] =3D 0x0d8, [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] =3D 0x0dc, [QPHY_PCS_LFPS_RXTERM_IRQ_STATUS] =3D 0x170, + [QPHY_PCS_POWER_DOWN_CONTROL] =3D 0x04, }; =20 static const unsigned int qmp_v4_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] =3D= { @@ -2164,13 +2166,8 @@ static int qmp_usb_init(struct phy *phy) qphy_clrbits(dp_com, QPHY_V3_DP_COM_SW_RESET, SW_RESET); } =20 - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) - qphy_setbits(pcs, - cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - else - qphy_setbits(pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, - cfg->pwrdn_ctrl); + qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); =20 return 0; =20 @@ -2277,13 +2274,8 @@ static int qmp_usb_power_off(struct phy *phy) qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl); =20 /* Put PHY into POWER DOWN state: active low */ - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) { - qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - } else { - qphy_clrbits(qphy->pcs, QPHY_V2_PCS_POWER_DOWN_CONTROL, - cfg->pwrdn_ctrl); - } + qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); =20 return 0; } --=20 2.35.1 From nobody Wed May 1 14:53:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8F87C32771 for ; Wed, 28 Sep 2022 15:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234742AbiI1P3r (ORCPT ); Wed, 28 Sep 2022 11:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234634AbiI1P2m (ORCPT ); Wed, 28 Sep 2022 11:28:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 868F761D6F; Wed, 28 Sep 2022 08:28:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3076BB820FA; Wed, 28 Sep 2022 15:28:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC018C433C1; Wed, 28 Sep 2022 15:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664378918; bh=alOUuEhnRUZiQBgz0BxBl3gcJ5fFOe0ChoITh0h2imI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qqmCjb7bmm/MqBmSUeSNVyrUL9sThmkv1gFznet8qVrLgFSsrG8z9X5sgvpfIwbx/ 6IRArMJD+JHMBufiLSRnS8STfGjwnWzXCcN1yZ29jm2Q3FVFmMBVBHRS+6IpR8+QVU O0riOl/2nn3L4z+sAb7/1qoT90g+0g2IRCjLHGRIdwYNQJZpnWEQ9Kw5bELt0VdJIl gZPS1gfEy5wLFCVtL8xByR2eDtkYbxXoJnhTvcslKD7LhF+lBdaZ3VIiQEHOAteA6+ WlqJVB6hDmB+ZtGAysLyC2ta8w5aPw2Ls7HxgHeZLKjmaXu2lfIutbihjuZl1Cchcq AX18UMGG2gYVw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1odYzL-000808-CB; Wed, 28 Sep 2022 17:28:43 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 13/13] phy: qcom-qmp-pcie: clean up clock lists Date: Wed, 28 Sep 2022 17:28:22 +0200 Message-Id: <20220928152822.30687-14-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220928152822.30687-1-johan+linaro@kernel.org> References: <20220928152822.30687-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Keep the clock lists together and sorted by symbol name. Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcom= m/phy-qcom-qmp-pcie.c index 150dc58147ce..0b048e32f39b 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -1409,6 +1409,10 @@ static inline void qphy_clrbits(void __iomem *base, = u32 offset, u32 val) } =20 /* list of clocks required by phy */ +static const char * const ipq8074_pciephy_clk_l[] =3D { + "aux", "cfg_ahb", +}; + static const char * const msm8996_phy_clk_l[] =3D { "aux", "cfg_ahb", "ref", }; @@ -1423,10 +1427,6 @@ static const char * const qmp_phy_vreg_l[] =3D { "vdda-phy", "vdda-pll", }; =20 -static const char * const ipq8074_pciephy_clk_l[] =3D { - "aux", "cfg_ahb", -}; - /* list of resets */ static const char * const ipq8074_pciephy_reset_l[] =3D { "phy", "common", --=20 2.35.1