From patchwork Wed Sep 14 16:25:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 605821 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 5E312ECAAD3 for ; Wed, 14 Sep 2022 16:26:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229634AbiINQ0u (ORCPT ); Wed, 14 Sep 2022 12:26:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229932AbiINQ0n (ORCPT ); Wed, 14 Sep 2022 12:26: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 91A0A7E037; Wed, 14 Sep 2022 09:26: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 43EF4B8171B; Wed, 14 Sep 2022 16:26:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4F08C4315F; Wed, 14 Sep 2022 16:26:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663172798; bh=paVqUMRBQw9kTTDsBjch9ckYDPbckCXhP60LUyZoBiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s52mFYDnriTA62zIeNSjL/p+m9YQAw/9vZE4YGuphHL6NP6yDaAKrOJ53dAicmj46 pK+Y10NAiojuETsnqfUtuBZ0/KSS6B9R66Goq0k5CSwtuSqbTLKey/A68o2E/z2yd8 y7wCnfN9vverKdJ0MSZJjTf14nPtRpoH7xqI7z0yMinuqUP3ctDZDMpAGQqUDqoAwq j/0OXLX00tBebvbPyz2DogdhS0sJqAqLUKMPtSzwt0Qt8ssxXVmJFyybB3ZstcqLs1 wBq8r6JaWADW/9y9KJOl6QTYCY1r0VBCKS/KHXSNy+jQkC5/d8w2vO+yC5a3N4hGNG x8pcINVAV4rlg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oYVDk-0001ep-3H; Wed, 14 Sep 2022 18:26:40 +0200 From: Johan Hovold To: Vinod Koul Cc: Dmitry Baryshkov , Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 08/11] phy: qcom-qmp-pcie: drop unused legacy DT workaround Date: Wed, 14 Sep 2022 18:25:42 +0200 Message-Id: <20220914162545.6289-9-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220914162545.6289-1-johan+linaro@kernel.org> References: <20220914162545.6289-1-johan+linaro@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Commit 5e17b95d9893 ("phy: qcom-qmp: Utilize fully-specified DT registers") added a workaround for legacy devicetrees which did not specify register regions for the second lane of some dual-lane PHYs. At the time, the only two dual-lane PHYs supported by mainline were "qcom,sdm845-qmp-usb3-phy" and "qcom,sdm845-qmp-ufs-phy", neither of which is a PCIe PHY. Drop the workaround for malformed devicetrees, which should no longer be needed since the QMP driver split. Signed-off-by: Johan Hovold --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 27 ++++++------------------ 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index e6636700871c..4939edcd8cb1 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -38,9 +38,6 @@ #define PHY_INIT_COMPLETE_TIMEOUT 10000 -/* Define the assumed distance between lanes for underspecified device trees. */ -#define QMP_PHY_LEGACY_LANE_STRIDE 0x400 - struct qmp_phy_init_tbl { unsigned int offset; unsigned int val; @@ -2270,28 +2267,16 @@ static int qmp_pcie_create(struct device *dev, struct device_node *np, int id, if (IS_ERR(qphy->pcs)) return PTR_ERR(qphy->pcs); - /* - * If this is a dual-lane PHY, then there should be registers for the - * second lane. Some old device trees did not specify this, so fall - * back to old legacy behavior of assuming they can be reached at an - * offset from the first lane. - */ if (cfg->is_dual_lane_phy) { qphy->tx2 = devm_of_iomap(dev, np, 3, NULL); - qphy->rx2 = devm_of_iomap(dev, np, 4, NULL); - if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) { - dev_warn(dev, - "Underspecified device tree, falling back to legacy register regions\n"); + if (IS_ERR(qphy->tx2)) + return PTR_ERR(qphy->tx2); - /* In the old version, pcs_misc is at index 3. */ - qphy->pcs_misc = qphy->tx2; - qphy->tx2 = qphy->tx + QMP_PHY_LEGACY_LANE_STRIDE; - qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE; - - } else { - qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); - } + qphy->rx2 = devm_of_iomap(dev, np, 4, NULL); + if (IS_ERR(qphy->rx2)) + return PTR_ERR(qphy->rx2); + qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); } else { qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL); }