From patchwork Sat Feb 15 09:44:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 13976003 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 B9899C021A6 for ; Sat, 15 Feb 2025 09:55:59 +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=tEu7QkFOuTlLZCm0Csm1DWGOBvn4uDgYyUIn3ahVfnI=; b=Y7iBIUIoo7jrmH wNo12tY4BPeUL5NQMfupIh/3dq5FVNLUPcLW+odTi1iFzrL104KR2FzUYUjISoZwrwHOjgAYPJmeu mygKUpx6VA0NoWNe12VaIWBCTP7POa838k3Se8YIzDuqaS3ueJn5GdBWqeoomORhlLn4ko9uocogi NWy7TruAqeVORoyopUEr3W3QJemUr+bQfWeD3+uz6MF5MEVdSXcpQyWqdA5gM+3wOy5X5GFfHQk0p HlT1PXHKm37xRPepFhVIsZycR5kRVEcw9244nEOmF46Ae//PA2dGZHmy94RKAgi3wLbUaEHUTw123 4wKwmrieLhlKAXZqbURA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tjEtz-0000000HNrV-24AO; Sat, 15 Feb 2025 09:55:59 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tjEil-0000000HMQH-0mTv; Sat, 15 Feb 2025 09:44:24 +0000 X-UUID: 6b541cf2eb8111ef9048ed6ed365623b-20250215 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=lylOz1zkmHmL7bwHexXM/NNT7naRcFl+fFhZuU5zA5I=; b=u2Qxo6sZW0Z/9ifk8xQwNUQX+XtjAWN9uTMiABNzPeGFy/PL2SQZa7Rkj8biNZNx/V+pub/61f5Nc4ybEiqlMbXX7BLG5M/RdrUQ85F6HFW0j7X4nXv8AeLhJcanl0oN5rEu2RyEJiTQA4+z0uUsSoVASAn8dM1S0nOT+S2C5QQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.46,REQID:3ac62189-6d67-4391-84f6-61eee27807fe,IP:0,U RL: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:60aa074,CLOUDID:c1f9cb24-96bd-4ac5-8f2e-15aa1ef9defa,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0|50,EDM:-3,IP:ni l,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES :1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 6b541cf2eb8111ef9048ed6ed365623b-20250215 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1358691196; Sat, 15 Feb 2025 02:44:15 -0700 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Sat, 15 Feb 2025 17:44:12 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1258.28 via Frontend Transport; Sat, 15 Feb 2025 17:44:12 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring CC: Chunfeng Yun , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , , , , , Subject: [PATCH v2 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold Date: Sat, 15 Feb 2025 17:44:09 +0800 Message-ID: <20250215094410.547-1-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250215_014423_236900_55045D7E X-CRM114-Status: UNSURE ( 6.95 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add a property to tune usb2 phy's disconnect threshold. And add a compatible for mt8196. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chunfeng Yun --- v2: add Reviewed by Angelo --- Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml index a9e3139fd421..2e012d5e1da1 100644 --- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml @@ -49,6 +49,7 @@ properties: - enum: - mediatek,mt3611-xsphy - mediatek,mt3612-xsphy + - mediatek,mt8196-xsphy - const: mediatek,xsphy reg: @@ -129,6 +130,13 @@ patternProperties: minimum: 1 maximum: 7 + mediatek,discth: + description: + The selection of disconnect threshold (U2 phy) + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 15 + mediatek,efuse-intr: description: The selection of Internal Resistor (U2/U3 phy) From patchwork Sat Feb 15 09:44:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 13976005 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 2C20AC021A0 for ; Sat, 15 Feb 2025 09:57: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=4aBG4z5xoHqwPePNOtIydwaRZlO0m6rsdGussa3Vdo4=; b=v7PIVGZf8gl2lc i7+5o7mArZW/+ZH2ooKDWvL35OByqPi9Q7M0enAm/B7jmZPOBvgMAeEW3f3CL3ziBy0b/m1QsTFHO Fmvzc4BbQvu8JHV23psA9EgHhYKQoDrvHXhdrJ3zsquH9EAdtj2lsR5lhdS4jhr6CvN+O24jyb+FR lZuuq/qLmc/vjXdWF+nsHa+Z/dif7PzXBfMkSl9LZVVNZuU8d4FE402Iv2v5XBXfcNJiAF+kIXPI6 ++5ePXzRJeDY1LcHzilwfSqdPE1vsvlT8O7KScoRY/GiOtAV/p6XteadTQEutpbIzJgFglkvwJ6C2 jlhjzQo148LxQPdQjGVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tjEvP-0000000HOAz-3sml; Sat, 15 Feb 2025 09:57:27 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tjEil-0000000HMQO-2ei7; Sat, 15 Feb 2025 09:44:24 +0000 X-UUID: 6bc59bf2eb8111ef9048ed6ed365623b-20250215 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=1XRwV3v0Pr5UX8e3+ENacWcRYH9cJyzTBU7O5dVKwSQ=; b=lvUyxxqzUNF5OQ2JPAvIfyScN8AnxyZfaImVuHKTe8xQ7xxXV62akasdkmVhkpm2PEVD4SoQDseQsL5FglUfHHde9sKrHSgi3F2121Du8j6x7zG/LFb5nsT9iivcQkPcqWgGkbAQvvW3PomCSe6TfILt520p0M/nA9VWnLWrMYA=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.46,REQID:7e65528c-826c-431f-bd0d-66b9496698b2,IP:0,U RL: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:60aa074,CLOUDID:c2f9cb24-96bd-4ac5-8f2e-15aa1ef9defa,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:81|82|102,TC:nil,Content:0|50,EDM:-3 ,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV :0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 6bc59bf2eb8111ef9048ed6ed365623b-20250215 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1030995723; Sat, 15 Feb 2025 02:44:16 -0700 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Sat, 15 Feb 2025 17:44:13 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1258.28 via Frontend Transport; Sat, 15 Feb 2025 17:44:13 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring CC: Chunfeng Yun , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , , , , , Subject: [PATCH v2 2/2] phy: mediatek: xsphy: add support to set disconnect threshold Date: Sat, 15 Feb 2025 17:44:10 +0800 Message-ID: <20250215094410.547-2-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20250215094410.547-1-chunfeng.yun@mediatek.com> References: <20250215094410.547-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-20250215_014423_672019_E6E543FB X-CRM114-Status: GOOD ( 10.16 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add a property to tune usb2 phy's disconnect threshold. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chunfeng Yun --- v2: Add Reviewed by Angelo --- drivers/phy/mediatek/phy-mtk-xsphy.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/phy/mediatek/phy-mtk-xsphy.c b/drivers/phy/mediatek/phy-mtk-xsphy.c index 7c248f5cfca5..718ed8f17c2d 100644 --- a/drivers/phy/mediatek/phy-mtk-xsphy.c +++ b/drivers/phy/mediatek/phy-mtk-xsphy.c @@ -59,6 +59,7 @@ #define XSP_USBPHYACR6 ((SSUSB_SIFSLV_U2PHY_COM) + 0x018) #define P2A6_RG_BC11_SW_EN BIT(23) #define P2A6_RG_OTG_VBUSCMP_EN BIT(20) +#define PA6_RG_U2_DISCTH GENMASK(7, 4) #define XSP_U2PHYDTM1 ((SSUSB_SIFSLV_U2PHY_COM) + 0x06C) #define P2D_FORCE_IDDIG BIT(9) @@ -95,6 +96,7 @@ struct xsphy_instance { int eye_src; int eye_vrt; int eye_term; + int discth; }; struct mtk_xsphy { @@ -244,9 +246,12 @@ static void phy_parse_property(struct mtk_xsphy *xsphy, &inst->eye_vrt); device_property_read_u32(dev, "mediatek,eye-term", &inst->eye_term); - dev_dbg(dev, "intr:%d, src:%d, vrt:%d, term:%d\n", + device_property_read_u32(dev, "mediatek,discth", + &inst->discth); + dev_dbg(dev, "intr:%d, src:%d, vrt:%d, term:%d, discth:%d\n", inst->efuse_intr, inst->eye_src, - inst->eye_vrt, inst->eye_term); + inst->eye_vrt, inst->eye_term, + inst->discth); break; case PHY_TYPE_USB3: device_property_read_u32(dev, "mediatek,efuse-intr", @@ -285,6 +290,9 @@ static void u2_phy_props_set(struct mtk_xsphy *xsphy, if (inst->eye_term) mtk_phy_update_field(pbase + XSP_USBPHYACR1, P2A1_RG_TERM_SEL, inst->eye_term); + if (inst->discth) + mtk_phy_update_field(pbase + XSP_USBPHYACR6, PA6_RG_U2_DISCTH, + inst->discth); } static void u3_phy_props_set(struct mtk_xsphy *xsphy,