From patchwork Fri Sep 16 10:23:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12978436 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09491C54EE9 for ; Fri, 16 Sep 2022 11:32:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bqYFB2fQjIhm9i6KF7ORSbiDvHRkumRllMVOi2TDMBY=; b=aqpDo+3vHKn4Mb VJWsNcjwBxMt+0UYGmQsvEl6p6lp66BS/4cjaju0KO6mg46P6tMEYn7qE8d41CVMdG+uQe7FAVDZp /ROb8nMsF0KCJb9XaG2MCsHelmWBxq/H2KFyao76xHp9bONT+o7wX78WZqd5xtwjY8W39gRG7vWp0 YjHomc3+WXwY4fEAsgJzqYB512YQ2pgie+5aBS6Av7xL33cych09sVyjk7Fe7kDEtsw/Kb0xJWMx5 YglfNrTR1FT6w2TdHQ7w0D/YQVLmt0qaRQ1FJGpVnzE6k4hKMdfyBXNuOoF7lF1Ba3GAK0/RGWNdw +JnIO2IHXsZGVyCiVWrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZ9a4-00Cigs-EY; Fri, 16 Sep 2022 11:32:24 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZ8Vj-00C8Sc-RG for linux-phy@lists.infradead.org; Fri, 16 Sep 2022 10:23:56 +0000 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 B813762AAC; Fri, 16 Sep 2022 10:23:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92D33C43162; Fri, 16 Sep 2022 10:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663323825; bh=gyqKYHrvHRnv0O3jGyy9VqESKScQm5ejKkMljOJbTww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ez8lsM8YXDDnKDrPpRqDYmPoxT9hgfgIWAZYzbRkUNnaRya+aeqQQlflAhmbROC04 PHcGbJXT3xQiwGOP9J+zDT0SpFZRrPhEoJee/zreCkpRRuTpwvDrphTE+p71IClk6z F376+NG2N/x+fp7mn62Jwwz+6K1L51Iilaya5B2zMHinC92n7DanKRbgHZzajqliu8 Xg5RMklJ2FOC2VECF5TrWWP8HwkRbPLHTLmOQ+5KXZD0noiKYTmkaF5YxTDs0PtnTP KhAglkppJujLFrKfy2MOAjNj2qU1ZkTl0zuKnm6k0IZ0Keo0/lCXRzHVqsGPoLOaEp 2Vt+FoJ96BNlw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oZ8Vi-00030j-Ve; Fri, 16 Sep 2022 12:23:51 +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 v2 09/11] phy: qcom-qmp-combo: drop unused legacy DT workaround Date: Fri, 16 Sep 2022 12:23:38 +0200 Message-Id: <20220916102340.11520-10-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220916102340.11520-1-johan+linaro@kernel.org> References: <20220916102340.11520-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_032352_060115_A2814C1F X-CRM114-Status: GOOD ( 16.85 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.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 combo 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-combo.c | 27 +++++------------------ 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index 1d55892c6575..b5dde7f06ea9 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -66,9 +66,6 @@ #define POWER_DOWN_DELAY_US_MIN 10 #define POWER_DOWN_DELAY_US_MAX 11 -/* 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; @@ -2729,28 +2726,16 @@ static int qmp_combo_create(struct device *dev, struct device_node *np, int id, if (cfg->pcs_usb_offset) qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset; - /* - * 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); }