From patchwork Mon Oct 17 06:50:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3226 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303398wrs; Sun, 16 Oct 2022 23:51:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Qe2CJOWsubui+r7li/lgqJYwJf3O6Y5vWIklFzaFQXrR/bB2gF+9sgpTiO5lpNGLUKqJ+ X-Received: by 2002:a65:6bd3:0:b0:42b:9117:b9d1 with SMTP id e19-20020a656bd3000000b0042b9117b9d1mr9402921pgw.238.1665989513986; Sun, 16 Oct 2022 23:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989513; cv=none; d=google.com; s=arc-20160816; b=rqSHqaIf+VwMtgDae9vS0TseKFqkXyA+PKKgG/M+VnLLxvut3IlouDYZ9HV/AUhZsA gae/d19FwHqXMlUankCM8UljHkvC3Pnj5xoBPium2iH2mbfukuYH9XnokZUbmtuBO+F7 XGfbsY+Eik+P1suIUEWIMlMt8s6vNivvQrZzT2mm6eopz2TXp2+u3fX7dtwwdugBBfV4 +IF6pKiZzAxuCYyvcpIGyNHsAlDRTOzozzJ0feqx/EW/v6Il9UykiCN+qRGbFUEBITol SRGAEUBqEJ7l8ua0MoB2YWZQMh8N4U4sIIKRwKk3J7kvHzXd75HU3Ev1A7f1vwdt+Hhr XK+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/vIMDkwgL1M1MMewp6T8i2WnfuWERSWXMiQjlcaDe1Q=; b=qBfBKnZRCi3A3FWXj+RDiA1XO2DQkY6P4v28TgXMa6hIyLWCLYOg0Ih7EyVZH2lMDN 91dTwexdNDD0q5bcBaWe317ATBKyHaMm49a4g9ydJTgo1CdDVDAUBAnqn4MpZUXHYCIX K6vgunjvm5hIFuHNMMuNM5pFo9DRGGcqUkhkHozsqNssZIy8iOvr4wePTnOFE4WK0hu9 B/SeGB5LY0vVjkJ3dEfMl+yIuPmLnCn0ujaZyOzFm4UFJxky7TfM/1Y8WaeaQXjBOUOt +SalSJW3IWgSxhLa10C3wD5yaa4fCz3QGcHYcB+xFJSoRW3D84G0lT2hdFvOgAV2MXc8 /PuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n4FU4E0h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w8-20020a634908000000b0045f702aaec0si10559882pga.158.2022.10.16.23.51.41; Sun, 16 Oct 2022 23:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n4FU4E0h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230023AbiJQGvE (ORCPT + 99 others); Mon, 17 Oct 2022 02:51:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiJQGuo (ORCPT ); Mon, 17 Oct 2022 02:50:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F14654644; Sun, 16 Oct 2022 23:50:43 -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 0B2F4B80EBF; Mon, 17 Oct 2022 06:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B924BC433B5; Mon, 17 Oct 2022 06:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989440; bh=KHrQ1n0ZcTTSsUzPGNs73NDeWcbPJWAXEpqMTIB4g14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n4FU4E0hIXvjFKKoOY5TVObdyGrA4+BPCvRpOrHD8oF4716q+reGzPqIL0TEVPFDS 83DZPluW9oHHJyOyEjzAwHhdBr9NuKfSncpB7e1Tn9evtao8dgd/LJj7G40qTgFjMw bnYZy8iNmKZ0d569EHbzDIdv5hF3GvdhwUN5KmNBum3FZSy6/pIfKHu67E+y0NDEyz ulU5Ppb2Gxd46NDqNZ50ZGmRvT97bfvTkHcvhlGVrEtiXyXDs4mVV6AFsKEiNa9lst bcZ7J/VncLld3cQG09UbiM2GDZrrO3QqAxSn1FihfyofasX1/2xMPuhxY9yrn1V14A xbtxCfP/psvGQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxG-00057V-77; Mon, 17 Oct 2022 08:50:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold , Neil Armstrong Subject: [PATCH v3 01/11] phy: qcom-qmp: fix obsolete lane comments Date: Mon, 17 Oct 2022 08:50:03 +0200 Message-Id: <20221017065013.19647-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916620352124458?= X-GMAIL-MSGID: =?utf-8?q?1746916620352124458?= 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. Reviewed-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- 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/qualcomm/phy-qcom-qmp-combo.c index 9807c4d935cd..8a2a35c0855b 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, struct device_node *np, int id, qphy->cfg = cfg; qphy->serdes = 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 461f0b5d464a..707ec81c7a2a 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 = cfg; qphy->serdes = 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 = devm_of_iomap(dev, np, 0, NULL); diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index f3f75eda01a6..e0408c423ac6 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -2319,7 +2319,7 @@ static int qmp_pcie_create(struct device *dev, struct device_node *np, int id, qphy->cfg = cfg; qphy->serdes = 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 c08d34ad1313..db5642e1f715 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 = cfg; qphy->serdes = 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 b84c0d4b5754..965e486ab87d 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 = cfg; qphy->serdes = 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. From patchwork Mon Oct 17 06:50:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3222 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303340wrs; Sun, 16 Oct 2022 23:51:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yesHBKOMwMbhwX5Tba4RQecYlmYCHdqDF0sgxHg10G7p2SJ+zwSEa8EMQYbfGGeKwRJhJ X-Received: by 2002:a17:902:ce08:b0:179:ed2b:8cd8 with SMTP id k8-20020a170902ce0800b00179ed2b8cd8mr10566906plg.23.1665989496151; Sun, 16 Oct 2022 23:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989496; cv=none; d=google.com; s=arc-20160816; b=sL7FfzxQHn+RIQ5qJFX80PHgGXfx3HjLLibt6/Wkv2HsINyXUgRDJQfN4Nj1L7Tu5T jTJdhaFXJ4a9XvB1TII5TeKkBNJM5XiO4kwPSqJimZq9/IQK9kLWRzSAzOM8coCAd+Ay fThIAtEqQA2XF6Dq54P38DVMzAfvt5D3wHLpb/cLE2/NfMJak5GYw4huRjWVvoTIrM3Y f9Xe8GTnap2mT4XwkzOh8/4yuvamSO8l1N6O95/tplFNa0OqksmU8KnidRInEtzZlehp TU0P2gk0upRxhtw7qogiljuJEOE7fTXxI19bOIMUpaB4jQTIzLO2UaxsEOBnbDFDdI5f JiZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cSx8Moig/GvyjlBjt5dGxX0R7GTvgingREmW3+v97o4=; b=H68js66LcLJY2OYwGUwWfVqlUoSO2UGnVNQY8am4ksdyZwNqjo/hTFgecLkb2175aG IgCezmOn0xcT1+0hHPvl6KKpOSUxGpBrCoAcQApjVr9VM311WRLjIiDX3s/EezPkK8O/ JFbZm+HGSs6JViEpHmoEpflZ7fzW20LmiGaeG1Wq87PgyuodQSwfjIwgW3pf0f1Z7O02 U1pV+4wJoiSVlXOIeY/O/LzOPO1UVEGJrxImKcFRKd1vBWG5z9Dxwz5LkP3g5xNjme+C oL9t1AOJn8tDQDI/eyxsQjYzMh+ftKlwNwmx9ftfw/ajXDFge/i8YWRZfRuuyKKMJYFH AWJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pI8H4eWP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a17090341c400b0017f92d54633si12840911ple.243.2022.10.16.23.51.23; Sun, 16 Oct 2022 23:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pI8H4eWP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229896AbiJQGup (ORCPT + 99 others); Mon, 17 Oct 2022 02:50:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbiJQGun (ORCPT ); Mon, 17 Oct 2022 02:50:43 -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 BEFB55419E; Sun, 16 Oct 2022 23:50: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 dfw.source.kernel.org (Postfix) with ESMTPS id 5706060F3D; Mon, 17 Oct 2022 06:50:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4B8EC433C1; Mon, 17 Oct 2022 06:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989440; bh=T1ZmsQDoQl71w7+tlwothg2XEVQBeNpf9sx0BIeNoyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pI8H4eWP5Sbtt1KR/8ykdvOoO5KfL4f02kyfl7stJUfKZs9SnpKQQ2lfkT9TXcqb9 3BDyrYAbfoGKPINunO2EGwmXd3BdIGWJ3rR/og9bDM9A9BLvEXVeEC8mlHSBkYtHMT oghu1CJYSrPw+cVsjBv/7lzLX6pSmfS6womHLLB9lBWYN2lx5E4UYYdTa0hIl6hS0l yYBfcfA05FW0Cb4T+P6EHYtZZ1yfOLrK2mEoMlBPTI6IyVuZNsEqIZjJlsbsVKFHXc l8Iiwmo2+3f/6rKJV4gsIKDk7KIouXsYlPDvTCJb4CciI+npugWkkubQ0LBtervQt/ obpko8TwL+b0g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxG-00057X-A1; Mon, 17 Oct 2022 08:50:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold , Neil Armstrong Subject: [PATCH v3 02/11] phy: qcom-qmp-combo: drop unused UFS reset Date: Mon, 17 Oct 2022 08:50:04 +0200 Message-Id: <20221017065013.19647-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916601595788503?= X-GMAIL-MSGID: =?utf-8?q?1746916601595788503?= Drop the unused UFS reset code which isn't used since the QMP driver split. Reviewed-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- 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/qualcomm/phy-qcom-qmp-combo.c index 8a2a35c0855b..c21512b9ab52 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 { struct mutex phy_mutex; int init_count; - - struct reset_control *ufs_reset; }; 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; } - reset_control_assert(qmp->ufs_reset); - reset_control_bulk_assert(cfg->num_resets, qmp->resets); 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); - ret = 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); From patchwork Mon Oct 17 06:50:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3224 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303381wrs; Sun, 16 Oct 2022 23:51:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7nOwaIY9HkiLESrdgA8QTfrgUauagJYaCslrv3tZGNEyqTOswITS939gnGjT3PkRFvoVne X-Received: by 2002:a65:5807:0:b0:459:a31a:80c2 with SMTP id g7-20020a655807000000b00459a31a80c2mr9498571pgr.27.1665989510248; Sun, 16 Oct 2022 23:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989510; cv=none; d=google.com; s=arc-20160816; b=TpN3kBHfWzQWePviAvS0RofxNbtAtR+XQWW/EwXFUWwQYklKltqivxXpz9oNBi42+t Thzi4RyqzGDskmYeOG3l6gDCUy+U95xvquOYC9WTcnHN3wqCwz/Pou+fUJLYYl1COmOl +8hTxKLVeLcJQFyf2AKcLlI2R/AEeAIHDuQDh1pKpYwpn7BL0Dk1k3isaDGQjSqqndiq rCkUDbsT0sctGXEWc/b6sbuQ10FNpjzroEv7OiaMpRXWJHiubVtRYzu+9r2kobDZnsXS rMdLXmBSg7pzWuYEo3/QpclL22OnPHyvyptxq6vtYLnzESwhK8B3zU8crV9r9vXMJOGr jahQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dVsHEX9Yr3pB+GCT6VcU4ForwVqfyA1PTv6GQ1bhhrU=; b=z0F98RRjLUGA5oPO24NMOQBa1Xb5xTU/2z83bHrlZz4Sqpy0SV8oa4yKxOL5iFbJ/R gDUCT4kHeqwM9wxLYSSeMkEYUUuMl5mS5oO31aSmNnlEKR6YWuzi1ARz9HeG98VM5PNE RF1hsuRtf9JoxFtv4wdcfkSF7lE1LOal1wZsQt5UNIVumpnJw3PMWZ/eDk6QhNojLJxv qoC4L3x3E+FcwbBdMvusbO0v4re21tzHI4LQu13ObDa8IpMiIixi1MJFbHjChDs3PsN5 QJO3teHopoIX2NxWM9q8tHzX/0ax+ezUbSuPTbZeNSvN0+ckoDZ9qY6mhRNrJW4IfNpU 8dog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q+f6/BM7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r6-20020a17090a454600b001fde265fec2si15075656pjm.78.2022.10.16.23.51.38; Sun, 16 Oct 2022 23:51:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q+f6/BM7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbiJQGuy (ORCPT + 99 others); Mon, 17 Oct 2022 02:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbiJQGuo (ORCPT ); Mon, 17 Oct 2022 02:50:44 -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 689AE57202; Sun, 16 Oct 2022 23:50:43 -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 1D199B80E48; Mon, 17 Oct 2022 06:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C65ECC433D6; Mon, 17 Oct 2022 06:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989440; bh=1Ml4o6hzM/UjNafMnyQHCmRaP1JMAefAeOIQOOWCom8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+f6/BM7hPLGuxVQFzGXwAyOlPr/Mwcm4buGzbTg10H5LYWaDrD3RNH6MgJy33l1M UGPSHRJSYaJjDMNANjwbUnQYQ3qVtp9utGoipDLos27ODSOaeOu4IQ9ROEdRVE7tl3 cVLufbVNzc3thEw84jRrgT5YIP20VdhDzh6/+8XL4M4Qirx2zzgB0TFWFCJAKXBJMs dPzijk+ZQQr8TV9r5lE4zx+MplbmfWip77y1OBLDvzbQf/4EG463IbQjrvp0GAaThd E6YHG8bkJP1J/qLqSH6TOWPli9vFJ4wX+YvtFFBADFFA0OtqO/oHYR2e1TXBScYqIs P82r0XZJHvnkA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxG-00057Z-Cu; Mon, 17 Oct 2022 08:50:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold , Neil Armstrong Subject: [PATCH v3 03/11] phy: qcom-qmp-pcie: drop unused common-block registers Date: Mon, 17 Oct 2022 08:50:05 +0200 Message-Id: <20221017065013.19647-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916617054305197?= X-GMAIL-MSGID: =?utf-8?q?1746916617054305197?= Drop the common-block register defines that are unused since the QMP driver split. Reviewed-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- 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/qualcomm/phy-qcom-qmp-pcie.c index e0408c423ac6..bdbd18b89a8c 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -78,11 +78,6 @@ struct qmp_phy_init_tbl { /* 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, @@ -100,10 +95,6 @@ static const unsigned int ipq_pciephy_gen3_regs_layout[QPHY_LAYOUT_SIZE] = { }; static const unsigned int pciephy_regs_layout[QPHY_LAYOUT_SIZE] = { - [QPHY_COM_SW_RESET] = 0x400, - [QPHY_COM_POWER_DOWN_CONTROL] = 0x404, - [QPHY_COM_START_CONTROL] = 0x408, - [QPHY_COM_PCS_READY_STATUS] = 0x448, [QPHY_SW_RESET] = 0x00, [QPHY_START_CTRL] = 0x08, [QPHY_PCS_STATUS] = 0x174, From patchwork Mon Oct 17 06:50:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3230 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303488wrs; Sun, 16 Oct 2022 23:52:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM64h8OXQVfE8eXk35YYRP+nJTtYP9vmBrwIXv9HFtjLXs4cFTQqqpcmEds0OULX4iZj0d4E X-Received: by 2002:a17:90a:72c4:b0:20d:51af:3fc4 with SMTP id l4-20020a17090a72c400b0020d51af3fc4mr31906535pjk.38.1665989535238; Sun, 16 Oct 2022 23:52:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989535; cv=none; d=google.com; s=arc-20160816; b=ZVvzenYTnUmqRAu5lHiaBGHmiZ+1gX04Dt68RrWoZbvVnd9cwlqujJT1GSaPmLVasg Vjq4NR2czuTM0Fxdi2Rzu7FB05xFqFVYDXxZ2GFf5QeuQ8KcgCzllmq62ga8v7f4NP8t 96w31mTHooNudQdmfL5Bn4sCWtPgn82XOhCj2bEPeW9PUJmbpH8M2NE7Ms9bvlWj4Y/5 FkmhAC1w1dGIlsnF7GWUXDehOWv1AMk4Nm7truUDZENzMA1Jj73mMcbyUvj086cmyOcs DJo5ZAgw5AH9jIMQYI1b2IC9DestkdI0X6z1eMuiKoiOeaMPRI6h2L+1xTjyNlsvW8hE 27Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lVXBsX05qffFw8UPw0AlSu64k84kHqXw19QK9ueRrPI=; b=w8j66Ywb5N6Nld73AoIyRWRYmAnOgl6ohZtlIjSCFZDsXAZvirxAekRA+aAs5aDmby eIXsdtz158wIJYTWy4nfSUfXGtZ89JQ6m7rZx8AtpDPzKQhMBSqUfupHYhoNaQoAi1i7 +ba96ndaSpHajy8FPWHgHaetxhxHFq7syqm5cphlFyDMaXcfYaFQj+pwej84pwwIInUh H4inbu9ggIJbQqWDXADr2teP1M1RnW/WCwA5FupktfQiVwp009D1uk7GODAX2+r9rYAa hL2UNLu1VrRdMGnWeOmyRgJTXxr4h1qU+Aq5s5eHg+XhKIjRXeYDOVglUSq47hhywlhs opYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CK3DaE7t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 81-20020a630254000000b0046147e930e7si10783716pgc.770.2022.10.16.23.52.02; Sun, 16 Oct 2022 23:52:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CK3DaE7t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbiJQGvZ (ORCPT + 99 others); Mon, 17 Oct 2022 02:51:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbiJQGuq (ORCPT ); Mon, 17 Oct 2022 02:50:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8911313E20; Sun, 16 Oct 2022 23:50:45 -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 9FC39B80F6F; Mon, 17 Oct 2022 06:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAE62C43141; Mon, 17 Oct 2022 06:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989440; bh=g1jmdm0unlBZmP5l4AoYhCIkJtzDq7YAxgLUFKF22RM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CK3DaE7tTE6RbNwiMYR/ibuVR13cCZ1AAGHRPMtipbMEzNPprWr/X/3PNXKEztwkY W3N16UoMbcXwBQM83Mj2o6Ii0bJZCarJvTIV4SvhON0HNlnNAdKywz5O9I12BnDQtu nzZzEUdekYaRgz7j8SLp4FDL9mWjCv+iTHoQzzMu8DkYY/8tlMerx8s7jmhRopSKz/ 2EZ/KOgjxD+gBW3on68xdQrWyef2SUYDDOqGOvB+BNbOR4FUTI4adkHZlok8jgud4x IwE5QgEXpsxtMJ917umy8BP3fG97sc/cua+meNPd6fEFROnXMNNNn4h/b7G9jJw9PS u2RVa52kYQebQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxG-00057c-Fm; Mon, 17 Oct 2022 08:50:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 04/11] phy: qcom-qmp-pcie: clean up power-down handling Date: Mon, 17 Oct 2022 08:50:06 +0200 Message-Id: <20221017065013.19647-5-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916642536826582?= X-GMAIL-MSGID: =?utf-8?q?1746916642536826582?= Always define the POWER_DOWN_CONTROL register instead of falling back to the v2 offset during power on and power off. Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index bdbd18b89a8c..1105d439828c 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -98,18 +98,21 @@ static const unsigned int pciephy_regs_layout[QPHY_LAYOUT_SIZE] = { [QPHY_SW_RESET] = 0x00, [QPHY_START_CTRL] = 0x08, [QPHY_PCS_STATUS] = 0x174, + [QPHY_PCS_POWER_DOWN_CONTROL] = 0x04, }; static const unsigned int sdm845_qmp_pciephy_regs_layout[QPHY_LAYOUT_SIZE] = { [QPHY_SW_RESET] = 0x00, [QPHY_START_CTRL] = 0x08, [QPHY_PCS_STATUS] = 0x174, + [QPHY_PCS_POWER_DOWN_CONTROL] = 0x04, }; static const unsigned int sdm845_qhp_pciephy_regs_layout[QPHY_LAYOUT_SIZE] = { [QPHY_SW_RESET] = 0x00, [QPHY_START_CTRL] = 0x08, [QPHY_PCS_STATUS] = 0x2ac, + [QPHY_PCS_POWER_DOWN_CONTROL] = 0x04, }; static const unsigned int sm8250_pcie_regs_layout[QPHY_LAYOUT_SIZE] = { @@ -1999,13 +2002,8 @@ static int qmp_pcie_init(struct phy *phy) if (ret) goto err_assert_reset; - 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); return 0; @@ -2112,13 +2110,8 @@ static int qmp_pcie_power_off(struct phy *phy) qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl); /* 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); return 0; } From patchwork Mon Oct 17 06:50:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3227 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303412wrs; Sun, 16 Oct 2022 23:51:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/uD7+zW2jtBviiy+77lt6FxGoPz/rlgRB+WMZU638Y59Vz0FGrAX2YXDT1E2+2tb6FfQU X-Received: by 2002:a17:90b:1bc9:b0:20d:75b8:ee5d with SMTP id oa9-20020a17090b1bc900b0020d75b8ee5dmr12250835pjb.147.1665989519309; Sun, 16 Oct 2022 23:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989519; cv=none; d=google.com; s=arc-20160816; b=zivH0hb4zoEk7R39vzQZVrg2NkRPkv7Ka4tu689kTpqYxCNOiQ9YUiTQ28pohG+OOn 7VBJgrFKn60gRlufmlmXy/DBHqldO4C8zJsq0oL2Ls0j30kGmUWVRsWetjZNtjojBS6W DqJ3Q0tlO+LCp/4Z0TRbZtXp1LFLAoS/48xnHhQMkM1r9AQWVc5U64JaXeI0jBq5LkVQ qe+SmvsHHX3mYOcA9IIkLzt3Cp0ZwFQg+64PfWH65zXAHXLAmt8FcjVUQJPDWUd2T/p7 c71lNfV1T7MHT+ZyB7bfU3BmqtTTf4IXG8Lm5yTdO1khtEiuG/BG2OFEmoVPXVP0o6ZL A5WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fXDsjSrqxTrOXbR5IcQHumVOuVLKLj+A7NoM3pEZiKU=; b=MPjFWypPuRDgwN6Ii05X47+d16mbvHCjCblU8FPICvJ9bvDw/eMb6Jt3SZLzgxjbTm ehLpMlUJkKnO/tNvWXmzXlR7dvhpyQoojXQlQei9LjE2/MxFVU1WRbsqsas5UCaCF9N7 ZPWqamvqMR0Iw3v983tcMIAJD7qC7JOfsroF+gUHSVjh3+r1tywqg4esyJ70e5On0HUn SuxwQ/L1b18MbRmI7CG2iiN/ZGLad2ZLqNEJf63CClWceiNkDJRiDsrSBQ1IBkkdjYMy xxzm7CjvDLtIk5hi5DTL5IHJxAO8lTHD3lubDEA0+vy/E9yqLnvd2OpqKn5AheGUwqDv kj6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dMY0/SiT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n128-20020a632786000000b00434a2cf8d6asi12655186pgn.97.2022.10.16.23.51.47; Sun, 16 Oct 2022 23:51:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dMY0/SiT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229789AbiJQGvN (ORCPT + 99 others); Mon, 17 Oct 2022 02:51:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbiJQGup (ORCPT ); Mon, 17 Oct 2022 02:50:45 -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 81CD95725A; Sun, 16 Oct 2022 23:50:43 -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 37824B80F1A; Mon, 17 Oct 2022 06:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8553C43470; Mon, 17 Oct 2022 06:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989440; bh=kOgCXcGyHB8eids12qXfKQV+4R4gdT0Lz+7oWPyNCj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dMY0/SiTcOGP860yFX29bSbsnEEwfRbS3+Z7/9tpfahBRIwQ++qrWHcrGM80elQ3X f0xiq1kNrnEh5JJnOFnzrIIjWwl2rHbJsukKwSzv+8t3XhHwFYTZxNgj9tsIzDxEhD L2vmQbVvp8LrGCYKQVLVpPg1wVPlJgYAkTaMpqJc9hXpdx6U0J5Cax3cPShaUp45XS zdojWp+nPCjvi/OI04FbOPYbDj5ofXrkprjk0vYQ/+tuRJh2LS46CB4iWB1atBvJH+ BSIkr4bPEn1YBjv0ZPtsoGaGI2zyvspsfX7kIN/WnyGzwxZtLmIJSCspKujG7Gunu6 5mIqfvvJDeR0g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxG-00057f-If; Mon, 17 Oct 2022 08:50:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 05/11] phy: qcom-qmp-pcie: move power-down update Date: Mon, 17 Oct 2022 08:50:07 +0200 Message-Id: <20221017065013.19647-6-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916626029237786?= X-GMAIL-MSGID: =?utf-8?q?1746916626029237786?= 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. Reviewed-by: Dmitry Baryshkov 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/qualcomm/phy-qcom-qmp-pcie.c index 1105d439828c..b42c5e185228 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -1976,7 +1976,6 @@ static int qmp_pcie_init(struct phy *phy) struct qmp_phy *qphy = phy_get_drvdata(phy); struct qcom_qmp *qmp = qphy->qmp; const struct qmp_phy_cfg *cfg = qphy->cfg; - void __iomem *pcs = qphy->pcs; int ret; /* turn on regulator supplies */ @@ -2002,9 +2001,6 @@ static int qmp_pcie_init(struct phy *phy) if (ret) goto err_assert_reset; - qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], - cfg->pwrdn_ctrl); - return 0; err_assert_reset: @@ -2041,6 +2037,9 @@ static int qmp_pcie_power_on(struct phy *phy) unsigned int mask, val, ready; int ret; + qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], + cfg->pwrdn_ctrl); + if (qphy->mode == PHY_MODE_PCIE_RC) mode_tables = cfg->tables_rc; else From patchwork Mon Oct 17 06:50:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3238 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303681wrs; Sun, 16 Oct 2022 23:53:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qM83G3DDuuWVbHSrzyrM6fcBeRdWBEhe4G63YDy3OgB3zsJzXU0BNTVVPGxeHAGYa+y+w X-Received: by 2002:a05:6a00:2a7:b0:562:7b47:e26f with SMTP id q7-20020a056a0002a700b005627b47e26fmr11083308pfs.30.1665989584284; Sun, 16 Oct 2022 23:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989584; cv=none; d=google.com; s=arc-20160816; b=U80XCFyzxoRy8epL4AIAKwYEonexhrA/HBQzl+h5OpgWkX5LhLw2maAt92WfQ6gMvp wLTlirw9DxR3NBtqPog4sodKjTnH6CeNXhJ+atpTZ96ujzpQAp88+t1qZc+dsce99Zhe DSpyW2qPuiKVIH1jdBgjHrhepxnXVirDCZAWOkyAmJrmVI6FY5DrSuRhH+cFqv3eKY8R zYWkHAt71TQNogpsbltrEXu4z85iJzwbiYP86H4iRsm+yTQaOZ1tAQgDLQXa28W/28+K 9wj/eoEgXx/Rr4lkonIviBV2Orwfl/O2CL4gp+cLn7rErU0SLECBYMNWp/nwvtyMX2L0 1NOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AOTcvWCdobh3uU0xCyGExWCbiVPgCAXGdhyYBOq45Rc=; b=scYyUJ7gePFAUPHdgawe/O1atzuecSi//+tSpXNQXEe3+wg2mePKIDRIol4JoT4wXy X/qH627GZmeTiMSxbhcLto7sabKsdnFId63nexPD1Z8c3MlGOUm0wrUzjqzmHg+bp1Yh yjoUG12mbo1H1o334PVMR0ErWoCgQnhZqozY4tDUtbiXTh6ZkMjyHu6JN4DHDXB8vIMx sar13dqEGLriMfsnDbJP2njev+iHn8F7XukFUtY3sXx4oElf0Wcm1xhvp7Ic2bwBrVvO 3ek/XiQU9/q7RqW51D+G0tN7QjjFlcw+H9LwTN7Cs9MMNLoe29b4ucLswAL/Qt3MHbCJ fI0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BtcTHCoi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k128-20020a636f86000000b00463dbc5cebfsi10274439pgc.67.2022.10.16.23.52.51; Sun, 16 Oct 2022 23:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BtcTHCoi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbiJQGvK (ORCPT + 99 others); Mon, 17 Oct 2022 02:51:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbiJQGup (ORCPT ); Mon, 17 Oct 2022 02:50:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E52FA5726F; Sun, 16 Oct 2022 23:50:43 -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 96F23B80F4B; Mon, 17 Oct 2022 06:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB95AC4314B; Mon, 17 Oct 2022 06:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989440; bh=548g71Mb6f3vyWSHRoV49n/vXkaP5EyhH0HdMFKQL0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BtcTHCoicEPi1nMLshm7i6orRV55cIxtLnmJTdnrRdXSPGmbJjP2SpvGW7j73i2KM o/UsePjZheo3wKi8HbjdUar9uOBguU+WWIla/lGcaW5jIZTN8XlmHp4RZ+T/AexEGS FH4kD4q/PqBCCzT6wPyqezEWv6kJ1Z5TMXYAOs85YVO2mOoqmctYowGAgIXTQMyZuw kdzz0Uos3wUHbhMosVIFcSqhAFqSGnHgJG5gf+TT+NQJJVU09S9131EYkPc8m5Eo+T B7F4ffZk2K2u+tlIZR5TjA2+hl9U6SW6fOdNNQyVhlBPTo1VAcLh8srOxUZCNTQdyK NAqfATIQ9ygMQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxG-00057i-LX; Mon, 17 Oct 2022 08:50:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 06/11] phy: qcom-qmp-pcie-msm8996: clean up power-down handling Date: Mon, 17 Oct 2022 08:50:08 +0200 Message-Id: <20221017065013.19647-7-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916693993867898?= X-GMAIL-MSGID: =?utf-8?q?1746916693993867898?= 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. Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- 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 707ec81c7a2a..5fdd85a1dc3e 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); /* 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); return 0; } From patchwork Mon Oct 17 06:50:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3225 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303394wrs; Sun, 16 Oct 2022 23:51:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Hci57cU8xsVWtQlAkyNwskuGlIiiCx/okI+VS7wivR+Jwy8KE6jqPduCC/hHqTuDsgfSd X-Received: by 2002:a63:2215:0:b0:43b:e00f:7c7b with SMTP id i21-20020a632215000000b0043be00f7c7bmr9448456pgi.511.1665989512855; Sun, 16 Oct 2022 23:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989512; cv=none; d=google.com; s=arc-20160816; b=vqkuQGWy0MQF8shivxdLG2GFBqHiqSz0adXj8ilGFFpjSdeqe17bEVQMxO8lnKJqzl bXlPOPylPN7YEorz1UZXGdPNm5cMuAqGQmHazylmpT9LOwndbP5CMCUjZUOeYUl2H1it x8pJoTB3gWKEvvLpdu24Q0XPjqx9hKLmKYvcHqP52wtacg+7dmcQugnXv7QLzXONSb8R h0X+9MZhw269FV7gKH24TUSfnPLP0jv/AZL2w0Dd33jlWfFUCCJnH/5TVwCZxE6sJTe4 xCfM2vOcsxKmk/zThBzbSUUKAbww75qtTFwr0KEXSrQqWIshGUCmS+MjjPGDvUNtOO+c 63Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zgZgg0dNZ39yxNFTtxm72Dpyd+CwmeCR6r7B+u9IPhw=; b=AaRvTEzBbZFHaN+3epTzj3DqdKMcAsJYLNXGjbgl5c0vGhBr2QAOPfByfA4nN6x148 vGXlQBLuGhQ5XkkNFASgIGX00YzM1xO+19yh//ZvwGjz1R4tHnSkGuv8RhLkmaw7ysBm v8i6ppuissJ4J6zdhjm42iKxhuzLUiUUKt4mjysuiS5+4Iaxtptbw7gkvCBtwTTtj5bN 5yMJfq/vSOSSaG45NOI4XRjdPv2CObAMIUDn5AMl20zEyR6Xnlr+Vv8kQw2A8Em9+YC8 TSC0VeT2ox+Tt+H4EmzSG8eq8voQcdk1TKAlL4Uc13AV3MhJ2wOQbMzBlZNYjCBmqv8x nRxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ci5NuFnY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a63ba05000000b004403d152465si11545772pgf.12.2022.10.16.23.51.40; Sun, 16 Oct 2022 23:51:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ci5NuFnY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbiJQGu7 (ORCPT + 99 others); Mon, 17 Oct 2022 02:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbiJQGuo (ORCPT ); Mon, 17 Oct 2022 02:50:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 672E913E20; Sun, 16 Oct 2022 23:50: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 dfw.source.kernel.org (Postfix) with ESMTPS id 00FA660F35; Mon, 17 Oct 2022 06:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3481EC43160; Mon, 17 Oct 2022 06:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989441; bh=QjLgv94nVfpXem8gTbxoogi1BgbsQEeoIJ4bpkQNxzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ci5NuFnYyAnC5QsBVMvbjkqXubpEuCGvkT+MEiDhC7hnVb7RzTigXVwC68M1ItjWt 1N3FEtLWpUhlgdnNg5Mfmto9V4iQT+RK3ERI249+olv1SoZoasOrTrznFYtUB7QviF iizirRj+Jzv8i0HJzI72jlJHYg+2d0YlRwOut8phwE4vQRNeINGZq/ogC5Gm5sfKn3 LRi9ZzC+tmNvCzhPbRH8qoBSTMze2lhu0Pg8payeRd7qc9YZqMClD+DBOiPwVEVLvr NvWd7/ehKnjR4hf2eIxOZAIYZhBcHf85WUsZXPYN1Id+T5kBMLVC3ZegALE5mPCOrk UECaNuUqNf5oQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxG-00057l-OV; Mon, 17 Oct 2022 08:50:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 07/11] phy: qcom-qmp-combo: clean up power-down handling Date: Mon, 17 Oct 2022 08:50:09 +0200 Message-Id: <20221017065013.19647-8-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916619750981877?= X-GMAIL-MSGID: =?utf-8?q?1746916619750981877?= Always define the POWER_DOWN_CONTROL register instead of falling back to the v2 (and v3) offset during power on and power off. Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- 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/qualcomm/phy-qcom-qmp-combo.c index c21512b9ab52..7b434e2ee640 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[QPHY_LAYOUT_SIZE] = { [QPHY_SW_RESET] = 0x00, [QPHY_START_CTRL] = 0x08, [QPHY_PCS_STATUS] = 0x174, + [QPHY_PCS_POWER_DOWN_CONTROL] = 0x04, [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = 0x0d8, [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = 0x0dc, [QPHY_PCS_LFPS_RXTERM_IRQ_STATUS] = 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); - 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); mutex_unlock(&qmp->phy_mutex); @@ -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); /* 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); } return 0; From patchwork Mon Oct 17 06:50:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3228 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303439wrs; Sun, 16 Oct 2022 23:52:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7yyi1CiRmkQUT2zAQmt0IuS4DtroSHGQP0qfJf5UVu87SVWMEqJDx8gG88gLCfrbsDnKtY X-Received: by 2002:a63:4542:0:b0:43c:b1c6:7df8 with SMTP id u2-20020a634542000000b0043cb1c67df8mr9645246pgk.138.1665989522754; Sun, 16 Oct 2022 23:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989522; cv=none; d=google.com; s=arc-20160816; b=y2KwgtcuSrPZjg/MYgiW5X7iQoxbtXA7AWBstMtrSoDGCz/tj/zqk5x2XOVdfZxyXY VrheRDiW6qWU+8Ig453tFmkNyityDTILKFkyUhF71hC7b2mANnxFPKCDy1eeIxMihyvY QVEsjexm+GG6PcPAxXdQoc5RRJLl1CPR5oUPvY9Iox3PIa9C72pimSePqM7mvBwYRZw5 zGwshQjX6K+BMkBuTDTrplNiKd2rfWavxJjbdkPGVixOV2rqa+f0pUhtArqnnr/at+ww YovgUkygdtws67yI4ko+u5Vw2Kok8tZEWywoV0m96rrNUBYThb7ydXSqARIwSKdDA3Hg Lwwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wnnt5nvQRfAOxPfPSoWFniL2jqA72DEMDqugXwzb3lM=; b=yN1eveTUUELSRx5egbFUMYCIN0QqW0PsLMWW1uI8f8M/z27qh7IBg2fGJ57G2nFNkv ni1FPQRah4mThRwIn6PDyaANquJAQBBFCbsoKS0x5ctODRBOcoo6/i5cTlFUWEEeyEAY 5Oveoa6tg28giNCzJoUkK3sQOybVSlYxKZZa67ka2BcIvdU3iWKsJ7yIHU/Rvt24+zqg VMMScdRLFuUx4Sw/fF2FEBQfPbfYxAr3+nIOTixrqCJrNn4285L5rAI6TI50eH4DZiTO 93mmbNXmUNK+r1aryV+E3nTx9lBAa2saq3xVjehtdsd4s9dDkasWUZDG3GkDbtlsbwBV VAlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q3aQlWFs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a056a00218900b0053aa6311dc4si11988429pfi.19.2022.10.16.23.51.50; Sun, 16 Oct 2022 23:52:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q3aQlWFs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbiJQGvR (ORCPT + 99 others); Mon, 17 Oct 2022 02:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbiJQGup (ORCPT ); Mon, 17 Oct 2022 02:50:45 -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 E53575754F; Sun, 16 Oct 2022 23:50:43 -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 9778AB80F52; Mon, 17 Oct 2022 06:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 347ECC43159; Mon, 17 Oct 2022 06:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989441; bh=n0OqNs+38YD2gubBXOfcUP6aY+cSEz5qKt4TCInVZ+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q3aQlWFsZ4lSEoADUpAPFXmRWzjGiyFIwQbytiGbCaOk6I3hjUfTcn4ulY0yMzPo4 1X3hWDavHG6lVht7lW/60Sc5oH0ug1fLmmKccwFtkpNzxBXk+jFqw/Gsm6/5qS+Iba BONmj1+vIddzO/Naq6yV3yRWk9O7v13z3x/iRr0X+YBfQXdNdwl4esRC5NWNELNbWC VXDgjBe38w+ha1uAhBTnQ432FI0EK1nRc5Acy0W6FArnkUB14mYzic6oyZnJznOrF+ bxU4VHDXGluUNQOSl9y6IHqtlQ2u9BR22vKx4jQ+96RKkX3mNMQcbSmMCV+EUy1g+R nRsD7QU26eY9g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxG-00057o-Rk; Mon, 17 Oct 2022 08:50:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 08/11] phy: qcom-qmp-ufs: clean up power-down handling Date: Mon, 17 Oct 2022 08:50:10 +0200 Message-Id: <20221017065013.19647-9-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916629654086386?= X-GMAIL-MSGID: =?utf-8?q?1746916629654086386?= Always define the POWER_DOWN_CONTROL register instead of falling back to the v2 (and v4) offset during power on and power off. Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- 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 db5642e1f715..e28c45ab74ea 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] = { [QPHY_START_CTRL] = 0x00, [QPHY_PCS_READY_STATUS] = 0x168, + [QPHY_PCS_POWER_DOWN_CONTROL] = 0x04, }; static const unsigned int sdm845_ufsphy_regs_layout[QPHY_LAYOUT_SIZE] = { [QPHY_START_CTRL] = 0x00, [QPHY_PCS_READY_STATUS] = 0x160, + [QPHY_PCS_POWER_DOWN_CONTROL] = 0x04, }; static const unsigned int sm6115_ufsphy_regs_layout[QPHY_LAYOUT_SIZE] = { [QPHY_START_CTRL] = 0x00, [QPHY_PCS_READY_STATUS] = 0x168, + [QPHY_PCS_POWER_DOWN_CONTROL] = 0x04, }; static const unsigned int sm8150_ufsphy_regs_layout[QPHY_LAYOUT_SIZE] = { [QPHY_START_CTRL] = QPHY_V4_PCS_UFS_PHY_START, [QPHY_PCS_READY_STATUS] = QPHY_V4_PCS_UFS_READY_STATUS, [QPHY_SW_RESET] = QPHY_V4_PCS_UFS_SW_RESET, + [QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V4_PCS_UFS_POWER_DOWN_CONTROL, }; static const struct qmp_phy_init_tbl msm8996_ufs_serdes_tbl[] = { @@ -856,13 +860,8 @@ static int qmp_ufs_com_init(struct qmp_phy *qphy) if (ret) goto err_disable_regulators; - 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); return 0; @@ -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); /* 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); return 0; } From patchwork Mon Oct 17 06:50:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3229 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303441wrs; Sun, 16 Oct 2022 23:52:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4+e7uEi4Ck0/G1fUh272o7UJkFAH+/o/2Odx56RPf+Nwc1UcVYBjiyOHAZhNniNaBPEl3t X-Received: by 2002:a17:90a:c90c:b0:20a:7179:b14f with SMTP id v12-20020a17090ac90c00b0020a7179b14fmr11906054pjt.58.1665989524763; Sun, 16 Oct 2022 23:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989524; cv=none; d=google.com; s=arc-20160816; b=KWXBu4GE4iLqTyDKNH4uVFBKmBjBOwspDmUdac91pEF6RJQfFIqX2f0MXk8c5yNZvv Wc9GTqreFHND+f/UzXMg9afX8Mk374KMZ+3vcS8V6Wk3Ox3J94L5TJyG6O1ZnC03t4GG IeCKZi1U8juvE/byezvgLICB8V8N2Zed8qVfuJUWg2Fun546CEH++uhCJpzJO68o9aNk sacFfrMU2eUlgympVqzYWfSEZnNXtWHTyru2XHYrkkPob0VhAXkvafc/DHeXqI1n5c36 2HcC/damhIV2sYoYS3Twf7oC8icLxhuj3XxjiRRFpDMhPvVDxCjwDjR5VJEz07ARhg9T 7POw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1IsFbsP4C3lSDzjR/XY1xkR5U91lJBvVKnQzyKLiGPc=; b=BZO3fr3ejaCCh+WmpYgTF8Atvomx288Pf9rQrxCth1btucBF0eR+mW20Szh9EDI5pD MxxC58O3UoeLUXTB5JSqxIUVDq5Km4ovpt3mzfljFj0yBsZrzexA4hkpvyzaTW1E0BWR scWrSYIwcJoNemJsOSdd0YOPKNtsDBjcFYr4lNC8L51C14O75tfY8s4YdZAu4aU09VFe BRjbj1jvZ2r8IbWdXqO871IwVYOw7Bp9/VynGYodyfxP/yqEzEE2aU6/SfHcgx8XOpB/ wEM0dg3vtneSIFjYuXLRHb3FiSaweKHw5y45TCjeM0+LHw8Vn/Ib1BoWJGUgWSPdqkZh 9+4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="euto/nuJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a056a001d8b00b00564f6be1218si10615292pfw.71.2022.10.16.23.51.51; Sun, 16 Oct 2022 23:52:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="euto/nuJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbiJQGvU (ORCPT + 99 others); Mon, 17 Oct 2022 02:51:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbiJQGuq (ORCPT ); Mon, 17 Oct 2022 02:50:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D3D84D4DB; Sun, 16 Oct 2022 23:50:45 -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 408C8B80EBD; Mon, 17 Oct 2022 06:50:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EC3EC4FEB6; Mon, 17 Oct 2022 06:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989441; bh=h9t3f2jv70g3Xg8Fuz/cy6pNfgf+gjH5E7JH0Z7sUPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=euto/nuJP40pIQNp7AbjSENl7GIMh212CJCFmG8aGOmWQ8EvGiKRVl2R8Xm4i5f9+ UPF6gTNikWVC+yJ1PGab9ioyAQzYN08l6uqmtpFjiwFbDpW3Fm9NbggRwwwIdWv7Pc 0pL2TQRlCw0i6t5/Y75aFbM5USQGf9OZQYoTzbPMEzZkpp2sY1zlqKNfK9yOnV17rK 0IMUT3yRM/Q+2HlwiSP0+kYXhZpXLms/fSzZh0cdqkrLKoahOypbSJhD5V3iNAiqU2 2zpNUsTBiUVSfztm50SFE3kEZJxm7Nv5NjQrxqh6aTCuSJeLGrR36samuJWNIH3DSJ TY3aG8O96UH9g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxG-00057s-Uu; Mon, 17 Oct 2022 08:50:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 09/11] phy: qcom-qmp-usb: clean up power-down handling Date: Mon, 17 Oct 2022 08:50:11 +0200 Message-Id: <20221017065013.19647-10-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916632058903768?= X-GMAIL-MSGID: =?utf-8?q?1746916632058903768?= Always define the POWER_DOWN_CONTROL register instead of falling back to the v2 (and v3) offset during power on and power off. Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- 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 965e486ab87d..b0b13fb6cb59 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_LAYOUT_SIZE] = { [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = 0x0d4, [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = 0x0d8, [QPHY_PCS_LFPS_RXTERM_IRQ_STATUS] = 0x178, + [QPHY_PCS_POWER_DOWN_CONTROL] = 0x04, }; static const unsigned int qmp_v3_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = { @@ -135,6 +136,7 @@ static const unsigned int qmp_v3_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = { [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = 0x0d8, [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = 0x0dc, [QPHY_PCS_LFPS_RXTERM_IRQ_STATUS] = 0x170, + [QPHY_PCS_POWER_DOWN_CONTROL] = 0x04, }; static const unsigned int qmp_v4_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = { @@ -2164,13 +2166,8 @@ static int qmp_usb_init(struct phy *phy) qphy_clrbits(dp_com, QPHY_V3_DP_COM_SW_RESET, SW_RESET); } - 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); return 0; @@ -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); /* 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); return 0; } From patchwork Mon Oct 17 06:50:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3223 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303370wrs; Sun, 16 Oct 2022 23:51:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5SSD4KasH4bINT+y7xPgTwwy2l42r9lPwfhpIPF1fKyZDrN7EqsVIgvWMrV+9JDgfvgif7 X-Received: by 2002:a63:ea58:0:b0:45f:ffa9:60a0 with SMTP id l24-20020a63ea58000000b0045fffa960a0mr9479828pgk.433.1665989506634; Sun, 16 Oct 2022 23:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989506; cv=none; d=google.com; s=arc-20160816; b=zEWf2fcKU/N6bmOynWqsuJHpfGCC2I39IbxofBQlJP0EoYkbpdFc3SjmbCPxZDFN1v nkyigYLx/hq60ZtNU9hAd21NOGGAvwiJlR9FBDLa9RC2Eil7NY04fXf9DeqIH8j/LMWO DcLl9ASoI/D5uGceOJepignBKo33cL5/HQY57DfcAdoFiR0aBI3I6r6O3sLE+sQg2ErG UcWdEfrfR/hQptxMkjKtMMub1eZzBOXikfMywfubn97UClCWaJyEbqgNrdP8sYOLGcEY Um1KdJoeJ2+NeGd3y5n8hDv0Jn6t0smHBLNE2beMorxShHnnzt3xAppa28qij79v0WwO A5vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+A3xq098EF4Ogyub3gib25elzDyIF1sKjMUm0aPYBYQ=; b=H8r3ql5PWMGDyxqQu5d+oqZ0XWXdPmEUFA72c7+/HDQx5sx9JDczJmVo6k6CmdVkwo mfp5RnWmFzpGV6dakdaJsP2pYW8/JKth6CP0wiUxSuTDENjgoBeeaBsTl0Gsb20DOemc fzh5BwSVZai6xLxca68hmYo86h+hd6bxgzZe1Z6WMzUyHz75HrhU3+rm1foKaa2ZDS/M Xj8L8fhJrxsOxtopd5gsr/7Z3No4Yss6ANMciJVmilwcH+yu3Yb3cCFDnzGdS5L0Z9a3 q2JfL/jT+nC6+JMsovrW9+r6OuZqKF2IATxDA7TwZE2pXTwMRfLQ5GMgbo0W35owx8TU qnrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Aj9eHr5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a656944000000b0043a20d57b46si11188704pgq.826.2022.10.16.23.51.33; Sun, 16 Oct 2022 23:51:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Aj9eHr5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229984AbiJQGuu (ORCPT + 99 others); Mon, 17 Oct 2022 02:50:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbiJQGun (ORCPT ); Mon, 17 Oct 2022 02:50:43 -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 9765154642; Sun, 16 Oct 2022 23:50: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 dfw.source.kernel.org (Postfix) with ESMTPS id 3391660F49; Mon, 17 Oct 2022 06:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39FBCC4315F; Mon, 17 Oct 2022 06:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989441; bh=7LiW5IgqW3n+57I2wMozVoRVMIRb4PGmwDMVU0MIa2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Aj9eHr5LP5XG1yfpEpD47AM0Y0l1ZAlA6GQY5e+lfA5eJDfrOATAcCBzs6vQqyBJl AiVr+r1rGQLOCsEvL+etVPcjNjLFcC+fMMbBEE1u47MEyi6cosGzLHgykNbDzB9ie9 CMZ8ipq8knQvw5ezFz5hPxboAk6Y9JT9uk3EKhzaj9JFt+zTOit6RTH/C8eVRwM29l t+uaIQDpufZhMvYVR2BLWBzFoyqmORve5bCMuWQbVTgYqEcmYWW2Gh81JmcJl/1i5z 5gXZ1fjMxcm892/kguunKB77s8OGeu7ZsSM6SgRMK3V8BIuoctIe7icKwZeryenqJa VKgQLaoGY4iUw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxH-00057v-1b; Mon, 17 Oct 2022 08:50:31 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 10/11] phy: qcom-qmp-pcie: clean up clock lists Date: Mon, 17 Oct 2022 08:50:12 +0200 Message-Id: <20221017065013.19647-11-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916612963068506?= X-GMAIL-MSGID: =?utf-8?q?1746916612963068506?= Keep the clock lists together and sorted by symbol name. Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- 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/qualcomm/phy-qcom-qmp-pcie.c index b42c5e185228..cb2128e5a78d 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -1462,6 +1462,10 @@ static inline void qphy_clrbits(void __iomem *base, u32 offset, u32 val) } /* list of clocks required by phy */ +static const char * const ipq8074_pciephy_clk_l[] = { + "aux", "cfg_ahb", +}; + static const char * const msm8996_phy_clk_l[] = { "aux", "cfg_ahb", "ref", }; @@ -1476,10 +1480,6 @@ static const char * const qmp_phy_vreg_l[] = { "vdda-phy", "vdda-pll", }; -static const char * const ipq8074_pciephy_clk_l[] = { - "aux", "cfg_ahb", -}; - /* list of resets */ static const char * const ipq8074_pciephy_reset_l[] = { "phy", "common", From patchwork Mon Oct 17 06:50:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3231 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1303522wrs; Sun, 16 Oct 2022 23:52:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Owb9xtrm1fVqEMuA9y6OvJrtp9WDa5zUZdp1OxHJsO2tX2u+fiw7ei1aL4CuBPK/fIYpp X-Received: by 2002:a17:903:120d:b0:178:a6ca:b974 with SMTP id l13-20020a170903120d00b00178a6cab974mr10700924plh.8.1665989546828; Sun, 16 Oct 2022 23:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665989546; cv=none; d=google.com; s=arc-20160816; b=NkvS/Qzl4mcOW6fsOctpa/eXRSI/8KG/Bvomgou8YxPiphsfa22KsZmJAd9BTRGfCp 5SmYVOqjYPeb0uX/Pi70vrz0qOJjBFETpnmhz4iVE67hcXOAUde0SwvOUdRaXfUxQKHN qem/UrZnSft97+RYixPEOcZl5L/tgG7QaXAHUt0NXRYhs3H9rqq6kGCl3fLSgt/VfYus MwVIQNvwinnSTMMRTZXZ6tG7P3ZxUuBZwhxoicvzGqvcMfDIPGV5l/orvUteScCy0zkF 8guQSA95CxtIdE6U11xV5I9sp/c5ucF4BQ2lQtGnd8Q9QtT7X8Xyp142mTy0VXUkI8RU Lcsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aupfySNHynwetcK69NzFkmT4xvZ+cG+PIcspHepwg60=; b=Qux1nkWBv5iB6SA3H1QFNIS7ka4TMd31AMmJuds1cKKG6SYhnv40hx9oS3LgaMVYLd 3cqTI6Y/l/m0EGiUMBAypf5bbALgjRRbz90ypy4l7rjFNPspHw1U0d31H4FYJzTxocUX JgS7sbdQ2vPq9RWAwtoWJp9thNeiaflg/kcg8jJa7S0ZU+v2CbedWengMFXlo05kgJmS 0vvDz3Y6j3EWA7fKqgo6CzIqxCObHrQ4FxVu/l8HG5jXvXb3hJJHkCLQaIQ6zeMvrCym A3zgTMJgsUHzmp8k7+ai2DWkVeVDj8n2DmElBDXQxvU4PEPU1ulmKVJlO5OIkU12Jpkr Bm1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=npDf3EA2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 72-20020a63014b000000b0041a4f434cecsi11092062pgb.798.2022.10.16.23.52.14; Sun, 16 Oct 2022 23:52:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=npDf3EA2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbiJQGv1 (ORCPT + 99 others); Mon, 17 Oct 2022 02:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229905AbiJQGuq (ORCPT ); Mon, 17 Oct 2022 02:50:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B1954A137; Sun, 16 Oct 2022 23:50:45 -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 67EDBB80F93; Mon, 17 Oct 2022 06:50:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 645C2C4FEBC; Mon, 17 Oct 2022 06:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665989441; bh=TcypivBfk2W9WTPaCElq2ehES8rUnpTli45iHdyD1GI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=npDf3EA2kME9CIke9xlNkjp1Ez0kSmsEHigY7UIbCKvoRFnyvAOt6qFLhHAMgDKzz QL0vi4KpA6R2XEL5Tzcgtgd5rP7lA/oBx4H3OpRCcYN6FzQKHuSWzvaklqfWsNzidr xwvaGZHHXOkGdgtS7lLLBoGbIRr0T9/OXKaLNOQjAklU2f/rUAOtzmg0SK9hleBwe7 kF5/KrSEQSvQmZIXa+Rk9F1+seAAR2Qs8chvu7yn+Zpp55duLBEdHY2BOpItSOevKq mPvvSQdHI0KvQ+he/UipGN0HSjTBlgsd1tersKIhhY5ckjWy/cdVZLWVy1SS5eWc2F dqHdSgzKpjZ7Q== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okJxH-00057y-4V; Mon, 17 Oct 2022 08:50:31 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 11/11] phy: qcom-qmp-pcie: drop bogus register update Date: Mon, 17 Oct 2022 08:50:13 +0200 Message-Id: <20221017065013.19647-12-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017065013.19647-1-johan+linaro@kernel.org> References: <20221017065013.19647-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746916654987363530?= X-GMAIL-MSGID: =?utf-8?q?1746916654987363530?= 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 USB") added support Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov #RB3 Signed-off-by: Johan Hovold --- 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/qualcomm/phy-qcom-qmp-pcie.c index cb2128e5a78d..30838ae8f027 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -2061,12 +2061,6 @@ static int qmp_pcie_power_on(struct phy *phy) qmp_pcie_pcs_init(qphy, &cfg->tables); qmp_pcie_pcs_init(qphy, mode_tables); - /* - * 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);