From patchwork Thu Dec 7 10:52:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13483131 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 7E3D4C4167B for ; Thu, 7 Dec 2023 10:53:09 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kB1xA53ZhrTahVjS7kxb4YmnRVNVMiSPP5o7zvBcVV0=; b=WX3K0BkGyjh95P dydO57SlVz/SDPZjsV8c1giyFkGyAMHakwxHuo86sQNyrLv+S2WEed9o2ObVN+i2Gkz6K+vx8+lBO Mgqx5o6QQpaHI6scjUXHKoJrGp/lNI+b6kxglcvy9nCqE+MEgupHU4ygsz9rHaATN6tPR7hSXZHIj zVlSjhEaT3Dv8QGNd/a00LR3EPvzlQ9N5HW8xQx670aGxpGCfIfpbaHFmJ0GXIsJWBOBEohD4guN9 ytLaR/I/FKv1liU4ADlr2kicDFwmFfburbboJT/BWiYIXMudHStKbylDYH6Vm4/KyrzkPogsONZ98 +s8gBr/5bbPeXAiDfXhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rBC0C-00CW0F-32; Thu, 07 Dec 2023 10:53:08 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rBC09-00CVz3-38 for linux-phy@lists.infradead.org; Thu, 07 Dec 2023 10:53:07 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40c09dfd82aso11298975e9.0 for ; Thu, 07 Dec 2023 02:53:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701946382; x=1702551182; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DzAkdCe8GmigS9meJGB6RLFDC8CgmK6hEzQqiVyayPM=; b=J9h9HNEW+kI81dzEfM5G33Te0Vz4fwF1+KaydMRAUD3HmlG7vdjLiexKc1GiwbS5oY fFrRyT1lU9it3SbdVmpVj2R9UPuXheN+pclJj/hhDfpMvVxuzHpuHjE91tBSJrvQvC9e nqK9d5/Gw0Jwo99YLgoGdTH3jhfehYCxBaU/GJ2SPFYKO2JNoIu067jEYR8ZfiJW9VcQ aKI1lWn4T6qCX6920RFMaQNT1ugbbEgea+FfuiZuxv/YDZ67zeZDifi72C1a1su0wGw5 roLbeq2KnMkWvaYEl/t5jKqSpPWhg6+NdoowtBRCROzxWIpCYwVQarkUSbFwLRd1nCFS +Afg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701946382; x=1702551182; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DzAkdCe8GmigS9meJGB6RLFDC8CgmK6hEzQqiVyayPM=; b=dJPxAFyHgcxgIcek7smloWdYxuyYcG7MHkiTxByIlv2D3hITxYJd7tPkK/O5Q0MHQj mO0yMXVYY8X4vqIPaOqNEZ/0l3IvF8X3X5b8k+lXBwcqkSq1JLH2FBvg9PF3Aucc2AOI aL1eae6px4L75iY1XO/xz1k5WMZi6lvjHz8a1rQ3xfeS1OES2gpZc8xMKngYmqWpIiKj 3+FhF35T6u4U32IqlPnv1yrcDuHtGccEl7iQ4mrnG1hFgKHEfRAfgQU8tRA1WMdwrRO3 pQaJMvTpcGfXHIQa8g8An5/XMy4GUUX/FyaPsu3fB7TZNku3aM0Hgab/y/C+zUfFgQy+ BtHA== X-Gm-Message-State: AOJu0Yz8M3ePI+NhabTBqJfbwMYNCI2dKXnbtOnJn+PSkvRE/1pcojua gcUbzWK7rTMYxjQBCt3ig12J5Q== X-Google-Smtp-Source: AGHT+IHRtGdot/NsE2L3XoU8qXrI4IhdWzOZdCj+ecTyhBAvaBVisMbzzrPQ2/3t11cv8c68fwqI2A== X-Received: by 2002:a05:600c:2901:b0:40c:2699:b625 with SMTP id i1-20020a05600c290100b0040c2699b625mr795852wmd.138.1701946381938; Thu, 07 Dec 2023 02:53:01 -0800 (PST) Received: from [127.0.1.1] ([82.79.186.233]) by smtp.gmail.com with ESMTPSA id k23-20020a1709063e1700b00a1db8b08610sm668700eji.148.2023.12.07.02.53.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 02:53:01 -0800 (PST) From: Abel Vesa Date: Thu, 07 Dec 2023 12:52:48 +0200 Subject: [PATCH v3 1/3] dt-bindings: phy: Add PHY_TYPE_EDP definition MIME-Version: 1.0 Message-Id: <20231122-phy-qualcomm-edp-x1e80100-v3-1-576fc4e9559d@linaro.org> References: <20231122-phy-qualcomm-edp-x1e80100-v3-0-576fc4e9559d@linaro.org> In-Reply-To: <20231122-phy-qualcomm-edp-x1e80100-v3-0-576fc4e9559d@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Abhinav Kumar , Dmitry Baryshkov , Johan Hovold Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Vesa X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=559; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=Hwpu6tM6RD/JKvU7jn8nmPGWlA4+6aqHXvdwplMfgcU=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBlcaQHvtNBoyFoDqGxYZdSuJ7V9rS3o4tMgMa/L /rsakNygxiJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZXGkBwAKCRAbX0TJAJUV Vj/ZEACqcEFqs4X3nCWLQ3UkvPUu21OX6QLZgnucuhOQy2j5+YN5KcFbAopZrh2tFu72hZV0YhZ BKH00j7k1sah0JalC5y+NP4CVfJiptouXa70dSe5DHUDEgsrV4FBEvsL0cuIs9zx2zFyCTF//7A Qzn0quAZeGog51ywahMduGZObO8YbAjMsaBtloLS8bQw7ghNRB8RgihW20v5wjmHGlIJdXuauhM 7umWswF85EQzZ/yQrXRLRnDjomUWC8R6aRsZiJ3e7oeD3MWzki9bniGavuNXJ+fX/6nJyfbx3vs mXbJwTInK/4+jcnb01svlQhMOUf32EMxS9gQH+UWvgZ1VLL4u7WwPa/cu9TnT9p0DGdZUyEg0uj OUMXkD0hRL3yyBGFPV1a51r1huH0+JENQqbnCZHHb4hjtz9AfocmZeTB7XKcLv+mhSGLPT6HRCl BuMeaGdSNmgBV2YKu7BkUEde2flczzvN4tT7+8LH00alp8aoJLaF8GaQ49GCrStIhQ6/S2x0bao tNgQWBYfQQEntMS2UV3o9iBO3w7jVceHxr7gYlCbRuSvrYjcF8lgc+QUMjUq+xnVN/OJBl+9K0O OP3hxaTXJzb0vXwlsWm0enJTJtZfhbm2wbK7V3gMlrd613LJ3FfEl+aDOnTBgYwwkuBp3hrOPZt m/shR67U6aGSMDw== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231207_025306_008219_D0280091 X-CRM114-Status: UNSURE ( 7.90 ) 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 definition for Embedded DisplayPort (eDP) phy type. Signed-off-by: Abel Vesa Acked-by: Krzysztof Kozlowski --- include/dt-bindings/phy/phy.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/dt-bindings/phy/phy.h b/include/dt-bindings/phy/phy.h index 6b901b342348..b1a64508d937 100644 --- a/include/dt-bindings/phy/phy.h +++ b/include/dt-bindings/phy/phy.h @@ -23,5 +23,6 @@ #define PHY_TYPE_DPHY 10 #define PHY_TYPE_CPHY 11 #define PHY_TYPE_USXGMII 12 +#define PHY_TYPE_EDP 13 #endif /* _DT_BINDINGS_PHY */ From patchwork Thu Dec 7 10:52:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13483132 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 849FEC10F05 for ; Thu, 7 Dec 2023 10:53:10 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3v//w9qvGEBJqV4W4ZPNgCaWRyN6E1Msp7OicjRUdcs=; b=4vZv79iC0/xW/U mE2gu4yTZLac5npY2okPXfxXD+/bj0xib6Gdt1Uj3tp2wOjdIiWsEbLKuZ8NTvmIxXo7Mw2yE4sOG JCn2hPp0IYUcKp9JRJwPXbDLhyyosd52mXvj9kqWrbhpgNSGkXBnOxsHGGNdLZd0TZJ1W62t+0YPo Qv3gMc1E2fWEEVfhjyeff4AKe+eA2EoiWkZbSnqHUXZIDUJNaZ8zi7eaWTC3jc9JEaqDa7U2LGcLG 9UP5rRyKBoBqXn9REbCEaEfkUOcpwroZQIn7mMDo/gVZXqoAysBSPrTnMI1fnv+kUSoNG2B5A0cW4 g4/ItrsQjJvEBU0koFNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rBC0E-00CW0g-0s; Thu, 07 Dec 2023 10:53:10 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rBC0A-00CVz7-2t for linux-phy@lists.infradead.org; Thu, 07 Dec 2023 10:53:08 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40a4848c6e1so9975125e9.1 for ; Thu, 07 Dec 2023 02:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701946383; x=1702551183; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=iCKGAHJfEaYYU45TomxL/sg269wwfTen9MuUFIzedOU=; b=GU18cnvBstiOVqPjtBpq2ovBXCOECKUVFP47EmPvg/1S5d2Vc4CkWARjdgFpu/FhAX 8JPmBjYG+k5wD9RN6R3b9ricrztTAyOCNZ2Sg6IN+yAUa7kJBSeGTDxWb3aHj+m2hnO1 CfJ+3SOP/yCe8K8zbc08j+CqkRJg73veS1oPoMIrKXxnxuKCPoTAd+iWQ0H/xcfiG29R JlA1LsVWT+bLKwDlvNbPMB7T5+CLa6dx2EsHdcnpRDHpdlIkawNzMLhrNpexdW9hruZG 4vaJq8J/mbOZF7FiOeoO8Ys3J5raGw7F3CvbMvh/04JEOYnYcC7xJ9pPqO+a2cC3d6Y2 Ub2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701946383; x=1702551183; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iCKGAHJfEaYYU45TomxL/sg269wwfTen9MuUFIzedOU=; b=PUcTVYA0DG8uCFlx2BEA5E9mT3/QqQMImZgzW38SBddwlimSzts+/vlWVKJ45fZNSO 2L1Chuenx0wuevj8rAk/KfGDErclwyGWwP6Dx9NYtr8k6gsMjrmCC1CRjg3VMCN5ipFd 9ibwROpN0CYkwS2D8Z7nRLJhZIE0Hl9Osnqo34L8sBpqqXro6KNpR3o7kiwJv6tHz2WJ Ut8rSalgtqfs3CNQkCZb9tfy/YZ8B3Twme8K2c+ZZfL8V83Eo+0A4peYoPi9emraqTGm cc7OsOfVP0VoMY8KJtF6EpDxbt4Zhk377yicGgtQp7yqs3GXASMvT9yu0C26LQitPagi p2Dw== X-Gm-Message-State: AOJu0YznwS2J9Fp6MmtAz30t/+OIQxJ3eznOyk3TLdOYezZ8e707C7PY GZQ6fem9vRmfjtHAlLmvrx6msw== X-Google-Smtp-Source: AGHT+IHzp202+dB3Xye4NGf/ePFvOipqgiwtZEl7DYCguexNEkmD96JHXS5H76xdHPO11V9lP4BIhA== X-Received: by 2002:a05:600c:1992:b0:40b:5e21:bdd4 with SMTP id t18-20020a05600c199200b0040b5e21bdd4mr1259875wmq.99.1701946383387; Thu, 07 Dec 2023 02:53:03 -0800 (PST) Received: from [127.0.1.1] ([82.79.186.233]) by smtp.gmail.com with ESMTPSA id k23-20020a1709063e1700b00a1db8b08610sm668700eji.148.2023.12.07.02.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 02:53:03 -0800 (PST) From: Abel Vesa Date: Thu, 07 Dec 2023 12:52:49 +0200 Subject: [PATCH v3 2/3] dt-bindings: phy: qcom-edp: Add X1E80100 PHY compatibles MIME-Version: 1.0 Message-Id: <20231122-phy-qualcomm-edp-x1e80100-v3-2-576fc4e9559d@linaro.org> References: <20231122-phy-qualcomm-edp-x1e80100-v3-0-576fc4e9559d@linaro.org> In-Reply-To: <20231122-phy-qualcomm-edp-x1e80100-v3-0-576fc4e9559d@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Abhinav Kumar , Dmitry Baryshkov , Johan Hovold Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Vesa X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1283; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=n8ZqqMAvPtzdcc+WNuLj5kAU8rnzZCEsot/TFJ/D1xs=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBlcaQIB3wgrkjQortdPRoUK1F4EBwZVv4pQXdlr f+C0XZ0PC+JAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZXGkCAAKCRAbX0TJAJUV VpA3EACKl8OPg+nm1ZW8ePqjPuHN9iPzkp9ftIEgCULnE5jiNPXcYOShIVk3qQjpjJxAqsg5qhC sKsQf0Flrdv+ekTWnpf0drw6fhSwxoFq+/S/4JgcGjKW82SBSDDS+5TcwTLUennmVAEEgWOuG5y X4EzeSo/NkuS8wigyzYe5FWsSvvOQV/Ll5vgubC1g+V6Cdzmag7kKxS1OMVzZFh9ik+xbyb1P3j yghxsBadxT2ptRufZDursfZLgAqEQ3qI7yoJ0uRAV8V8TzXG4ZiJ0XZvnJnwtjW+WJNQypnOr/n om+M02nT8fJpMb1A2TEynbg6FIZajiwKqT/1JhfAWb4s1akMq9mFeqNgzdApn3vijHQVfRc2BVW ZahQgnNlieP3VJN1rIVhu9eDU5wY4wiwaWdit6jB9AHU4kculs9eDtx1v8bxMF8K+Sx3QbKBMuQ 89Wb4M037BlNWfEbkeizZu4FOPLdQsFPy9MoErAj7uAJuEm465dxjD1RXUFaNsrNAtsK7BZ/iTf eFM6OOzBlMKpCnMlFVWzaY/aDKVtGzesUzEpl1JeMZ2tLgpy4sJQiy8zqQEuXoj4i6OBsckVVey g4yfFAMP91ShAw6uMxjLb3uMEmD/CfXAruDFmA6RIDGaf0s2RWyDJGQHEggnImHTlS8vlFd1u8I Kf9evD9WPZlo9IQ== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231207_025306_935755_4F8E224A X-CRM114-Status: UNSURE ( 7.17 ) 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 The Qualcomm X1E80100 platform has multiple PHYs that can work in both eDP or DP mode, add compatibles for these. New platforms can use the phy-type property to specify which mode the PHY should be configured in. Signed-off-by: Abel Vesa --- Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml index 6566353f1a02..3341283577ce 100644 --- a/Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml @@ -21,6 +21,7 @@ properties: - qcom,sc8180x-edp-phy - qcom,sc8280xp-dp-phy - qcom,sc8280xp-edp-phy + - qcom,x1e80100-dp-phy reg: items: @@ -59,6 +60,20 @@ required: additionalProperties: false +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,x1e80100-dp-phy + then: + properties: + phy-type: + description: DP (default) or eDP type + enum: [ 6, 13 ] + default: 6 + examples: - | phy@aec2a00 { From patchwork Thu Dec 7 10:52:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13483133 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 DA616C4167B for ; Thu, 7 Dec 2023 10:53:12 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jNk0vEtYfpXd1SA9i9sI/OINkIf+G5O2l681qDWd5uo=; b=oLLB2AGFqcuhdi 610RXmt3g0ihm6gLqJeCxlaBm/X0cHRrL0llB/ZB7XWFlrNjK0a4JdkoHOmNCKNj35Ok6Qx+TN/zv FjXG2BnVCp9+wTzWEGwmqy+zSqVrThocXzBjreojdfTwdxrlF1WU0KjTUHSYdgYjdOwecpMcesSfC ZR9N/dhZ16lcv9n8jVTpguafvELPS3oavMNvzJsXw+o15DPv6wZQcnB5xEm32Rn0l+vIEdZVjPkav 4pzhrl56U2pKPU1lPKs+HkwMO5U7JUdXxS9qqd6efQuZhNZ7kkhf4nb/zEblnVpp9qA8Bd9qza6C8 DansdmIeBkk9gtHZ96pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rBC0G-00CW16-20; Thu, 07 Dec 2023 10:53:12 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rBC0C-00CVzO-2s for linux-phy@lists.infradead.org; Thu, 07 Dec 2023 10:53:11 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a1cdeab6b53so167424466b.1 for ; Thu, 07 Dec 2023 02:53:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701946385; x=1702551185; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7HGtQumyENSvxoSv9yvTghsd1fDswdajFSHTZc++Fwo=; b=JbIUbDhG/5wc9x6AgDUIaHMlX8h4EVHVdMQKnOa0EntdeWhgEp0WgAw4qNWyTPPbPF N/n06CBN5NJ0/Xc6sy9ieg1eXiHNfrnX7tRbiF/siH5T28PjVAFmdSNAQzNYkN9bW2v+ onDjCdR14t/aLihtgytsiZ82zG0HZ4sF1xWf5KVOOTEL4E8jDca6Y3VJFFrfzixwdj0C B7Nyd5UUCX8qaw1pG/WIFT0XZw3qJEc5d8zvKTCSaVx7WxikdqsMSNknwIw9su7xH+ci dHyzRqzlcOSc7+Ja76BGwgajUR/cXUhfFKLyHaDbQPVnX/wL1SRY88Z04SjCKxy0DiZb fLUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701946385; x=1702551185; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7HGtQumyENSvxoSv9yvTghsd1fDswdajFSHTZc++Fwo=; b=SUEIWulxi/6kr9iz60Uhqf2lK9V5C9rVAeN+guvPHoEz8IX0QoOEPxeKg33xS7e7CO g2FuHVsru4PX0dlhPn0wWa2Y6K27Oh8hLLda6l82hmg5L4QzWF9IEsdmsjswPFGY0uAc 8UGdHm3nGwG999HOJ0y1qCqfoaiRt9ed06wf1benTkUOxkoKLb3Immwz9wh1wwmtJUZs BRle1ajFcbH2muanQIxD4PPybFVbWju488ab9WWUTXDN91YBp73vQuFMcmh9jilDXtSM 1HrKLFLzeLiNo/hI+slaHkRBomiIG8yv+x9r1oPvcgsXVPNH2jBxPFcVn4vcP70WKBcZ qZUQ== X-Gm-Message-State: AOJu0YydlygLl6f7yH4dB0d0iyPveBs97ZksaoWKuiSx5jZRwG2IuxX1 8W1/9xerNdUoRmGQmxzOcMwJhQ== X-Google-Smtp-Source: AGHT+IG8rYk3HtxvWhQBD3gqEh3WTe7UnjpyF//V73AOL+L1DuVCJMfGjTAFEhxzyfHDLdLF9kimpA== X-Received: by 2002:a17:906:101:b0:a18:81a3:a1fe with SMTP id 1-20020a170906010100b00a1881a3a1femr4846790eje.1.1701946385072; Thu, 07 Dec 2023 02:53:05 -0800 (PST) Received: from [127.0.1.1] ([82.79.186.233]) by smtp.gmail.com with ESMTPSA id k23-20020a1709063e1700b00a1db8b08610sm668700eji.148.2023.12.07.02.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 02:53:04 -0800 (PST) From: Abel Vesa Date: Thu, 07 Dec 2023 12:52:50 +0200 Subject: [PATCH v3 3/3] phy: qcom: edp: Add support for X1E80100 PHY MIME-Version: 1.0 Message-Id: <20231122-phy-qualcomm-edp-x1e80100-v3-3-576fc4e9559d@linaro.org> References: <20231122-phy-qualcomm-edp-x1e80100-v3-0-576fc4e9559d@linaro.org> In-Reply-To: <20231122-phy-qualcomm-edp-x1e80100-v3-0-576fc4e9559d@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Abhinav Kumar , Dmitry Baryshkov , Johan Hovold Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Vesa X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=27496; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=1OzVp06OdlamNxvG+R2odfAgsFuHfPs/bTQS1tnVBdU=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBlcaQJrw6zd8/ZRiJLSCiw/B50+48Sm3xjKIzuO R3jdxe7Pn+JAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZXGkCQAKCRAbX0TJAJUV VhGtD/9kXPajdRyHr8zk7W0i7cgVrj1Ut4yxX0i+lB0Qf7hf7/vhWdClS+jca+shM4fGuZf9hHJ 6solyCvNF/usqN8Ryyd6LPcURv//Gbb2uHF/3T4Xk/L2+G+Seo4pJsjEjuxNA/gAwblUeh2LDuI PECYE5wF8Fiu8orZZyz7057lm3NZk9/B9m0t7UcYUQ43q8OXVyMJ+O1Zpi5iCWaPVh7S9v1WyPd 8Z8fM9TtG3rXn+LudNSsWrC81fhb0b/adpUkBJuW/nW4j7FnF966w1o6ofOTWdqn+nTAtcBw6Av OLpSld8D5+e9wktiJDc85qg4iBz/rVJ9S0SLedS58S9NFVxxH8HIaY4C0q4ZFSKEYmSYHR+tcFC RH/mlGxJ4Dd/TXlzrjACiABpIu0slC/Vl4I0qP1F5rCLxZpcLVRk6blg8zXm5eWmARu3ilDFSet +nBt1vsqa4dpVX3KBahHoyDN5vptwqe5XKhqp2lLS2nMmoa5RrlQS13J/R0DSS0LuzokNYr/PUb o5AjYCu+PDQib44VGscd+sOZtpHhVtJQUM/IsDpkwQB759KY6Kvl0qQfcePx0y1w0/2rSIAn3ie EMulaiVJNr+5EDOxOyP/7GYCUDpxXQDFWFfVG7evGEuY6GYF7DvP99zzg3rqIS8wdy3pk/GmQEz F6cqP5b5tigv3xg== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231207_025308_942466_A08E4CA6 X-CRM114-Status: GOOD ( 10.40 ) 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 The Qualcomm X1E80100 platform has a number of eDP/DP PHY instances. These are based on QMP v6. So add support for v6 QMP COM registers by supporting configuration-based register offsets. For legacy platforms, keep the eDP and DP compatibles different, but for new platforms, use the phy-type DT property instead. So add platform specific configs, specify the version and override the PHY type where compatible dictates it. Co-developed-by: Abhinav Kumar Signed-off-by: Abhinav Kumar Signed-off-by: Abel Vesa --- drivers/phy/qualcomm/phy-qcom-edp.c | 583 ++++++++++++++++++++++++++++++------ 1 file changed, 490 insertions(+), 93 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/phy-qcom-edp.c index 8e5078304646..6fc18bf80db1 100644 --- a/drivers/phy/qualcomm/phy-qcom-edp.c +++ b/drivers/phy/qualcomm/phy-qcom-edp.c @@ -68,10 +68,333 @@ #define TXn_TRAN_DRVR_EMP_EN 0x0078 -struct qcom_edp_cfg { - bool is_dp; +enum dp_qmp_com_version { + DP_QMP_VERSION_V4, + DP_QMP_VERSION_V6, +}; + +enum dp_link_rate { + DP_LINK_RATE_1_6_GHZ, + DP_LINK_RATE_2_7_GHZ, + DP_LINK_RATE_5_4_GHZ, + DP_LINK_RATE_8_1_GHZ, +}; + +struct qmp_com_regs_layout { + unsigned int cmn_status; + unsigned int ssc_en_center; + unsigned int resetsm_cntrl; + unsigned int c_ready_status; + unsigned int ssc_per1; + unsigned int ssc_per2; + unsigned int ssc_step_size1_mode0; + unsigned int ssc_step_size2_mode0; + unsigned int ssc_adj_per1; + unsigned int svs_mode_clk_sel; + unsigned int sysclk_en_sel; + unsigned int sys_clk_ctrl; + unsigned int clk_enable1; + unsigned int clk_select; + unsigned int sysclk_buf_enable; + unsigned int hsclk_sel; + unsigned int pll_ivco; + unsigned int lock_cmp_en; + unsigned int pll_cctrl_mode0; + unsigned int pll_rctrl_mode0; + unsigned int cp_ctrl_mode0; + unsigned int dec_start_mode0; + unsigned int div_frac_start1_mode0; + unsigned int div_frac_start2_mode0; + unsigned int div_frac_start3_mode0; + unsigned int cmn_config; + unsigned int integloop_gain0_mode0; + unsigned int integloop_gain1_mode0; + unsigned int vco_tune_map; + unsigned int lock_cmp1_mode0; + unsigned int lock_cmp2_mode0; + unsigned int bg_timer; + unsigned int pll_core_clk_div_mode0; + unsigned int vco_tune_ctrl; + unsigned int pll_bias_en_clk_buflr_en; + unsigned int core_clk_en; + unsigned int vco_tune1_mode0; + unsigned int vco_tune2_mode0; + unsigned int bin_vcocal_cmp_code1_mode0; + unsigned int bin_vcocal_cmp_code2_mode0; +}; + +static const struct qmp_com_regs_layout qmp_v4_com_regs = { + .cmn_status = QSERDES_V4_COM_CMN_STATUS, + .c_ready_status = QSERDES_V4_COM_C_READY_STATUS, + .resetsm_cntrl = QSERDES_V4_COM_RESETSM_CNTRL, + .ssc_en_center = QSERDES_V4_COM_SSC_EN_CENTER, + .ssc_per1 = QSERDES_V4_COM_SSC_PER1, + .ssc_per2 = QSERDES_V4_COM_SSC_PER2, + .ssc_step_size1_mode0 = QSERDES_V4_COM_SSC_STEP_SIZE1_MODE0, + .ssc_step_size2_mode0 = QSERDES_V4_COM_SSC_STEP_SIZE2_MODE0, + .ssc_adj_per1 = QSERDES_V4_COM_SSC_ADJ_PER1, + .svs_mode_clk_sel = QSERDES_V4_COM_SVS_MODE_CLK_SEL, + .sysclk_en_sel = QSERDES_V4_COM_SYSCLK_EN_SEL, + .sys_clk_ctrl = QSERDES_V4_COM_SYS_CLK_CTRL, + .sysclk_buf_enable = QSERDES_V4_COM_SYSCLK_BUF_ENABLE, + .clk_enable1 = QSERDES_V4_COM_CLK_ENABLE1, + .clk_select = QSERDES_V4_COM_CLK_SELECT, + .hsclk_sel = QSERDES_V4_COM_HSCLK_SEL, + .pll_ivco = QSERDES_V4_COM_PLL_IVCO, + .lock_cmp_en = QSERDES_V4_COM_LOCK_CMP_EN, + .pll_cctrl_mode0 = QSERDES_V4_COM_PLL_CCTRL_MODE0, + .pll_rctrl_mode0 = QSERDES_V4_COM_PLL_RCTRL_MODE0, + .cp_ctrl_mode0 = QSERDES_V4_COM_CP_CTRL_MODE0, + .dec_start_mode0 = QSERDES_V4_COM_DEC_START_MODE0, + .div_frac_start1_mode0 = QSERDES_V4_COM_DIV_FRAC_START1_MODE0, + .div_frac_start2_mode0 = QSERDES_V4_COM_DIV_FRAC_START2_MODE0, + .div_frac_start3_mode0 = QSERDES_V4_COM_DIV_FRAC_START3_MODE0, + .cmn_config = QSERDES_V4_COM_CMN_CONFIG, + .integloop_gain0_mode0 = QSERDES_V4_COM_INTEGLOOP_GAIN0_MODE0, + .integloop_gain1_mode0 = QSERDES_V4_COM_INTEGLOOP_GAIN1_MODE0, + .vco_tune_map = QSERDES_V4_COM_VCO_TUNE_MAP, + .lock_cmp1_mode0 = QSERDES_V4_COM_LOCK_CMP1_MODE0, + .lock_cmp2_mode0 = QSERDES_V4_COM_LOCK_CMP2_MODE0, + .bg_timer = QSERDES_V4_COM_BG_TIMER, + .pll_core_clk_div_mode0 = QSERDES_V4_COM_CORECLK_DIV_MODE0, + .vco_tune_ctrl = QSERDES_V4_COM_VCO_TUNE_CTRL, + .pll_bias_en_clk_buflr_en = QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN, + .core_clk_en = QSERDES_V4_COM_CORE_CLK_EN, + .vco_tune1_mode0 = QSERDES_V4_COM_VCO_TUNE1_MODE0, + .vco_tune2_mode0 = QSERDES_V4_COM_VCO_TUNE2_MODE0, +}; + +static const struct qmp_com_regs_layout qmp_v6_com_regs = { + .cmn_status = QSERDES_V6_COM_CMN_STATUS, + .c_ready_status = QSERDES_V6_COM_C_READY_STATUS, + .resetsm_cntrl = QSERDES_V6_COM_RESETSM_CNTRL, + .ssc_en_center = QSERDES_V6_COM_SSC_EN_CENTER, + .ssc_per1 = QSERDES_V6_COM_SSC_PER1, + .ssc_per2 = QSERDES_V6_COM_SSC_PER2, + .ssc_step_size1_mode0 = QSERDES_V6_COM_SSC_STEP_SIZE1_MODE0, + .ssc_step_size2_mode0 = QSERDES_V6_COM_SSC_STEP_SIZE2_MODE0, + .ssc_adj_per1 = QSERDES_V6_COM_SSC_ADJ_PER1, + .svs_mode_clk_sel = QSERDES_V6_COM_SVS_MODE_CLK_SEL, + .sysclk_en_sel = QSERDES_V6_COM_SYSCLK_EN_SEL, + .sys_clk_ctrl = QSERDES_V6_COM_SYS_CLK_CTRL, + .sysclk_buf_enable = QSERDES_V6_COM_SYSCLK_BUF_ENABLE, + .clk_enable1 = QSERDES_V6_COM_CLK_ENABLE1, + .clk_select = QSERDES_V6_COM_CLK_SELECT, + .hsclk_sel = QSERDES_V6_COM_HSCLK_SEL_1, + .pll_ivco = QSERDES_V6_COM_PLL_IVCO, + .lock_cmp_en = QSERDES_V6_COM_LOCK_CMP_EN, + .pll_cctrl_mode0 = QSERDES_V6_COM_PLL_CCTRL_MODE0, + .pll_rctrl_mode0 = QSERDES_V6_COM_PLL_RCTRL_MODE0, + .cp_ctrl_mode0 = QSERDES_V6_COM_CP_CTRL_MODE0, + .dec_start_mode0 = QSERDES_V6_COM_DEC_START_MODE0, + .div_frac_start1_mode0 = QSERDES_V6_COM_DIV_FRAC_START1_MODE0, + .div_frac_start2_mode0 = QSERDES_V6_COM_DIV_FRAC_START2_MODE0, + .div_frac_start3_mode0 = QSERDES_V6_COM_DIV_FRAC_START3_MODE0, + .cmn_config = QSERDES_V6_COM_CMN_CONFIG_1, + .integloop_gain0_mode0 = QSERDES_V6_COM_INTEGLOOP_GAIN0_MODE0, + .integloop_gain1_mode0 = QSERDES_V6_COM_INTEGLOOP_GAIN1_MODE0, + .vco_tune_map = QSERDES_V6_COM_VCO_TUNE_MAP, + .lock_cmp1_mode0 = QSERDES_V6_COM_LOCK_CMP1_MODE0, + .lock_cmp2_mode0 = QSERDES_V6_COM_LOCK_CMP2_MODE0, + .bg_timer = QSERDES_V6_COM_BG_TIMER, + .pll_core_clk_div_mode0 = QSERDES_V6_COM_PLL_CORE_CLK_DIV_MODE0, + .vco_tune_ctrl = QSERDES_V6_COM_VCO_TUNE_CTRL, + .pll_bias_en_clk_buflr_en = QSERDES_V6_COM_PLL_BIAS_EN_CLK_BUFLR_EN, + .core_clk_en = QSERDES_V6_COM_CORE_CLK_EN, + .bin_vcocal_cmp_code1_mode0 = QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE1_MODE0, + .bin_vcocal_cmp_code2_mode0 = QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE2_MODE0, +}; + +struct qmp_com_init { + const u8 ssc_per1; + const u8 ssc_per2; + const u8 pll_ivco; + const u8 cmn_config; + const u8 vco_tune1_mode0; + const u8 vco_tune2_mode0; + const u8 pll_bias_en_clk_buflr_en; + + const u8 *ssc_step1; + const u8 *ssc_step2; + const u8 *hsclk_sel; + const u8 *dec_start_mode0; + const u8 *div_frac_start2_mode0; + const u8 *div_frac_start3_mode0; + const u8 *lock_cmp1_mode0; + const u8 *lock_cmp2_mode0; + const u8 *code1_mode0; + const u8 *code2_mode0; +}; + +static const u8 qmp_v4_com_ssc_step1[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x45, + [DP_LINK_RATE_2_7_GHZ] = 0x45, + [DP_LINK_RATE_5_4_GHZ] = 0x5c, + [DP_LINK_RATE_8_1_GHZ] = 0x45, +}; + +static const u8 qmp_v4_com_ssc_step2[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x06, + [DP_LINK_RATE_2_7_GHZ] = 0x06, + [DP_LINK_RATE_5_4_GHZ] = 0x08, + [DP_LINK_RATE_8_1_GHZ] = 0x06, +}; + +static const u8 qmp_v4_com_hsclk_sel[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x05, + [DP_LINK_RATE_2_7_GHZ] = 0x03, + [DP_LINK_RATE_5_4_GHZ] = 0x01, + [DP_LINK_RATE_8_1_GHZ] = 0x00, +}; + +static const u8 qmp_v4_com_dec_start_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x69, + [DP_LINK_RATE_2_7_GHZ] = 0x69, + [DP_LINK_RATE_5_4_GHZ] = 0x8c, + [DP_LINK_RATE_8_1_GHZ] = 0x69, +}; + +static const u8 qmp_v4_com_div_frac_start2_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x80, + [DP_LINK_RATE_2_7_GHZ] = 0x80, + [DP_LINK_RATE_5_4_GHZ] = 0x00, + [DP_LINK_RATE_8_1_GHZ] = 0x80, +}; + +static const u8 qmp_v4_com_div_frac_start3_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x07, + [DP_LINK_RATE_2_7_GHZ] = 0x07, + [DP_LINK_RATE_5_4_GHZ] = 0x0a, + [DP_LINK_RATE_8_1_GHZ] = 0x07, +}; + +static const u8 qmp_v4_com_lock_cmp1_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x6f, + [DP_LINK_RATE_2_7_GHZ] = 0x0f, + [DP_LINK_RATE_5_4_GHZ] = 0x1f, + [DP_LINK_RATE_8_1_GHZ] = 0x2f, +}; + +static const u8 qmp_v4_com_lock_cmp2_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x08, + [DP_LINK_RATE_2_7_GHZ] = 0x0e, + [DP_LINK_RATE_5_4_GHZ] = 0x1c, + [DP_LINK_RATE_8_1_GHZ] = 0x2a, +}; + +static const struct qmp_com_init qmp_v4_com_init = { + .ssc_per1 = 0x36, + .ssc_per2 = 0x01, + .pll_ivco = 0x0f, + .cmn_config = 0x02, + .pll_bias_en_clk_buflr_en = 0x17, + .ssc_step1 = qmp_v4_com_ssc_step1, + .ssc_step2 = qmp_v4_com_ssc_step2, + .hsclk_sel = qmp_v4_com_hsclk_sel, + .dec_start_mode0 = qmp_v4_com_dec_start_mode0, + .div_frac_start2_mode0 = qmp_v4_com_div_frac_start2_mode0, + .div_frac_start3_mode0 = qmp_v4_com_div_frac_start3_mode0, + .lock_cmp1_mode0 = qmp_v4_com_lock_cmp1_mode0, + .lock_cmp2_mode0 = qmp_v4_com_lock_cmp2_mode0, + .vco_tune1_mode0 = 0xa0, + .vco_tune2_mode0 = 0x03, +}; + +static const u8 qmp_v6_com_ssc_step1[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x92, + [DP_LINK_RATE_2_7_GHZ] = 0x92, + [DP_LINK_RATE_5_4_GHZ] = 0x18, + [DP_LINK_RATE_8_1_GHZ] = 0x92, +}; + +static const u8 qmp_v6_com_ssc_step2[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x01, + [DP_LINK_RATE_2_7_GHZ] = 0x01, + [DP_LINK_RATE_5_4_GHZ] = 0x02, + [DP_LINK_RATE_8_1_GHZ] = 0x01, +}; + +static const u8 qmp_v6_com_hsclk_sel[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x05, + [DP_LINK_RATE_2_7_GHZ] = 0x03, + [DP_LINK_RATE_5_4_GHZ] = 0x01, + [DP_LINK_RATE_8_1_GHZ] = 0x00, +}; + +static const u8 qmp_v6_com_dec_start_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x34, + [DP_LINK_RATE_2_7_GHZ] = 0x34, + [DP_LINK_RATE_5_4_GHZ] = 0x46, + [DP_LINK_RATE_8_1_GHZ] = 0x34, +}; + +static const u8 qmp_v6_com_div_frac_start2_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0xc0, + [DP_LINK_RATE_2_7_GHZ] = 0xc0, + [DP_LINK_RATE_5_4_GHZ] = 0x00, + [DP_LINK_RATE_8_1_GHZ] = 0xc0, +}; + +static const u8 qmp_v6_com_div_frac_start3_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x0b, + [DP_LINK_RATE_2_7_GHZ] = 0x0b, + [DP_LINK_RATE_5_4_GHZ] = 0x05, + [DP_LINK_RATE_8_1_GHZ] = 0x0b, +}; + +static const u8 qmp_v6_com_lock_cmp1_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x37, + [DP_LINK_RATE_2_7_GHZ] = 0x07, + [DP_LINK_RATE_5_4_GHZ] = 0x0f, + [DP_LINK_RATE_8_1_GHZ] = 0x17, +}; - /* DP PHY swing and pre_emphasis tables */ +static const u8 qmp_v6_com_lock_cmp2_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x04, + [DP_LINK_RATE_2_7_GHZ] = 0x07, + [DP_LINK_RATE_5_4_GHZ] = 0x0e, + [DP_LINK_RATE_8_1_GHZ] = 0x15, +}; + +static const u8 qmp_v6_com_code1_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x71, + [DP_LINK_RATE_2_7_GHZ] = 0x71, + [DP_LINK_RATE_5_4_GHZ] = 0x97, + [DP_LINK_RATE_8_1_GHZ] = 0x71, +}; + +static const u8 qmp_v6_com_code2_mode0[] = { + [DP_LINK_RATE_1_6_GHZ] = 0x0c, + [DP_LINK_RATE_2_7_GHZ] = 0x0c, + [DP_LINK_RATE_5_4_GHZ] = 0x10, + [DP_LINK_RATE_8_1_GHZ] = 0x0c, +}; + +static const struct qmp_com_init qmp_v6_com_init = { + .ssc_per1 = 0x6b, + .ssc_per2 = 0x02, + .pll_ivco = 0x07, + .cmn_config = 0x12, + .pll_bias_en_clk_buflr_en = 0x1f, + .ssc_step1 = qmp_v6_com_ssc_step1, + .ssc_step2 = qmp_v6_com_ssc_step2, + .hsclk_sel = qmp_v6_com_hsclk_sel, + .dec_start_mode0 = qmp_v6_com_dec_start_mode0, + .div_frac_start2_mode0 = qmp_v6_com_div_frac_start2_mode0, + .div_frac_start3_mode0 = qmp_v6_com_div_frac_start3_mode0, + .lock_cmp1_mode0 = qmp_v6_com_lock_cmp1_mode0, + .lock_cmp2_mode0 = qmp_v6_com_lock_cmp2_mode0, + .code1_mode0 = qmp_v6_com_code1_mode0, + .code2_mode0 = qmp_v6_com_code2_mode0, +}; + +struct qmp_phy_cfg { + int type; + enum dp_qmp_com_version version; + bool needs_swing_pre_emph_cfg; +}; + +struct qcom_dp_swing_pre_emph_cfg { const u8 (*swing_hbr_rbr)[4][4]; const u8 (*swing_hbr3_hbr2)[4][4]; const u8 (*pre_emphasis_hbr_rbr)[4][4]; @@ -80,7 +403,9 @@ struct qcom_edp_cfg { struct qcom_edp { struct device *dev; - const struct qcom_edp_cfg *cfg; + const struct qcom_dp_swing_pre_emph_cfg *swing_pre_emph_cfg; + const struct qmp_com_regs_layout *com_regs; + const struct qmp_com_init *init_values; struct phy *phy; @@ -96,6 +421,8 @@ struct qcom_edp { struct clk_bulk_data clks[2]; struct regulator_bulk_data supplies[2]; + + bool is_dp; }; static const u8 dp_swing_hbr_rbr[4][4] = { @@ -126,8 +453,7 @@ static const u8 dp_pre_emp_hbr2_hbr3[4][4] = { { 0x04, 0xff, 0xff, 0xff } }; -static const struct qcom_edp_cfg dp_phy_cfg = { - .is_dp = true, +static const struct qcom_dp_swing_pre_emph_cfg dp_phy_swing_pre_emph_cfg = { .swing_hbr_rbr = &dp_swing_hbr_rbr, .swing_hbr3_hbr2 = &dp_swing_hbr2_hbr3, .pre_emphasis_hbr_rbr = &dp_pre_emp_hbr_rbr, @@ -162,18 +488,40 @@ static const u8 edp_pre_emp_hbr2_hbr3[4][4] = { { 0x00, 0xff, 0xff, 0xff } }; -static const struct qcom_edp_cfg edp_phy_cfg = { - .is_dp = false, +static const struct qcom_dp_swing_pre_emph_cfg edp_phy_swing_pre_emph_cfg = { .swing_hbr_rbr = &edp_swing_hbr_rbr, .swing_hbr3_hbr2 = &edp_swing_hbr2_hbr3, .pre_emphasis_hbr_rbr = &edp_pre_emp_hbr_rbr, .pre_emphasis_hbr3_hbr2 = &edp_pre_emp_hbr2_hbr3, }; +static struct qmp_phy_cfg sc7280_dp_phy_cfg = { + .type = PHY_TYPE_DP, + .version = DP_QMP_VERSION_V4, +}; + +static struct qmp_phy_cfg sc8280xp_dp_phy_cfg = { + .type = PHY_TYPE_DP, + .version = DP_QMP_VERSION_V4, + .needs_swing_pre_emph_cfg = true, +}; + +static struct qmp_phy_cfg sc8280xp_edp_phy_cfg = { + .type = PHY_TYPE_EDP, + .version = DP_QMP_VERSION_V4, + .needs_swing_pre_emph_cfg = true, +}; + +static struct qmp_phy_cfg x1e80100_phy_cfg = { + .version = DP_QMP_VERSION_V6, + .needs_swing_pre_emph_cfg = true, +}; + static int qcom_edp_phy_init(struct phy *phy) { struct qcom_edp *edp = phy_get_drvdata(phy); - const struct qcom_edp_cfg *cfg = edp->cfg; + const struct qmp_com_init *init = edp->init_values; + const struct qmp_com_regs_layout *regs = edp->com_regs; int ret; u8 cfg8; @@ -190,7 +538,8 @@ static int qcom_edp_phy_init(struct phy *phy) edp->edp + DP_PHY_PD_CTL); /* Turn on BIAS current for PHY/PLL */ - writel(0x17, edp->pll + QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN); + writel(init->pll_bias_en_clk_buflr_en, + edp->pll + regs->pll_bias_en_clk_buflr_en); writel(DP_PHY_PD_CTL_PSR_PWRDN, edp->edp + DP_PHY_PD_CTL); msleep(20); @@ -200,7 +549,7 @@ static int qcom_edp_phy_init(struct phy *phy) DP_PHY_PD_CTL_PLL_PWRDN | DP_PHY_PD_CTL_DP_CLAMP_EN, edp->edp + DP_PHY_PD_CTL); - if (cfg && cfg->is_dp) + if (edp->is_dp) cfg8 = 0xb7; else cfg8 = 0x37; @@ -234,7 +583,7 @@ static int qcom_edp_phy_init(struct phy *phy) static int qcom_edp_set_voltages(struct qcom_edp *edp, const struct phy_configure_opts_dp *dp_opts) { - const struct qcom_edp_cfg *cfg = edp->cfg; + const struct qcom_dp_swing_pre_emph_cfg *cfg = edp->swing_pre_emph_cfg; unsigned int v_level = 0; unsigned int p_level = 0; u8 ldo_config; @@ -261,7 +610,7 @@ static int qcom_edp_set_voltages(struct qcom_edp *edp, const struct phy_configur if (swing == 0xff || emph == 0xff) return -EINVAL; - ldo_config = (cfg && cfg->is_dp) ? 0x1 : 0x0; + ldo_config = edp->is_dp ? 0x1 : 0x0; writel(ldo_config, edp->tx0 + TXn_LDO_CONFIG); writel(swing, edp->tx0 + TXn_TX_DRV_LVL); @@ -291,20 +640,21 @@ static int qcom_edp_phy_configure(struct phy *phy, union phy_configure_opts *opt static int qcom_edp_configure_ssc(const struct qcom_edp *edp) { const struct phy_configure_opts_dp *dp_opts = &edp->dp_opts; - u32 step1; - u32 step2; + const struct qmp_com_regs_layout *regs = edp->com_regs; + const struct qmp_com_init *init = edp->init_values; + int link_rate; + u8 step1, step2; + u8 per1, per2; switch (dp_opts->link_rate) { case 1620: case 2700: case 8100: - step1 = 0x45; - step2 = 0x06; + link_rate = DP_LINK_RATE_1_6_GHZ; break; case 5400: - step1 = 0x5c; - step2 = 0x08; + link_rate = DP_LINK_RATE_5_4_GHZ; break; default: @@ -312,12 +662,18 @@ static int qcom_edp_configure_ssc(const struct qcom_edp *edp) return -EINVAL; } - writel(0x01, edp->pll + QSERDES_V4_COM_SSC_EN_CENTER); - writel(0x00, edp->pll + QSERDES_V4_COM_SSC_ADJ_PER1); - writel(0x36, edp->pll + QSERDES_V4_COM_SSC_PER1); - writel(0x01, edp->pll + QSERDES_V4_COM_SSC_PER2); - writel(step1, edp->pll + QSERDES_V4_COM_SSC_STEP_SIZE1_MODE0); - writel(step2, edp->pll + QSERDES_V4_COM_SSC_STEP_SIZE2_MODE0); + step1 = init->ssc_step1[link_rate]; + step2 = init->ssc_step2[link_rate]; + + per1 = init->ssc_per1; + per2 = init->ssc_per2; + + writel(0x01, edp->pll + regs->ssc_en_center); + writel(0x00, edp->pll + regs->ssc_adj_per1); + writel(per1, edp->pll + regs->ssc_per1); + writel(per2, edp->pll + regs->ssc_per2); + writel(step1, edp->pll + regs->ssc_step_size1_mode0); + writel(step2, edp->pll + regs->ssc_step_size2_mode0); return 0; } @@ -325,48 +681,30 @@ static int qcom_edp_configure_ssc(const struct qcom_edp *edp) static int qcom_edp_configure_pll(const struct qcom_edp *edp) { const struct phy_configure_opts_dp *dp_opts = &edp->dp_opts; + const struct qmp_com_regs_layout *regs = edp->com_regs; + const struct qmp_com_init *init = edp->init_values; u32 div_frac_start2_mode0; u32 div_frac_start3_mode0; u32 dec_start_mode0; u32 lock_cmp1_mode0; u32 lock_cmp2_mode0; + u32 code1_mode0; + u32 code2_mode0; u32 hsclk_sel; + int link_rate; switch (dp_opts->link_rate) { case 1620: - hsclk_sel = 0x5; - dec_start_mode0 = 0x69; - div_frac_start2_mode0 = 0x80; - div_frac_start3_mode0 = 0x07; - lock_cmp1_mode0 = 0x6f; - lock_cmp2_mode0 = 0x08; + link_rate = DP_LINK_RATE_1_6_GHZ; break; - case 2700: - hsclk_sel = 0x3; - dec_start_mode0 = 0x69; - div_frac_start2_mode0 = 0x80; - div_frac_start3_mode0 = 0x07; - lock_cmp1_mode0 = 0x0f; - lock_cmp2_mode0 = 0x0e; + link_rate = DP_LINK_RATE_2_7_GHZ; break; - case 5400: - hsclk_sel = 0x1; - dec_start_mode0 = 0x8c; - div_frac_start2_mode0 = 0x00; - div_frac_start3_mode0 = 0x0a; - lock_cmp1_mode0 = 0x1f; - lock_cmp2_mode0 = 0x1c; + link_rate = DP_LINK_RATE_5_4_GHZ; break; - case 8100: - hsclk_sel = 0x0; - dec_start_mode0 = 0x69; - div_frac_start2_mode0 = 0x80; - div_frac_start3_mode0 = 0x07; - lock_cmp1_mode0 = 0x2f; - lock_cmp2_mode0 = 0x2a; + link_rate = DP_LINK_RATE_8_1_GHZ; break; default: @@ -374,36 +712,59 @@ static int qcom_edp_configure_pll(const struct qcom_edp *edp) return -EINVAL; } - writel(0x01, edp->pll + QSERDES_V4_COM_SVS_MODE_CLK_SEL); - writel(0x0b, edp->pll + QSERDES_V4_COM_SYSCLK_EN_SEL); - writel(0x02, edp->pll + QSERDES_V4_COM_SYS_CLK_CTRL); - writel(0x0c, edp->pll + QSERDES_V4_COM_CLK_ENABLE1); - writel(0x06, edp->pll + QSERDES_V4_COM_SYSCLK_BUF_ENABLE); - writel(0x30, edp->pll + QSERDES_V4_COM_CLK_SELECT); - writel(hsclk_sel, edp->pll + QSERDES_V4_COM_HSCLK_SEL); - writel(0x0f, edp->pll + QSERDES_V4_COM_PLL_IVCO); - writel(0x08, edp->pll + QSERDES_V4_COM_LOCK_CMP_EN); - writel(0x36, edp->pll + QSERDES_V4_COM_PLL_CCTRL_MODE0); - writel(0x16, edp->pll + QSERDES_V4_COM_PLL_RCTRL_MODE0); - writel(0x06, edp->pll + QSERDES_V4_COM_CP_CTRL_MODE0); - writel(dec_start_mode0, edp->pll + QSERDES_V4_COM_DEC_START_MODE0); - writel(0x00, edp->pll + QSERDES_V4_COM_DIV_FRAC_START1_MODE0); - writel(div_frac_start2_mode0, edp->pll + QSERDES_V4_COM_DIV_FRAC_START2_MODE0); - writel(div_frac_start3_mode0, edp->pll + QSERDES_V4_COM_DIV_FRAC_START3_MODE0); - writel(0x02, edp->pll + QSERDES_V4_COM_CMN_CONFIG); - writel(0x3f, edp->pll + QSERDES_V4_COM_INTEGLOOP_GAIN0_MODE0); - writel(0x00, edp->pll + QSERDES_V4_COM_INTEGLOOP_GAIN1_MODE0); - writel(0x00, edp->pll + QSERDES_V4_COM_VCO_TUNE_MAP); - writel(lock_cmp1_mode0, edp->pll + QSERDES_V4_COM_LOCK_CMP1_MODE0); - writel(lock_cmp2_mode0, edp->pll + QSERDES_V4_COM_LOCK_CMP2_MODE0); - - writel(0x0a, edp->pll + QSERDES_V4_COM_BG_TIMER); - writel(0x14, edp->pll + QSERDES_V4_COM_CORECLK_DIV_MODE0); - writel(0x00, edp->pll + QSERDES_V4_COM_VCO_TUNE_CTRL); - writel(0x17, edp->pll + QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN); - writel(0x0f, edp->pll + QSERDES_V4_COM_CORE_CLK_EN); - writel(0xa0, edp->pll + QSERDES_V4_COM_VCO_TUNE1_MODE0); - writel(0x03, edp->pll + QSERDES_V4_COM_VCO_TUNE2_MODE0); + hsclk_sel = init->hsclk_sel[link_rate]; + dec_start_mode0 = init->dec_start_mode0[link_rate]; + div_frac_start2_mode0 = init->div_frac_start2_mode0[link_rate]; + div_frac_start3_mode0 = init->div_frac_start3_mode0[link_rate]; + lock_cmp1_mode0 = init->lock_cmp1_mode0[link_rate]; + lock_cmp2_mode0 = init->lock_cmp2_mode0[link_rate]; + + if (init->code1_mode0) + code1_mode0 = init->code1_mode0[link_rate]; + + if (init->code2_mode0) + code2_mode0 = init->code2_mode0[link_rate]; + + writel(0x01, edp->pll + regs->svs_mode_clk_sel); + writel(0x0b, edp->pll + regs->sysclk_en_sel); + writel(0x02, edp->pll + regs->sys_clk_ctrl); + writel(0x0c, edp->pll + regs->clk_enable1); + writel(0x06, edp->pll + regs->sysclk_buf_enable); + writel(0x30, edp->pll + regs->clk_select); + writel(hsclk_sel, edp->pll + regs->hsclk_sel); + writel(init->pll_ivco, edp->pll + regs->pll_ivco); + writel(0x08, edp->pll + regs->lock_cmp_en); + writel(0x36, edp->pll + regs->pll_cctrl_mode0); + writel(0x16, edp->pll + regs->pll_rctrl_mode0); + writel(0x06, edp->pll + regs->cp_ctrl_mode0); + writel(dec_start_mode0, edp->pll + regs->dec_start_mode0); + writel(0x00, edp->pll + regs->div_frac_start1_mode0); + writel(div_frac_start2_mode0, edp->pll + regs->div_frac_start2_mode0); + writel(div_frac_start3_mode0, edp->pll + regs->div_frac_start3_mode0); + writel(init->cmn_config, edp->pll + regs->cmn_config); + writel(0x3f, edp->pll + regs->integloop_gain0_mode0); + writel(0x00, edp->pll + regs->integloop_gain1_mode0); + writel(0x00, edp->pll + regs->vco_tune_map); + writel(lock_cmp1_mode0, edp->pll + regs->lock_cmp1_mode0); + writel(lock_cmp2_mode0, edp->pll + regs->lock_cmp2_mode0); + + writel(0x0a, edp->pll + regs->bg_timer); + writel(0x14, edp->pll + regs->pll_core_clk_div_mode0); + writel(0x00, edp->pll + regs->vco_tune_ctrl); + writel(0x17, edp->pll + regs->pll_bias_en_clk_buflr_en); + writel(0x0f, edp->pll + regs->core_clk_en); + + if (regs->vco_tune1_mode0) + writel(init->vco_tune1_mode0, edp->pll + regs->vco_tune1_mode0); + + if (regs->vco_tune2_mode0) + writel(init->vco_tune2_mode0, edp->pll + regs->vco_tune2_mode0); + + if (regs->bin_vcocal_cmp_code1_mode0) + writel(code1_mode0, edp->pll + regs->bin_vcocal_cmp_code1_mode0); + + if (regs->bin_vcocal_cmp_code2_mode0) + writel(code2_mode0, edp->pll + regs->bin_vcocal_cmp_code2_mode0); return 0; } @@ -447,10 +808,10 @@ static int qcom_edp_set_vco_div(const struct qcom_edp *edp, unsigned long *pixel static int qcom_edp_phy_power_on(struct phy *phy) { const struct qcom_edp *edp = phy_get_drvdata(phy); - const struct qcom_edp_cfg *cfg = edp->cfg; + const struct qmp_com_regs_layout *regs = edp->com_regs; u32 bias0_en, drvr0_en, bias1_en, drvr1_en; unsigned long pixel_freq; - u8 ldo_config; + u8 ldo_config = 0x0; int timeout; int ret; u32 val; @@ -462,13 +823,14 @@ static int qcom_edp_phy_power_on(struct phy *phy) edp->edp + DP_PHY_PD_CTL); writel(0xfc, edp->edp + DP_PHY_MODE); - timeout = readl_poll_timeout(edp->pll + QSERDES_V4_COM_CMN_STATUS, + timeout = readl_poll_timeout(edp->pll + regs->cmn_status, val, val & BIT(7), 5, 200); if (timeout) return timeout; - ldo_config = (cfg && cfg->is_dp) ? 0x1 : 0x0; + if (edp->swing_pre_emph_cfg && edp->is_dp) + ldo_config = 0x1; writel(ldo_config, edp->tx0 + TXn_LDO_CONFIG); writel(ldo_config, edp->tx1 + TXn_LDO_CONFIG); @@ -512,9 +874,9 @@ static int qcom_edp_phy_power_on(struct phy *phy) writel(0x01, edp->edp + DP_PHY_CFG); writel(0x09, edp->edp + DP_PHY_CFG); - writel(0x20, edp->pll + QSERDES_V4_COM_RESETSM_CNTRL); + writel(0x20, edp->pll + regs->resetsm_cntrl); - timeout = readl_poll_timeout(edp->pll + QSERDES_V4_COM_C_READY_STATUS, + timeout = readl_poll_timeout(edp->pll + regs->c_ready_status, val, val & BIT(0), 500, 10000); if (timeout) return timeout; @@ -768,6 +1130,37 @@ static int qcom_edp_clks_register(struct qcom_edp *edp, struct device_node *np) return devm_of_clk_add_hw_provider(edp->dev, of_clk_hw_onecell_get, data); } +static int qcom_edp_setup_phy(struct platform_device *pdev, struct qcom_edp *edp) +{ + struct device *dev = &pdev->dev; + const struct qmp_phy_cfg *cfg = of_device_get_match_data(dev); + enum dp_qmp_com_version version = cfg->version; + struct device_node *node = dev->of_node; + int type = cfg->type; + + of_property_read_u32(node, "phy-type", &type); + + if (type != PHY_TYPE_DP && type != PHY_TYPE_EDP) + return -EINVAL; + + edp->is_dp = (type == PHY_TYPE_DP) ? true : false; + + if (cfg->needs_swing_pre_emph_cfg) + edp->swing_pre_emph_cfg = edp->is_dp ? + &dp_phy_swing_pre_emph_cfg: + &edp_phy_swing_pre_emph_cfg; + + if (version == DP_QMP_VERSION_V6) { + edp->com_regs = &qmp_v6_com_regs; + edp->init_values = &qmp_v6_com_init; + } else { + edp->com_regs = &qmp_v4_com_regs; + edp->init_values = &qmp_v4_com_init; + } + + return 0; +} + static int qcom_edp_phy_probe(struct platform_device *pdev) { struct phy_provider *phy_provider; @@ -780,7 +1173,10 @@ static int qcom_edp_phy_probe(struct platform_device *pdev) return -ENOMEM; edp->dev = dev; - edp->cfg = of_device_get_match_data(&pdev->dev); + + ret = qcom_edp_setup_phy(pdev, edp); + if (ret) + return ret; edp->edp = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(edp->edp)) @@ -839,10 +1235,11 @@ static int qcom_edp_phy_probe(struct platform_device *pdev) } static const struct of_device_id qcom_edp_phy_match_table[] = { - { .compatible = "qcom,sc7280-edp-phy" }, - { .compatible = "qcom,sc8180x-edp-phy" }, - { .compatible = "qcom,sc8280xp-dp-phy", .data = &dp_phy_cfg }, - { .compatible = "qcom,sc8280xp-edp-phy", .data = &edp_phy_cfg }, + { .compatible = "qcom,sc7280-edp-phy" , .data = &sc7280_dp_phy_cfg, }, + { .compatible = "qcom,sc8180x-edp-phy", .data = &sc7280_dp_phy_cfg, }, + { .compatible = "qcom,sc8280xp-dp-phy", .data = &sc8280xp_dp_phy_cfg, }, + { .compatible = "qcom,sc8280xp-edp-phy", .data = &sc8280xp_edp_phy_cfg, }, + { .compatible = "qcom,x1e80100-dp-phy" , .data = &x1e80100_phy_cfg, }, { } }; MODULE_DEVICE_TABLE(of, qcom_edp_phy_match_table);