From patchwork Fri Aug 19 09:13:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12948583 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 75C4CC28B2B for ; Fri, 19 Aug 2022 09:15:45 +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: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:In-Reply-To:References: List-Owner; bh=kl7vCA2NXrO15T5csAWjPt+fWstiFEPY6qspzrkHBUs=; b=KSNdKDAQ1NO6nf 6f01FkDAYrhjithE0ssHY5Ptpe3uMvcKjY4nVQpslc1F/Q0cocfnIlYSZAdQ9jgj9xj80SzOk9C8+ oNWtSPlFPw7jRj2HDhXEAOvoc3b3GD03pEpUvvro+PKsnpov/mJ/6ZqIdSIwZY/dzlZb5/OwaLAEI Y+kynfBU/kHoFbKw3rTZgYrqeQ9C1cQBklL29pnj6KQQHniVbNkXEHryUctj8Vh4wgjFW6MPc37Uv vuxzEy1a0wyAP+v4CG4A6QtxaGRBUQMuMjvOaJTCnKhjgyOyI+104wRBM7aN28e6S3k4+/PnctqOn wnxxj54xXemMvMXsoB0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy5J-004jGD-Pg; Fri, 19 Aug 2022 09:14:34 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy5A-004j1V-4H; Fri, 19 Aug 2022 09:14:25 +0000 X-UUID: 866e61842a12453db680401fb22c26a8-20220819 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=6DIb2Hf1dBs3/8w1JBp1PNiZ4wwxVvmiLUz15oZzjEs=; b=bHL9ocdRXl7vOja/vVNZMfgOXA5R4zEjx5eSsS4HO0P5f3KRhdjxxAMMER8Mg4xGGshCkVXWPbJVQQIrPrdMBZwiy2qYK8Cp2MdK3eWHbcsbuExbcGl3XctEYEdZ/PALcH6cYMSBSPcjK0H1GhDgfdNZpI/HjwiZMWwhDt35Mgc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:a43d6b5d-9be6-4821-a1b6-d170fe6ca795,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_ Ham,ACTION:release,TS:0 X-CID-META: VersionHash:84eae18,CLOUDID:682b33c9-6b09-4f60-bf82-12f039f5d530,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File: nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 866e61842a12453db680401fb22c26a8-20220819 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 582914426; Fri, 19 Aug 2022 02:14:20 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 19 Aug 2022 17:13:45 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 19 Aug 2022 17:13:44 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring CC: Chunfeng Yun , Kishon Vijay Abraham I , Krzysztof Kozlowski , Matthias Brugger , , , , , , Eddie Hung Subject: [PATCH 1/7] dt-bindings: phy: mediatek,tphy: add support type of SGMII Date: Fri, 19 Aug 2022 17:13:38 +0800 Message-ID: <20220819091344.2274-1-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220819_021424_283936_A2878FB9 X-CRM114-Status: UNSURE ( 7.43 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support ethernet SGMII, forgot to update type supported. Fixes: c01608b3b46b ("dt-bindings: phy: mediatek: tphy: support type switch by pericfg") Signed-off-by: Chunfeng Yun Acked-by: Rob Herring --- Documentation/devicetree/bindings/phy/mediatek,tphy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml index b3e409988c17..848edfb1f677 100644 --- a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml +++ b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml @@ -163,6 +163,7 @@ patternProperties: - PHY_TYPE_USB3 - PHY_TYPE_PCIE - PHY_TYPE_SATA + - PHY_TYPE_SGMII nvmem-cells: items: From patchwork Fri Aug 19 09:13:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12948584 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 2505BC25B0E for ; Fri, 19 Aug 2022 09:15:54 +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=PGGY4FTkhSzHUelvRcB0qnDpoWKnenBCUQGmOHXqXO8=; b=gro2X4NLdvnds6 yQSgP4GhWnNC5vXEwUzG0uEd8X0r5YN+7aSBdVbQbvNqN/9r8T6Ya5a9hcQwj4XzMeF2UD0qSskcf oxAmiN6ovv0J8D6ZOIOT9RzgAuw7atY539vZOWF5jAr+s9fiFAllutiTrsecNI3TeilxojJVpzdHH /pvfJWtx1YAAfnYZIHCuTmqrPVxW3TR0OzdK9pOTMyoCVIeNpzNEV05Bb7weSahm9ic2upfesOwtr w5xj7v3ipFlzzYvbDqycpkqVYhUNaErFAGHrtirPsMYp2Dp+lUapsto3WLypV+MXkzLC8jPL+EvXv 4dC5RZWBgwzq4/EEDlAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy5c-004jTa-Ec; Fri, 19 Aug 2022 09:14:52 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy5B-004j5Z-G5; Fri, 19 Aug 2022 09:14:26 +0000 X-UUID: c8b20dcc9a674d25983857aaff35abfb-20220819 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=YpRbRVBLkqzl1b62uqNn9VuCM+iGJc4FQWU8AqeBq04=; b=G2o7yH73+r79LKqtm2B6nbXuwP91YQtEHkdMDM6JOWow31Z/F7g2L3BEYV1CCDDcBK3Pt/La3PQ2W+ZrZdk6Q7U4Y7oqX9a546pVDTRj5SyTUyjZ/aHwBQQCQuH1YOglp58dF98zj5y0aRh+cCDk2peBS5xtL1ZXN4hdU5biaAc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:8ab6865c-4d67-4a22-9c5c-275523823b4b,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_ Ham,ACTION:release,TS:0 X-CID-META: VersionHash:84eae18,CLOUDID:0f7db667-a9d9-4672-a3c8-12721739a220,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File: nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: c8b20dcc9a674d25983857aaff35abfb-20220819 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 69145874; Fri, 19 Aug 2022 02:14:21 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Fri, 19 Aug 2022 17:13:46 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 19 Aug 2022 17:13:45 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring CC: Chunfeng Yun , Kishon Vijay Abraham I , Krzysztof Kozlowski , Matthias Brugger , , , , , , Eddie Hung Subject: [PATCH 2/7] dt-bindings: phy: mediatek,tphy: add property to set pre-emphasis Date: Fri, 19 Aug 2022 17:13:39 +0800 Message-ID: <20220819091344.2274-2-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819091344.2274-1-chunfeng.yun@mediatek.com> References: <20220819091344.2274-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220819_021425_593342_675A8C07 X-CRM114-Status: UNSURE ( 7.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a property to set usb2 phy's pre-emphasis. Signed-off-by: Chunfeng Yun --- Documentation/devicetree/bindings/phy/mediatek,tphy.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml index 848edfb1f677..aee2f3027371 100644 --- a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml +++ b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml @@ -219,6 +219,13 @@ patternProperties: minimum: 1 maximum: 15 + mediatek,pre-emphasis: + description: + The selection of pre-emphasis (U2 phy) + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 3 + mediatek,bc12: description: Specify the flag to enable BC1.2 if support it From patchwork Fri Aug 19 09:13:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12948681 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 39E60C32771 for ; Fri, 19 Aug 2022 10:15:50 +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=HTwD8UzEcnQnDJKqyFd/AV5e0ufNj4Sjet8nlLOLrR8=; b=3mwRnOhdUadKdQ uwR+8JJXacXlcWE5JfMWSuQGA5FZXFH8B5KlL+TScp8/k5NU93ioyOYFapqt58qF0d0o3RPuXzIbm tx8DTo1mwYEPs3pBWuJPAZGpqIZVamQ6sOddSL6foviakg/02mYTR+x35m5CwzgERwq0kisuxGkfR gL+oKL0a/bhG2/0fQP+VVdCK1sP+skxWvkk8cjv3WbpUqPOx7yLpdJPqMEm4FpRL3/J2Gas+ulO5z MOm8WG7R/vtEQrCRwdxgXMSrYtra1kHM634gXfrlVzEL+0GpSW3gPqAENLAv5ODDgXtExbyhK5Xo3 RRUo0f3QxfowYaHXO70A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOz1M-005XGm-UO; Fri, 19 Aug 2022 10:14:33 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOz1J-005XEg-2e; Fri, 19 Aug 2022 10:14:30 +0000 X-UUID: e44107f262814b5eb75c2caa4b8b9c50-20220819 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=m9Mn/Y5eqL1fhFPMyU3DqaJWhYp9JczK52OrynSvfJU=; b=QvZ3p99bZR3K9hr/XRwGnUqC/Ogg31S10Y2UjSGEYdVJu0RMsePxf8/ua5a7HgkZD97LcVP8LIk4ryI56lC1BOCsOZdqjpykeFyoskRdAUENTMwZkHopyFEJft5GnFkqiuv0vofyAwthd4hCagQecN5+01/J9XT1fLtDt0HalCk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:812cc10a-8cc4-481f-aad8-a48d6cbd9f43,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_ Ham,ACTION:release,TS:0 X-CID-META: VersionHash:84eae18,CLOUDID:6bb234c9-6b09-4f60-bf82-12f039f5d530,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File: nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: e44107f262814b5eb75c2caa4b8b9c50-20220819 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1300949681; Fri, 19 Aug 2022 03:14:25 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 19 Aug 2022 17:13:47 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 19 Aug 2022 17:13:46 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring CC: Chunfeng Yun , Kishon Vijay Abraham I , Krzysztof Kozlowski , Matthias Brugger , , , , , , Eddie Hung Subject: [PATCH 3/7] phy: phy-mtk-tphy: add property to set pre-emphasis Date: Fri, 19 Aug 2022 17:13:40 +0800 Message-ID: <20220819091344.2274-3-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819091344.2274-1-chunfeng.yun@mediatek.com> References: <20220819091344.2274-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220819_031429_168384_F6D85EDB X-CRM114-Status: GOOD ( 10.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a property to set usb2 phy's pre-emphasis, it's disabled by default on some SoCs. Signed-off-by: Chunfeng Yun --- drivers/phy/mediatek/phy-mtk-tphy.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index 8ee7682b8e93..986fde0f63a0 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -72,6 +72,8 @@ #define PA5_RG_U2_HS_100U_U3_EN BIT(11) #define U3P_USBPHYACR6 0x018 +#define PA6_RG_U2_PRE_EMP GENMASK(31, 30) +#define PA6_RG_U2_PRE_EMP_VAL(x) ((0x3 & (x)) << 30) #define PA6_RG_U2_BC11_SW_EN BIT(23) #define PA6_RG_U2_OTG_VBUSCMP_EN BIT(20) #define PA6_RG_U2_DISCTH GENMASK(7, 4) @@ -370,6 +372,7 @@ struct mtk_phy_instance { int eye_term; int intr; int discth; + int pre_emphasis; bool bc12_en; }; @@ -841,10 +844,13 @@ static void phy_parse_property(struct mtk_tphy *tphy, &instance->intr); device_property_read_u32(dev, "mediatek,discth", &instance->discth); + device_property_read_u32(dev, "mediatek,pre-emphasis", + &instance->pre_emphasis); dev_dbg(dev, "bc12:%d, src:%d, vrt:%d, term:%d, intr:%d, disc:%d\n", instance->bc12_en, instance->eye_src, instance->eye_vrt, instance->eye_term, instance->intr, instance->discth); + dev_dbg(dev, "pre-emp:%d\n", instance->pre_emphasis); } static void u2_phy_props_set(struct mtk_tphy *tphy, @@ -875,6 +881,10 @@ static void u2_phy_props_set(struct mtk_tphy *tphy, if (instance->discth) mtk_phy_update_bits(com + U3P_USBPHYACR6, PA6_RG_U2_DISCTH, PA6_RG_U2_DISCTH_VAL(instance->discth)); + + if (instance->pre_emphasis) + mtk_phy_update_bits(com + U3P_USBPHYACR6, PA6_RG_U2_PRE_EMP, + PA6_RG_U2_PRE_EMP_VAL(instance->pre_emphasis)); } /* type switch for usb3/pcie/sgmii/sata */ From patchwork Fri Aug 19 09:13:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12948587 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 4A39BC28B2B for ; Fri, 19 Aug 2022 09:16:53 +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=qmz/i01PXro/y+yAKoX+IwbHI1iO5OvkV0xrimrwuIQ=; b=RsC6Zc1RhmRNVl NRhoVJr4uhL1dCQ+HCHvTLyHBeEzTJFkI512uAFeE16VNm8fWQlxahTw7IWihZBrY3tTcd2vL8XgW aucJVtj7Qpi1y3FHZGV+YwfZBkt/f/X9WyWuiJ//yxQ5sNZ6Xlmks2tkvnlfLdb8yG68zPMKcEnjT yaB7fU00QZp/SyC6TASblKmC6Xjssd6jWs9LwePpRCNg2urEfMAHtMvg4H7u8KhrSC9usjBpfXPLV aS/2oenXhuW9TBIkHhImH3s1/JyaqngSEvhy0G2640xDK7eZxGnINzbTfqWawl6uPL7/VbZ/IIFHg fxPI0nZTM0UKURhTOTtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy6T-004kJw-JL; Fri, 19 Aug 2022 09:15:45 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy5B-004j6F-WF; Fri, 19 Aug 2022 09:14:28 +0000 X-UUID: 5ee198a145564574bd1824cb7fd49201-20220819 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=tS6CZCBjUbOc1UZ92WKOWil7JFSb8J7Du3g9c10m3yA=; b=OHIgAhQcj43bNiCvufA3X/m94mgZNyQqu64dP3z3vhl+JWDb/pAyzuPms+BPzNaKP17zoLC6eEojdtyNZIRcWo48h8awiFE9Oqw2QmtdVkUwtXYKbFwyhmaqX3v9r2TanJXk9n12Xzz2HvnPI288Yv6i5HkKDAJPWqAIsp7z6dM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:c990414e-d655-4a43-8246-7740f7a48dd5,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_ Ham,ACTION:release,TS:0 X-CID-META: VersionHash:84eae18,CLOUDID:2e7db667-a9d9-4672-a3c8-12721739a220,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File: nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 5ee198a145564574bd1824cb7fd49201-20220819 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1431961805; Fri, 19 Aug 2022 02:14:20 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 19 Aug 2022 17:13:48 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 19 Aug 2022 17:13:47 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring CC: Chunfeng Yun , Kishon Vijay Abraham I , Krzysztof Kozlowski , Matthias Brugger , , , , , , Eddie Hung Subject: [PATCH 4/7] phy: phy-mtk-tphy: disable hardware efuse when set INTR Date: Fri, 19 Aug 2022 17:13:41 +0800 Message-ID: <20220819091344.2274-4-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819091344.2274-1-chunfeng.yun@mediatek.com> References: <20220819091344.2274-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220819_021426_106416_79DCB85A X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org INTR's value is able autoload from hardware efuse by default, when software tries to update its value, should disable hardware efuse firstly. Signed-off-by: Chunfeng Yun --- drivers/phy/mediatek/phy-mtk-tphy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index 986fde0f63a0..7f40b8b052bd 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -874,9 +874,14 @@ static void u2_phy_props_set(struct mtk_tphy *tphy, mtk_phy_update_bits(com + U3P_USBPHYACR1, PA1_RG_TERM_SEL, PA1_RG_TERM_SEL_VAL(instance->eye_term)); - if (instance->intr) + if (instance->intr) { + if (u2_banks->misc) + mtk_phy_set_bits(u2_banks->misc + U3P_MISC_REG1, + MR1_EFUSE_AUTO_LOAD_DIS); + mtk_phy_update_bits(com + U3P_USBPHYACR1, PA1_RG_INTR_CAL, PA1_RG_INTR_CAL_VAL(instance->intr)); + } if (instance->discth) mtk_phy_update_bits(com + U3P_USBPHYACR6, PA6_RG_U2_DISCTH, From patchwork Fri Aug 19 09:13:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12948586 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 38461C28B2B for ; Fri, 19 Aug 2022 09:16:28 +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=ddTlbKNkShp5LhhkmGrE629vDOXHYZvk/3Zw5vgqm9c=; b=rqtIRAnS9EpxME oa9G4i39VAlZWzD+ptn5bZhjmrqu47hNzgu+t7MT0o7iz0cxNfH5SOYAOA8D1D0C4ms5KLxsJu1kI peUqckAARongpqVdZrL4Y0w57GJmmLiEMu8cl8sMnKzDq14/5il5+yn6DxtvxbQgLYM5RsXuWNKF/ zihMp9vIPfrxYcSvRElbrUqVpHwv8AUoq8v0RQiRtKWHIVSlCudYW2cN/RHo4sImNkA0c2sZ96Ywj 8eufEoHg/Ico8Qv8JBWZJ7S/UPgex3ZnYioJfJav6pfix+VY7UxLETGLea5MFX8IR5Wi3nilpILFa qdoR0oPvXqw0dNntD2ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy67-004jz4-Gt; Fri, 19 Aug 2022 09:15:23 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy5D-004j98-3H; Fri, 19 Aug 2022 09:14:28 +0000 X-UUID: e3fbafb58cf74ac28bfa8ee48b216291-20220819 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=q6s6R/M3t6AahZ3ncr+Mey3ck5xIFT6X1vBjwMFg54s=; b=fuE5rvT836SSRAKwvQaix9yp8DXojh+4oj2bYEkkDry+d3brZ62mw/CtMtFeBxkBGUOZvsP+YGjK6TMqx9WktxVmlCJCD2IrsBnj1/9SxD3tgh+uTzP75f8RW/p3U7KiWlZXEhwaVJZPCB9885kTMd+bhb6Gn+EkU5MWTDhrjho=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:63273fe3-e82b-4c0b-a52d-fde52fda06e3,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release _Ham,ACTION:release,TS:-5 X-CID-META: VersionHash:84eae18,CLOUDID:307db667-a9d9-4672-a3c8-12721739a220,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File: nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: e3fbafb58cf74ac28bfa8ee48b216291-20220819 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 574373448; Fri, 19 Aug 2022 02:14:21 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 19 Aug 2022 17:13:49 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 19 Aug 2022 17:13:48 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring CC: Chunfeng Yun , Kishon Vijay Abraham I , Krzysztof Kozlowski , Matthias Brugger , , , , , , Eddie Hung Subject: [PATCH 5/7] phy: phy-mtk-tphy: disable gpio mode for all usb2 phys Date: Fri, 19 Aug 2022 17:13:42 +0800 Message-ID: <20220819091344.2274-5-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819091344.2274-1-chunfeng.yun@mediatek.com> References: <20220819091344.2274-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220819_021427_207409_8C866365 X-CRM114-Status: UNSURE ( 9.39 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Disable DP/DM's GPIO mode for all usb2 phy, not only for the first usb2 phy which usually supports dual-role mode. Signed-off-by: Chunfeng Yun --- drivers/phy/mediatek/phy-mtk-tphy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index 7f40b8b052bd..79920c066e59 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -532,8 +532,7 @@ static void u2_phy_instance_init(struct mtk_tphy *tphy, /* disable switch 100uA current to SSUSB */ mtk_phy_clear_bits(com + U3P_USBPHYACR5, PA5_RG_U2_HS_100U_U3_EN); - if (!index) - mtk_phy_clear_bits(com + U3P_U2PHYACR4, P2C_U2_GPIO_CTR_MSK); + mtk_phy_clear_bits(com + U3P_U2PHYACR4, P2C_U2_GPIO_CTR_MSK); if (tphy->pdata->avoid_rx_sen_degradation) { if (!index) { From patchwork Fri Aug 19 09:13:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12948601 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 D2306C25B0E for ; Fri, 19 Aug 2022 09:17:29 +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=JJndwxllOCU/AvIUPu1mQl5SHif0Mk8EHeDYcv4outs=; b=WjZ94yTg7Wec0F LSPoiVc8U3L2qKjhkC8yM7gEzjx/AbT5ar++v5JqvXG9DEXbkFoXU6gX/4GNvjJFiEbwOiKEYfxCY 6/Vhqkv9sxe7rNJmSTwN4HKhXZA1F5uYhQ6RNStCJUA35cvv+yBfIgQAi5ZaQihmmKlDf0w/JABfx 5N+MsFpXW7vv9efCW1NgUDQa9ebtPOYC/+i8gMvecEzaT7MUBasZNj7nXWoIpVrWwolN2S5mDPLGd yeEn1HlhQSb8kXkNM0tdtlRkUvydlUR0vbL9Rar1p1WOqH0WTXBhz4jRwRxQJ3i+eyYtsB9aHSxfT Hz4dCDtJWHlr/E8DfqDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy72-004kn5-2A; Fri, 19 Aug 2022 09:16:20 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy5E-004jAf-2a; Fri, 19 Aug 2022 09:14:30 +0000 X-UUID: 2acc9ba253c94e25b7ed56514df83185-20220819 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=lzuHN2o0PHCxOlCMC5PyS2eGduyQugC541Kw8Hzkdso=; b=K73hn0vIol3GnwNvFZnyAp8pNlOXg0dTG25T919vti/sA0dqT4J8vKdX9i5P40SbmBZuJpoE4Tne02FAzXPmXUwAiR/6Z7Gi4dtcGpGwZdinMKLrF5Qa1GgdEBwFQtFkWnFYkHRkiYDBLDr/KPoI5rjp07TRyQkTFl1t/BNgTH8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:0728dea7-5ff8-4c55-8bcd-1e3a3a3a7c9f,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_ Ham,ACTION:release,TS:0 X-CID-META: VersionHash:84eae18,CLOUDID:e72b33c9-6b09-4f60-bf82-12f039f5d530,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File: nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 2acc9ba253c94e25b7ed56514df83185-20220819 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1230218345; Fri, 19 Aug 2022 02:14:22 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 19 Aug 2022 17:13:49 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 19 Aug 2022 17:13:49 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring CC: Chunfeng Yun , Kishon Vijay Abraham I , Krzysztof Kozlowski , Matthias Brugger , , , , , , Eddie Hung Subject: [PATCH 6/7] phy: phy-mtk-tphy: set utmi 0 register in init() ops Date: Fri, 19 Aug 2022 17:13:43 +0800 Message-ID: <20220819091344.2274-6-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819091344.2274-1-chunfeng.yun@mediatek.com> References: <20220819091344.2274-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220819_021428_204871_37BA9237 X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org No need repeat to clear utmi 0 register in ->power_on() and ->power_off(), just do it in ->init() Signed-off-by: Chunfeng Yun --- drivers/phy/mediatek/phy-mtk-tphy.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index 79920c066e59..e0f227a0d3cc 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -522,8 +522,8 @@ static void u2_phy_instance_init(struct mtk_tphy *tphy, /* switch to USB function, and enable usb pll */ mtk_phy_clear_bits(com + U3P_U2PHYDTM0, P2C_FORCE_UART_EN | P2C_FORCE_SUSPENDM); - mtk_phy_update_bits(com + U3P_U2PHYDTM0, P2C_RG_XCVRSEL | P2C_RG_DATAIN, - P2C_RG_XCVRSEL_VAL(1) | P2C_RG_DATAIN_VAL(0)); + mtk_phy_clear_bits(com + U3P_U2PHYDTM0, + P2C_RG_XCVRSEL | P2C_RG_DATAIN | P2C_DTM0_PART_MASK); mtk_phy_clear_bits(com + U3P_U2PHYDTM1, P2C_RG_UART_EN); @@ -565,9 +565,6 @@ static void u2_phy_instance_power_on(struct mtk_tphy *tphy, void __iomem *com = u2_banks->com; u32 index = instance->index; - mtk_phy_clear_bits(com + U3P_U2PHYDTM0, - P2C_RG_XCVRSEL | P2C_RG_DATAIN | P2C_DTM0_PART_MASK); - /* OTG Enable */ mtk_phy_set_bits(com + U3P_USBPHYACR6, PA6_RG_U2_OTG_VBUSCMP_EN); @@ -590,8 +587,6 @@ static void u2_phy_instance_power_off(struct mtk_tphy *tphy, void __iomem *com = u2_banks->com; u32 index = instance->index; - mtk_phy_clear_bits(com + U3P_U2PHYDTM0, P2C_RG_XCVRSEL | P2C_RG_DATAIN); - /* OTG Disable */ mtk_phy_clear_bits(com + U3P_USBPHYACR6, PA6_RG_U2_OTG_VBUSCMP_EN); From patchwork Fri Aug 19 09:13:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12948585 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 5AAD3C25B0E for ; Fri, 19 Aug 2022 09:16:14 +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=sZY67nmsPajP8yEvoVGiCnb2hhaBCa6E9Fn4s10MAlE=; b=sLUJeeS5Z+dij5 JbSELNCpovF35jxDcutl5U66w+yMF02WZr6/LJpglZis8jTfB3lixHqjFhFb0Ij8GEDmYXKV6WLH0 gJ4KF1aWjg2vVYwmcXMNeTD7FUSCcLxPIPYnvs8OIT2bsNMpbvuAMbNpnV8RyKk7VV+mwDlKhi6j6 9UJTMKEUHflAlpSc+gOw2RhgJEm9o1bqPk7Pm9Xl/Xd5dzUhX0r+0lgJ2hrCOlnPCkRc0aIEbjPY4 6vBEa8ILL56YUThGyjZKBYXg9+uvPmZFy57J6Yz+QEUXRnNubkTR6gca9ZcOCZV+OuTqBtQ2QD9YM umcTnm1XcZET1SV71oMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy5s-004job-CV; Fri, 19 Aug 2022 09:15:08 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOy5B-004j3u-Fj; Fri, 19 Aug 2022 09:14:26 +0000 X-UUID: d5e8cc1ab357475ab24e32bfaa73317f-20220819 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=w8qy4e70fA8fi5hbYN1bbBy3SRJLsnHUumQc0DFXM8w=; b=Hd86rLwRpBnNr/wVBh3RhAICyqbAP1asLKnbOX/sRYbAGaQyO/RQzWmYLo1G2nfTwGnr4HbFPZG05Z8zpwNSvlCEBp5oQJtEBcaap00JtVcAmTXywcBi1bmiXKGeLNox3cP1ZjNWCSaNB8iQeFhwpeVg1x3eG2qiX9n7w3900Y0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:fba0dd71-d61b-44fb-a55b-3d64467c227e,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_ Ham,ACTION:release,TS:0 X-CID-META: VersionHash:84eae18,CLOUDID:7b0b04cf-20bd-4e5e-ace8-00692b7ab380,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File: nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: d5e8cc1ab357475ab24e32bfaa73317f-20220819 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1529091677; Fri, 19 Aug 2022 02:14:22 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Fri, 19 Aug 2022 17:13:50 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 19 Aug 2022 17:13:49 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring CC: Chunfeng Yun , Kishon Vijay Abraham I , Krzysztof Kozlowski , Matthias Brugger , , , , , , Eddie Hung Subject: [PATCH 7/7] phy: phy-mtk-tphy: fix the phy type setting issue Date: Fri, 19 Aug 2022 17:13:44 +0800 Message-ID: <20220819091344.2274-7-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819091344.2274-1-chunfeng.yun@mediatek.com> References: <20220819091344.2274-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220819_021425_575506_6562AC0E X-CRM114-Status: UNSURE ( 9.65 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The PHY type is not set if the index is non zero, prepare type value according to the index, like as mask value. Signed-off-by: Chunfeng Yun --- drivers/phy/mediatek/phy-mtk-tphy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index e0f227a0d3cc..cc10298bc70d 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -915,7 +915,7 @@ static int phy_type_syscon_get(struct mtk_phy_instance *instance, static int phy_type_set(struct mtk_phy_instance *instance) { int type; - u32 mask; + u32 offset; if (!instance->type_sw) return 0; @@ -938,8 +938,9 @@ static int phy_type_set(struct mtk_phy_instance *instance) return 0; } - mask = RG_PHY_SW_TYPE << (instance->type_sw_index * BITS_PER_BYTE); - regmap_update_bits(instance->type_sw, instance->type_sw_reg, mask, type); + offset = instance->type_sw_index * BITS_PER_BYTE; + regmap_update_bits(instance->type_sw, instance->type_sw_reg, + RG_PHY_SW_TYPE << offset, type << offset); return 0; }