From patchwork Tue Dec 14 23:34:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12676939 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 F27FCC433EF for ; Tue, 14 Dec 2021 23:34:49 +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=5I7ZsJhtIa3a2mGLxNG16dOdYFc++RJPy46rl4gUQHA=; b=X2P9daNkLYKKB1 BjS1UtnwOoaFZl8BGdjmEzPuwG3PQiTRgqAjQKOMNIFkq+Wl8tT0T4XILk6H21Jkwulcu2VHmSy8M 1kqKMuhakJeF4dhNepcrYo/m40eQQ78bqEARIchLx34qjhJNZi24le0MFakMnrnNdJS7PHo1eT4OP X6L5k6zqxYW3aPytOs+smXQnyZA3d0VkWkBHrtE4lVvrmg/Rf6sJ+URGEYs1jxpxdr9gwkQf/JRl9 kNpZ4zXL+HsWBsZo3vJ7heOO00xyPmgweRZdybyWNIXcwyhAVHYmpP4wjyuWfTBhan38REkxaO/sP SCrRAtib7Ax+ImbwwlQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxHJp-00G1s9-DJ; Tue, 14 Dec 2021 23:34:49 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxHJm-00G1r2-5u for linux-phy@lists.infradead.org; Tue, 14 Dec 2021 23:34:48 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E1318B81B3B; Tue, 14 Dec 2021 23:34:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E5A3C34600; Tue, 14 Dec 2021 23:34:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639524883; bh=6dXrC0FdP3B7Ezq06gX3Eh2HgFGakgLcBGUR+xmwRJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDUAediloFuCmcB9BNlhg5n0N1FHNME3+vDj6IfDmNGTx3CXxpawQ5sHfQnc2nA3t 031Dm6ivnTlc9z0ghNmir0dw602lSydMwo3Jj7mT6myPNvQ23mVB9E2yq99wEAUYa3 rq+jj9yTF1FrinGx0NanIEIY2akkclnQqPxPLMEXy/GtsbPAUV/rdNODjhoR4NO4Tm KHBTAeZLapyZ/cvwx1jXJtTUL6ut7HaIlHqe6UuhDE20PBBqFLclm4W0YCtMj3ZiyC qBt8j6QkTND9yE64RZOV0UhZZoDZPK89OiLbUArpOgWuropPGZkL2DzIpxtyrIW8zr q1khD+mYfSluQ== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Rob Herring , devicetree@vger.kernel.org Cc: Vladimir Oltean , Holger Brunck , Andrew Lunn , "netdev@vger.kernel.org" , Russell King , linux-phy@lists.infradead.org, Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH devicetree 2/2] dt-bindings: phy: Add `tx-amplitude-microvolt` property binding Date: Wed, 15 Dec 2021 00:34:32 +0100 Message-Id: <20211214233432.22580-3-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211214233432.22580-1-kabel@kernel.org> References: <20211214233432.22580-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211214_153446_530950_C60B9F2E X-CRM114-Status: GOOD ( 13.72 ) 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 Common PHYs often have the possibility to specify peak-to-peak voltage on the differential pair - the default voltage sometimes needs to be changed for a particular board. Add properties `tx-amplitude-microvolt` and `tx-amplitude-microvolt-names` for this purpose. The second property is needed to specify Example usage with only one voltage (it will be used for all supported PHY modes, the `tx-amplitude-microvolt-names` property is not needed in this case): tx-amplitude-microvolt = <915000>; Example usage with voltages for multiple modes: tx-amplitude-microvolt = <915000>, <1100000>, <1200000>; tx-amplitude-microvolt-names = "2500base-x", "usb", "pcie"; Signed-off-by: Marek BehĂșn --- I wanted to constrain the values allowed in the `tx-amplitude-microvolt-names` property to: - ethernet SerDes modes (sgmii, qsgmii, 10gbase-r, 2500base-x, ...) - PCIe modes (pattern: ^pcie[1-6]?$) - USB modes (pattern: ^usb((-host|-device|-otg)?-(ls|fs|hs|ss|ss\+|4))?$) - DisplayPort modes (pattern: ^dp(-rbr|-hbr[23]?|-uhbr-(10|13.5|20))?$) - Camera modes (mipi-dphy, mipi-dphy-univ, mipi-dphy-v2.5-univ) - Storage modes (sata, ufs-hs, ufs-hs-a, ufs-hs-b) But was unable to. The '-names' suffix implies string-array type, and string-array type does not allow to specify a type for all items in a simple way, i.e.: items: enum: - sgmii - sata - usb ... Such constraint does work when changing ethernet controller's `phy-connection-type` to array, see https://lore.kernel.org/netdev/20211123164027.15618-2-kabel@kernel.org/ But it seems that string-array type prohibits this. --- .../devicetree/bindings/phy/phy.yaml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/phy.yaml b/Documentation/devicetree/bindings/phy/phy.yaml index a5b6b04cff5b..8915065cf6c2 100644 --- a/Documentation/devicetree/bindings/phy/phy.yaml +++ b/Documentation/devicetree/bindings/phy/phy.yaml @@ -31,9 +31,29 @@ properties: Phandle to a regulator that provides power to the PHY. This regulator will be managed during the PHY power on/off sequence. + tx-amplitude-microvolt: + description: + Transmit amplitude voltages in microvolts, peak-to-peak. If this property + contains multiple values for various PHY modes, the + 'tx-amplitude-microvolt-names' property must be provided and contain + corresponding mode names. + + tx-amplitude-microvolt-names: + description: | + Names of the modes corresponding to voltages in the + 'tx-amplitude-microvolt' property. Required only if multiple voltages + are provided. + + If a value of 'default' is provided, the system should use it for any PHY + mode that is otherwise not defined here. If 'default' is not provided, the + system should use manufacturer default value. + required: - '#phy-cells' +dependencies: + tx-amplitude-microvolt-names: [ tx-amplitude-microvolt ] + additionalProperties: true examples: @@ -46,6 +66,8 @@ examples: phy: phy { #phy-cells = <1>; phy-supply = <&phy_regulator>; + tx-amplitude-microvolt = <915000>, <1100000>, <1200000>; + tx-amplitude-microvolt-names = "2500base-x", "usb-hs", "usb-ss"; }; ethernet-controller {