From patchwork Thu Feb 29 13:07:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13577087 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 04F37C54E41 for ; Thu, 29 Feb 2024 13:07:18 +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=L1tzpQj1Q5ceat2rUX6LAjuetx+5M6rIWDXS1tqfX4E=; b=XUOheRUSYcpS2P 2IAdJj0SPfktVJcEmaWHgyc+rMYcKN3h3r/+tPxvZ/HZMMVjXbODZRwJBm20wxhndS9UEnex1TVuQ bHV0PH/CWs/ELa5BK8+gUj6VgYZFgCIB5ie0m6II3NLs1+mU7D/veCXPwCRTDQirtmv/6TqR84Ydf F2M8qkyaoHNIU9aE2P0iGQtRVnT5vccDisCNVqbMVD+/dgKmSTfQnN7/A4QrJEwfjEBt4YT/9ozIV nNd5JqVWX1v/RB6GZ2NLdXli9Xjlv0tj4ge3WBl/OGm3lFEd4JVayzrRL9Lh0gvbFm4gmxaueuVlh C0UDzEpyvAasHxLSH7Ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg85-0000000DbI7-1llx; Thu, 29 Feb 2024 13:07:17 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg82-0000000DbFw-18YA for linux-phy@lists.infradead.org; Thu, 29 Feb 2024 13:07:15 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-51320536bddso771733e87.3 for ; Thu, 29 Feb 2024 05:07:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709212032; x=1709816832; 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=YT8Y/OHXUcXm+kdXDY4DIbb1yI62HJpje5eqK4s6t4U=; b=ojQWIyjM53II4E1obpl7KgS/xVoe9RAW+iDVK02emUgHuj0fbmFK7gS5yozBGtv1XW sHIe/Vkplx2N7jHmhuLDVj3QyfshPR3rZS1OZOPYM1Wtx8rIyPePtHvZCvMqgd3WMoVc kmXoWhfNY6njRG2LhLyWvT1nys2wEGXRVE0jrYp5kDdSpKxEtpzgtPm5Um/Cf16KI+o9 5y7BtWYbDEXFnlXvq1o36xrf8sJv1iRfst3sOa0lgQ+IOPBrIjSiPKvezEGWI2FnvmSa H7VLSrOWiNzTGrEb7e9yhfj4Y/5oAWE0FxkeWQcCT1yko3TnX/P+zE0IPkb3u3cMHAHp Vr6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709212032; x=1709816832; 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=YT8Y/OHXUcXm+kdXDY4DIbb1yI62HJpje5eqK4s6t4U=; b=G0ztUmnxzhpNUnFZ9RDLr/cLQlVhBCrIyMhE+8pnwkNtYTMoXfHRodtiucJeKE0LFq pgJOtLKytA14O2sM4ricC0nAySEhULhq+7rxNE78LULarwRplDxqR7KbybnKEBbQUTpG NPKV2owlMaXIzQRCTFm0aHKuw6BQflgQjnQOGCLCBsclaQu9InLRfG9lDVfVXzM7VEfU p0Xa5J7KOgPKv5rQcCdDcGaKv0JGuJ44sqv5rx6rCa6H1NKaLHy8sng72e0y2hlmtZLP eGMRr7eKJBo6JDVzo2dXjHet9Ye1zvXeaIBNjikUmXMt7ZrQd6FJ28Yz5CmuRDwHh79G M0Rw== X-Forwarded-Encrypted: i=1; AJvYcCXQuhPwZxdLabwIQsdXkE1ceOIIeXLAkBcJTMxH8HxpkjQ9ICv46CIsQySgQxksM885kmRWVL6xIsMDLZZI3xJ9KbpY2teJvXG5z+O8yA== X-Gm-Message-State: AOJu0YxSHL69/vcSJLQht3oW+IW7V8F17rSrm+L7lJApOn5f4G6qIcv0 LDW7owTWVMCsp0M6JtEZJhpBdieKPWqcc2fqBydzrd43bxQXIByFX/fjjsSgarE= X-Google-Smtp-Source: AGHT+IGI0oRvCFt0+el7beJ3sqJpYurlpJRXVhgZ8B7Fm1nl0mXZqOm336eD0Jk9r0hr/gWwN+UFVg== X-Received: by 2002:ac2:5f7a:0:b0:513:1a44:9a47 with SMTP id c26-20020ac25f7a000000b005131a449a47mr1225576lfc.21.1709212031850; Thu, 29 Feb 2024 05:07:11 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id t7-20020a05600c198700b00412a38e732csm2071473wmq.35.2024.02.29.05.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 05:07:11 -0800 (PST) From: Neil Armstrong Date: Thu, 29 Feb 2024 14:07:01 +0100 Subject: [PATCH RFT 1/7] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp: Add mode-switch MIME-Version: 1.0 Message-Id: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-1-07e24a231840@linaro.org> References: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> In-Reply-To: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1216; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=gUhmXpw+40NNDKZNzyOCoORFZuCEOLT0lZh0KAJVHT0=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBl4IF7kYVKYuwXLg3gaQZ28Ht2PLc+SXmc7J18PML8 11ZSL6iJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZeCBewAKCRB33NvayMhJ0YGcD/ kBQWdidfAXzh48Vrdai5QHAlUStkyw45ln9BSqmR0P6Wb00UqLymCONEjPKSgM8Hg2jxxUUpdUfNv6 75ZPLweTyFFPjVzqmY5SnhbFryhkkYAyyHjRfO8XvILuHpBxW/cdom8FiU/dNrticUc7LhkjBIPqmr x/nCDnb4kOgXl1lZBiSQgNrySA3FZ15Fw57yTS3QOer7+cpnJv1yR+ZNUBZzVTDPIBCmOzWdWIxE35 D2VkUz3BddkAWIq/pgmAhRdvzSrExJxFaX+fOEWzn+licnmR0k2F7+JCCQgjRFUX096rWbrPfkS9dn H0OC/uNZGMsEdngZYO7E9gf60oYqIOy+JtdyURs7x8WviFuf4tmjbzfEKRPo49+JYs9juh6WcuMA5v EB4OZaD96YUJ7QkGHzuT2H7GogusWJUp87dVFhKJkcmqQ28pUttZ75fOGZ1DJ5P9zHWQbDXNs/Sg4Y eKesY4z3/n7bIcbJ/80u5hJ3VYQUa0k8fOyfhXJUuWage4DB+blWUjKhom2FFftWLGBl44WI+gbFP0 HwO5ut9YFkIPvZpBAtkCv8IuF16O5JNxih7+jVJgwYj4v2TBDS8bXrvFLnHAQ/9Q/4MYuZGo9xVxvo dwucpiW4w5+FRfn9UZUmhgkPXf8Dc7IB0ekRVrTX/aE7YP0XTcQ22PluEFog== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_050714_352534_05854014 X-CRM114-Status: UNSURE ( 7.40 ) 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 QMP USB3/DP Combo PHY can work in 3 modes: - DisplayPort Only - USB3 Only - USB3 + DisplayPort Combo mode In order to switch between those modes, the PHY needs to receive Type-C events, allow marking to the phy with the mode-switch property in order to allow the PHY to Type-C events. Signed-off-by: Neil Armstrong --- .../devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml index 2d0d7e9e6431..49c6539b9df0 100644 --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml @@ -71,6 +71,11 @@ properties: description: See include/dt-bindings/phy/phy-qcom-qmp.h + mode-switch: + description: + Flag the PHY as possible handler of USB Type-C altmode switching + type: boolean + orientation-switch: description: Flag the PHY as possible handler of USB Type-C orientation switching From patchwork Thu Feb 29 13:07:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13577088 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 79C23C54E41 for ; Thu, 29 Feb 2024 13:07:20 +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=sppmPf7vrXoNvsrdcldh6ggFZPqvl4xbY1iOWyinkNw=; b=CmCR3ROVO6Nqe7 FCY39mNPLhmczKiYkUHGGDQaPlyj0tT6k+HoUXORfydifEL0ueJ890i8ls0gvMaFIupLhZpU5ecm+ 4lp00HYL5/MeorhZE0A7d570H+sO0Pa92qq8b2xDDgRxKQ0vMJ6OzVI2WUyC2G6mfjbqajhRNGgGB /Dz6Ny8RCAbhKlMfPDnHVaRT+1I8t7TUaoUvqWYCaQR0pWzYEuHTX8IetCVVWes1jLtMkFeI0Esun 0GYxnusYqA65LaWwI3vEzDvDHBDkvqBudKMb+/gJ0SSfifAPpRDvb1C9E+ll50AxobKs8lI2iEbeQ EYAaQwIn0u07hieHaatg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg88-0000000DbJd-0G13; Thu, 29 Feb 2024 13:07:20 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg82-0000000DbFz-3JES for linux-phy@lists.infradead.org; Thu, 29 Feb 2024 13:07:16 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2d204e102a9so9081201fa.0 for ; Thu, 29 Feb 2024 05:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709212033; x=1709816833; 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=SE9xKWVsxs5pjWEcUUBayX/iRsKUyAQ4+9MJ8LDkXdA=; b=bw9iT9UYNkk/89hnlTixwjNlZTqA/6t2H5f43jI2jab0JfE65qvgB2UfHc7+ugUiRs Li2AzCo+D18/BQQbPHvo0HZNsm3oYRD+rNsNRBuus6xbCXTxdIamCIpkxKjr9353bStJ uDz2Hb+xQmLqgaSp1aaQwYWeuJ3wHugNZspoNrwWncGDJzDoxp3Xe43wx7RJN9QwEjEK nuT1zQNAC7KnY2tQlbmR42D7cdEqtJL6TXiV3cGbx0D1wjzYKtD9P2FrLsrU3m1gBWsq M9BD1aV/SsuA+NYzbmrH7Xw0NUjT9F5ekHDMclNXjKzBAVBPMNYv7LtLmUGAxLNtFFcS O3hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709212033; x=1709816833; 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=SE9xKWVsxs5pjWEcUUBayX/iRsKUyAQ4+9MJ8LDkXdA=; b=na8NUllgrXrMeX7pVOab5Hwe+jDZqvOC1QS260L59J6zLSQFY560BuCAdbnO3MZkAg 1QBEpW0lhmM6F4HDqhymdjYVuJ/UCbuSCNnCkdF8gXGzpGtwypqsTBBRp2H5hh4kEiGb yN9OvgN43cO5k4q870EpXyhvgrfKTQ7KyU16zg1OL6DeJSKtDz0xQF5PxJEa8zo4US/j a/eLdLTkc4HznIZuDTervAIzrbl+FURs3TMgKY1c11o6sqL1ZO3HAd2eggrdoyWeu5D7 TLGOzwNT/6NdrZTUi/m6ekHKca24qXkzDzQqRNmiIqZc+j4s7cnGjnkoTVhOZ2jU/wv7 FMwQ== X-Forwarded-Encrypted: i=1; AJvYcCUuw75tmiRxCMaNnmYSgKNEBe4JJxCwM+FdnBk9Tn9Y5PZJCS426Sj/7TskCCi0HGn8WMrOEexQSDYaH63YmjwohA6KUJILJSAMGiI+KA== X-Gm-Message-State: AOJu0Yw/nVMMcthJg5vhsCnoMlVLAOjxSSdrKk0cjZnrL9qoVv5F/0Xl iq8oYbutRqAV1UQlp/p/QFPDFAk17FtOm0F6u74hOhR1d/jBI1PSSITpa+rO3Sw= X-Google-Smtp-Source: AGHT+IGn3VGQDNynXtqcROY+w95yeAvZysb2r3gp3IsB+wTNLRr3RGjZHc70TRsmgv+AcGSj2xhEsg== X-Received: by 2002:a2e:9a8c:0:b0:2d2:3758:8c2a with SMTP id p12-20020a2e9a8c000000b002d237588c2amr1296864lji.9.1709212032736; Thu, 29 Feb 2024 05:07:12 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id t7-20020a05600c198700b00412a38e732csm2071473wmq.35.2024.02.29.05.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 05:07:12 -0800 (PST) From: Neil Armstrong Date: Thu, 29 Feb 2024 14:07:02 +0100 Subject: [PATCH RFT 2/7] phy: qcom: qmp-combo: store DP phy power state MIME-Version: 1.0 Message-Id: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-2-07e24a231840@linaro.org> References: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> In-Reply-To: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1271; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=cCW1iS1Wauzti7oU5CFmde3Uy5U4EhSg8/m1/ht6x1w=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBl4IF7bfuu4oiH0n1J3IHdK+9gk2M/GXn3L4FSAJzD REKJ/kWJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZeCBewAKCRB33NvayMhJ0f7PD/ 9B/AG0x9Ko77sX1GbvkvxzHtijD4Bw3hLJo76GiC/1U/uQL7+VmW/MeEUZaHPrMUswPByMjJ7HEZOA ri/6gD4+/LfMFbN6ehU8dOCbNSbmvTStcToPkSoLSYhrxpyRBdGWgBntHQKayPqJUPrKkv3SQ8xtdq kLuev342eIkjoALEKYA2xx1cs302o/4n4HNIrv/kEThLoUUc+5lMefqx+fhUoCt5MakeV0NJZ1UK/r tGuDqbtJRxfz+mdD7zjgkHZOpf9CGfAToix82dixhUHYeFlqKPd2QNPy83blIZcpUwcSYwdVOBq1u1 aZ5XyfSEfuJxKASqrkQGGRGtUCj2XjG2W5qpFtx+3HHsFmQ5dz8WN+xG9lcg7O9ijLf0BrO2EA3Ft1 jNnGLyuiWUNjCc2SCUO0SD9Gjz3v6Kx+i084vOjAsZUXlYwgr5PRlDmdvgGOsNMtcTMvCeUq5tn/4L ao2z/ZVCfVTc7bkAVVwW4Ve4LLw0Dprt+jCWuwtrG6fP5xGYTbJLrqpw+uTKQ0z5+moTFyMnhtGWhA dWYbv4XhBb4DD0rHDCyTurMl46oY2HtmVSUrc5mAg+VtVw8sTfN8ks82Wy1sF3XNdTLFj+sgtAwOyn waJt1tdhtHBaQppNM9XhU5RnMbh8GvrSAqIZsgewoG9JhfCiR0SVZoM4lfqg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_050714_883031_CDA6973A X-CRM114-Status: UNSURE ( 8.87 ) 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 Switching the PHY Mode requires the DisplayPort PHY to be powered off, keep track of the DisplayPort phy power state. Signed-off-by: Neil Armstrong --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index 2f341613fd31..3721bbea9eae 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -1500,6 +1500,7 @@ struct qmp_combo { unsigned int dp_aux_cfg; struct phy_configure_opts_dp dp_opts; unsigned int dp_init_count; + bool dp_powered_on; struct clk_fixed_rate pipe_clk_fixed; struct clk_hw dp_link_hw; @@ -2627,6 +2628,8 @@ static int qmp_combo_dp_power_on(struct phy *phy) /* Configure link rate, swing, etc. */ cfg->configure_dp_phy(qmp); + qmp->dp_powered_on = true; + mutex_unlock(&qmp->phy_mutex); return 0; @@ -2641,6 +2644,8 @@ static int qmp_combo_dp_power_off(struct phy *phy) /* Assert DP PHY power down */ writel(DP_PHY_PD_CTL_PSR_PWRDN, qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL); + qmp->dp_powered_on = false; + mutex_unlock(&qmp->phy_mutex); return 0; From patchwork Thu Feb 29 13:07:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13577089 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 038DCC48BF6 for ; Thu, 29 Feb 2024 13:07:21 +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=cvIKsYcq1H/mggc9mVfs3/gq2ss3KqAgMTLuZ9dinN8=; b=lPxxzUrTcEleDf kYNaLlQYoON7QYqfUTYdaHK8gy038FuqP1K7F2bd5cO4l59pP9lzQlQy+jtV3FPSMBkzDGEzCJrBA spVIYE4Yyi05uC019sdl3oCjEft3qF34ana/ML3CvRgAJQWOAyqxexpMNY8bkXNDiC//65Utf51hw k+Sc2lbQUpPNB6pMjggH/GdbF5/v1/xqPntHYS78Y2Mb8V8b+cHknawi7x4pLx3FBkTGsyAl8BcP1 cflHTr/FjBAd3cvbxFcInPrhtxxwmrlVWh0xRXHIbAz35q3bs/c1lmZ8wg9rrsh2Fm6VS8GdDF+2M NbNtT5nmxvVO/PsvsWJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg88-0000000DbJu-1egh; Thu, 29 Feb 2024 13:07:20 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg83-0000000DbG4-1WWY for linux-phy@lists.infradead.org; Thu, 29 Feb 2024 13:07:17 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-412bb23e5c5so4508555e9.1 for ; Thu, 29 Feb 2024 05:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709212033; x=1709816833; 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=3uIfY5ntnNufGy4UYEPo9i3yGnfffKpCKmKs8Z7x9Cg=; b=k0gYY9nOrn20wkOf6hZRz2GM9vX78G0nzYJEHPnnxZJ5Nk2EuRvuo+QVSGZm1bH1FY E+N8I5ay/CE4BcPMVlPIlvE8IaGMTbseGUm8u/IePqhyecym5GtCf8RNIXrB6+CCa6xP HuIaC+2zvXQetA2MsJy9y7AkgnKUxRi2AtiNmdmqC1EOoLzdDVZrlpAdi4HrUk93kd2p 3VpGmNjamoPxQ+BZLKpb37dHnxCiDB1ABbsodzrCgJhchO+HcR2FKrd/+0eJED7yKjMv 06eJMgfjTnuyxT2IABG2F5UllLi8w09fq1VDC1wVFoeXiBh1cvAvxKlhfvq99Y/LPZLA fNfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709212033; x=1709816833; 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=3uIfY5ntnNufGy4UYEPo9i3yGnfffKpCKmKs8Z7x9Cg=; b=jJ942SXaX7v/Dn3GCNSmW2rludTgmJJefyu7Ml4nx44cuQ9mQOd8vxILxybWIi/aVr 9qmhLgtBrzxTU5adxVqeL18h0qKpRB+hi4g4CG5z5/77Ctdi7Cu4j4T9Ml0xr4WVrlTK +79eiktYJ1H5Awt7jz3VUhVIucTYNZaXtHiXqeaUM6+cE2pVdrLmabzGACUREq201PO/ hOLPjqlGZ0dBDkqoFOOkLgY29NwsIurfivl4qGqAMV+ej9ZggUvTdScXq9n3LR9eYY6D bSDxVIj6i213qIWdCNbnGTVZy62zaHyE1kl868nojHpW5s4H8XU8jO4fJRSt7uGRARSR iTtA== X-Forwarded-Encrypted: i=1; AJvYcCWBNU6MDiAWqI+8xrCvwrDcN5ZC3akNEFCBceJ6F/co9d5lmgkiika72Fl7lP7Gy/qPoTsLx5YqONDyeKFOzrw1jx1briBfWnnDT1qbxg== X-Gm-Message-State: AOJu0YzG2A1cc8/QS7yHJ/UvU7IppQhr/NvH/fGmLYgGvhQYcvUoZgjp 8bdLRGMuJ2ZyuQeTC6k6e4PTql+41SMx3zCU6w0Fio8YaOJtqb2KDB7teW1K8j4= X-Google-Smtp-Source: AGHT+IFs4nV8miq0IK8B287pip+3Gpyj9/MX3VZQhKrSuFji1E+4+hZHhgsqd+s9dN8nbt2XIkHbiQ== X-Received: by 2002:a05:600c:1f07:b0:412:a0f9:391 with SMTP id bd7-20020a05600c1f0700b00412a0f90391mr1978004wmb.2.1709212033570; Thu, 29 Feb 2024 05:07:13 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id t7-20020a05600c198700b00412a38e732csm2071473wmq.35.2024.02.29.05.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 05:07:13 -0800 (PST) From: Neil Armstrong Date: Thu, 29 Feb 2024 14:07:03 +0100 Subject: [PATCH RFT 3/7] phy: qcom: qmp-combo: introduce QPHY_MODE MIME-Version: 1.0 Message-Id: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-3-07e24a231840@linaro.org> References: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> In-Reply-To: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2847; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=X1JC6Xko/brlq2AN9Kavl/JUaqcQsV6GNBW/pXtYk2g=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBl4IF7bR995LMpFRuBZdMowgnvRMAzKvP6HT+j6bBn u6qijAOJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZeCBewAKCRB33NvayMhJ0dQnD/ 4hNlvIyL/Ebb4vd28Lo3pt7v0cvIWPEgi6PPa/eZ5GmfzzRU6yKgZYIaKc6aJa6PVdZy5nOY534bbM C9Z5GPriw4NAxtshNm8QqBAjTU4JsnWWnjnFl/uh6vUJKjvvx8nmFLfTCiUU5Ld4Sjz72lq4BGQsdx CZBpiP+9l1wvfC0sQMHCZd8H3bbcw+kDOYbNaddUPUX9WBs0+/Gly0eD6RIppiPsVmI10kVcHCOPsV cDjdboIKv3VP5jgNKB59IjGgG94HLPR8sCyyWCpQsfT6NPsKER06GeDaEN+U1BOwwhivt8KbHtvIuW dYExHtEopydMXRbuK3RKSTNRt/aSp/NLcsSkX8Up4FtIYVc9sSov8qYuVpK8HgvtyUk5WbIKA+nLa3 OKTV5RsMCTcPBMreqQcGlYH45vYN7Fl6m1DANR5Hr1OvbvVkhu0uFpYPLLx8xuyopRHj7TZHllTAOP oDBgQDYry4ojq3ngLDPIEADXMe7wlZghvBUUHrSIIi6KWAroAjkLv0bljBNjhu+K2/oDxnlsTVi58a 4euoIMmLUHEhxyRea7K7Zdvcs7Th8kKZ3z6dSGR/00l/8v7INoyvCrXySk4Hqorx2ePkrsXHxwaYQi 2yrXhNLfgwlsZ/1jfqWVpnbKmyx2bZsv1dJp46javpCAf5/bNawRFV7P3ERQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_050715_438086_DB287DB5 X-CRM114-Status: GOOD ( 13.61 ) 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 Introduce an enum for the QMP Combo PHY modes, use it in the QMP commmon phy init function and default to COMBO mode. Signed-off-by: Neil Armstrong --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 41 +++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index 3721bbea9eae..ac5d528fd7a1 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -61,6 +61,12 @@ #define PHY_INIT_COMPLETE_TIMEOUT 10000 +enum qphy_mode { + QPHY_MODE_COMBO = 0, + QPHY_MODE_DP_ONLY, + QPHY_MODE_USB_ONLY, +}; + /* set of registers with offsets different per-PHY */ enum qphy_reg_layout { /* PCS registers */ @@ -1491,6 +1497,7 @@ struct qmp_combo { struct mutex phy_mutex; int init_count; + enum qphy_mode init_mode; struct phy *usb_phy; enum phy_mode mode; @@ -2531,12 +2538,33 @@ static int qmp_combo_com_init(struct qmp_combo *qmp, bool force) if (qmp->orientation == TYPEC_ORIENTATION_REVERSE) val |= SW_PORTSELECT_VAL; writel(val, com + QPHY_V3_DP_COM_TYPEC_CTRL); - writel(USB3_MODE | DP_MODE, com + QPHY_V3_DP_COM_PHY_MODE_CTRL); - /* bring both QMP USB and QMP DP PHYs PCS block out of reset */ - qphy_clrbits(com, QPHY_V3_DP_COM_RESET_OVRD_CTRL, - SW_DPPHY_RESET_MUX | SW_DPPHY_RESET | - SW_USB3PHY_RESET_MUX | SW_USB3PHY_RESET); + switch (qmp->init_mode) { + case QPHY_MODE_COMBO: + writel(USB3_MODE | DP_MODE, com + QPHY_V3_DP_COM_PHY_MODE_CTRL); + + /* bring both QMP USB and QMP DP PHYs PCS block out of reset */ + qphy_clrbits(com, QPHY_V3_DP_COM_RESET_OVRD_CTRL, + SW_DPPHY_RESET_MUX | SW_DPPHY_RESET | + SW_USB3PHY_RESET_MUX | SW_USB3PHY_RESET); + break; + + case QPHY_MODE_DP_ONLY: + writel(DP_MODE, com + QPHY_V3_DP_COM_PHY_MODE_CTRL); + + /* bring QMP DP PHY PCS block out of reset */ + qphy_clrbits(com, QPHY_V3_DP_COM_RESET_OVRD_CTRL, + SW_DPPHY_RESET_MUX | SW_DPPHY_RESET); + break; + + case QPHY_MODE_USB_ONLY: + writel(USB3_MODE, com + QPHY_V3_DP_COM_PHY_MODE_CTRL); + + /* bring QMP USB PHY PCS block out of reset */ + qphy_clrbits(com, QPHY_V3_DP_COM_RESET_OVRD_CTRL, + SW_USB3PHY_RESET_MUX | SW_USB3PHY_RESET); + break; + } qphy_clrbits(com, QPHY_V3_DP_COM_SWI_CTRL, 0x03); qphy_clrbits(com, QPHY_V3_DP_COM_SW_RESET, SW_RESET); @@ -3545,6 +3573,9 @@ static int qmp_combo_probe(struct platform_device *pdev) if (ret) goto err_node_put; + /* Set PHY_MODE as combo by default */ + qmp->init_mode = QPHY_MODE_COMBO; + qmp->usb_phy = devm_phy_create(dev, usb_np, &qmp_combo_usb_phy_ops); if (IS_ERR(qmp->usb_phy)) { ret = PTR_ERR(qmp->usb_phy); From patchwork Thu Feb 29 13:07:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13577090 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 7D79EC54E41 for ; Thu, 29 Feb 2024 13:07:24 +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=eerzSBOBZABz2kNiyy8TxpeWJG8mWKlzChxaxJwlgUM=; b=iYI6DN7HB7GZ3v ESfdu4f0rLgqSevnPcxjHVr5KnSGtdKT7z71QiQGeI8gMmcTNqqoCPyiwp+rcj0KfKH4FCT7P83JC niEEN7QAp+gBMgCoOlatjC1/6qL14XVZmDSd4SocI52+gnECWoOUwnm9UYVCuVi5+yA4u4wYAcfY4 SYpyK8p6ikD/ek88/skfpxOmHmkDMjh/ic932luI614aXaFfHv4lBj0KdFA8oZSKLz/xsD4bN1uDA RnCPZH4JiHo7pi2ZiMSm5MlfAD4fDwQTkEXGnv8TxjKD78gsdNkxcG5tKSgPQTMcymLKn8E3/vkmV Y8eBvyhxv08IlHXR0e2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg8C-0000000DbKj-0BqN; Thu, 29 Feb 2024 13:07:24 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg84-0000000DbGm-2Uiy for linux-phy@lists.infradead.org; Thu, 29 Feb 2024 13:07:18 +0000 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2d220e39907so11389891fa.1 for ; Thu, 29 Feb 2024 05:07:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709212034; x=1709816834; 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=NKmGfxd/NVrK3oICkt9QzVVMEnc4HPhnKzXpPWZI9wc=; b=FTV+F//B3XVixW3Ne77H4z0UIIEpkA9xKT5Nm4pqJryclZlG+JUpmRQCB5N21aRVqU IC68uucPv5yL7SnQ240XmVJpmPBhwd+NbVW8JcZ1/vUBzZFcJo+VVXhLH0oGstC9A4M0 34bmmSLoW2w7WgeFc0UYhUBcE5uCRf/n6yW5h3uu0KCrBI9QegxK07ZHbss5mMbDXii4 f4pDg+CnBfnwtqcnuDdPRCbpPYwZ9+IHHbnCGF3jzpj/WpSWbpiR3adwg8tS6bnb0hUd CbsyM9gHpiCnavSon/Q5/qk5CkLNTawC9V+GFjEO+vGQrGf01II0MqjuVqHNNK/Y14i6 sFWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709212034; x=1709816834; 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=NKmGfxd/NVrK3oICkt9QzVVMEnc4HPhnKzXpPWZI9wc=; b=N2T/DuNwkkn1eW5wYgC7NRVb9WbOCL4/drF68YfdOEKmcZwUAyZlb0QZoh7WeR+RJX stPlZz+nQ2hhxSQcKm+BrZS0mZ+nACuuza+LWK430rdVlQAkChUHbhEdqQtTeqcDohYR 1bGLQ5XdIKU7EvrfqLTvFnnzEn4OUEbSvVV3aLCpNvdqVQVSasJqiFUArbn+h3lR5Hdx oEzyDCL5b6nCzJ5hkWld2LmbTTLGctS9zkeZzOmPzOMz3u0atUgxOvLW6SrbEG29YAcq 9mbBdzdUhuIl4cgAukjJMQoNoXh4MX9vCesvEAA9rI74ThlPU/SWCVDQomRRsAAn5Clh KZ6Q== X-Forwarded-Encrypted: i=1; AJvYcCUeoNsz2uHJWDS4S8n1RXK5G9RO9nxMJA/VEKEWnta88mO1gpSW6Z5kB9j/V/9zqtUUi8toLsmC4nDGm8uFGHJTiLPLLNFsVplVwViy6w== X-Gm-Message-State: AOJu0YzkNCYmMNjg4uXFowRG0SrfzEZLbK9UBYMjF40tS4AgPAR4mvPu uEED5ZOmes8MM5sYRCKzq2rOls7dwotArYk2jozA6shll9G9eb4duuzxEFT2Gf0= X-Google-Smtp-Source: AGHT+IGR24vSDb8RIrJOJ8Dth9NKC6WKDL2EdYZtE+ndU6zKZmHhEng+l5nObyZHyGbpbWXbNcYbHw== X-Received: by 2002:a2e:9bcf:0:b0:2d2:b17a:1724 with SMTP id w15-20020a2e9bcf000000b002d2b17a1724mr1553831ljj.19.1709212034383; Thu, 29 Feb 2024 05:07:14 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id t7-20020a05600c198700b00412a38e732csm2071473wmq.35.2024.02.29.05.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 05:07:14 -0800 (PST) From: Neil Armstrong Date: Thu, 29 Feb 2024 14:07:04 +0100 Subject: [PATCH RFT 4/7] phy: qcom: qmp-combo: register a typec mux to change the QPHY_MODE MIME-Version: 1.0 Message-Id: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-4-07e24a231840@linaro.org> References: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> In-Reply-To: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=5554; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=t7JWKvorJKpCBAS06JzHB/6hZJNkPjNsbGQugGO0kcQ=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBl4IF8rwodAWtg5N0fR68RXcppecYMYPGcfqo3cu0l Q0LGw62JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZeCBfAAKCRB33NvayMhJ0eFBD/ 9wQivhDbwoLkYitiSMy6wkHuR0+EGcXTgcHDVgPvdv9z6VEKGktJY/dH1Ryd8SlLDDrp3TYkjyo57a b9I0M/mDpIy/fjO2heYWODYTWZCnxBaImG6OwLesXmugWh11+EDeBgB93yJpOfKN9wpoDf+hWLnwzV hQaMRUEIBG/EsrTuH0CMWsEnHeI2VEAD4vSPV86dTGGXZ7OI2avQ3LLHJpliV5iZRFUr/kT/673DxR kTrab6/Inm6uh8eu5CTmiI5jDx/LlVoS3GFUR8O+hgns4ExFvJdCe6UIk90kJrkYD6PQUAUaBbIwg+ KqhmQ5UY5nbxUekM/qd1QzEVyO9rU13L/Ao9Bl9pjcCo5g93WPvX+00d1GIo6Adz3Ug2ofcYd9Ahsp e1vAC8ySW+doSYkvyQO9c4PU5DHkD9O6VKaMh3iYUpz2X+TAWElcp2YC8YG1wQCvob4CNj2CGQlOXx fW2ZtXkDxbOiUDBozkL67xrJAKZW59nJJCPCfMXltJE1O8O5gj5xbtEKynNNzEwqJJzW7fwKv5stSe irfYC4vQYCeTHTvckJtFVhuNBdkWfAdZuRZgwoyCwcIqdMaQm+qO9E4fjgNWhKZbwEZUSa7vpifzVV 6sn4S9WE7Kpq7dxnZNao6KAqQAACYwo8qKEGwfN8HQ1LqrBoHPZoyFUDx3/w== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_050716_707508_0CCD3D25 X-CRM114-Status: GOOD ( 22.38 ) 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 Register a typec mux in order to change the PHY mode on the Type-C mux events depending on the mode and the svid when in Altmode setup. The DisplayPort phy should be left enabled if is still powered on by the DRM DisplayPort controller, so bail out until the DisplayPort PHY is not powered off. The Type-C Mode/SVID only changes on plug/unplug, and USB SAFE states will be set in between of USB-Only, Combo and DisplayPort Only so this will leave enough time to the DRM DisplayPort controller to turn of the DisplayPort PHY. Signed-off-by: Neil Armstrong --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 122 ++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 5 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index ac5d528fd7a1..b5fb6cbcf867 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -1515,6 +1516,10 @@ struct qmp_combo { struct typec_switch_dev *sw; enum typec_orientation orientation; + + struct typec_mux_dev *mux; + unsigned long mux_mode; + unsigned int svid; }; static void qmp_v3_dp_aux_init(struct qmp_combo *qmp); @@ -3295,17 +3300,111 @@ static int qmp_combo_typec_switch_set(struct typec_switch_dev *sw, return 0; } -static void qmp_combo_typec_unregister(void *data) +static int qmp_combo_typec_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *state) +{ + struct qmp_combo *qmp = typec_mux_get_drvdata(mux); + const struct qmp_phy_cfg *cfg = qmp->cfg; + enum qphy_mode new_mode; + unsigned int svid; + + if (state->mode == qmp->mode) + return 0; + + mutex_lock(&qmp->phy_mutex); + + if (state->alt) + svid = state->alt->svid; + else + svid = 0; // No SVID + + if (svid) { + switch (state->mode) { + /* DP Only */ + case TYPEC_DP_STATE_C: + case TYPEC_DP_STATE_E: + new_mode = QPHY_MODE_DP_ONLY; + break; + + /* DP + USB */ + case TYPEC_DP_STATE_D: + case TYPEC_DP_STATE_F: + /* Safe fallback...*/ + default: + new_mode = QPHY_MODE_COMBO; + break; + } + } else { + /* Only switch to USB_ONLY when we know we only have USB3 */ + if (qmp->mux_mode == TYPEC_MODE_USB3) + new_mode = QPHY_MODE_USB_ONLY; + else + new_mode = QPHY_MODE_COMBO; + } + + if (new_mode == qmp->init_mode) { + dev_dbg(qmp->dev, "typec_mux_set: same phy mode, bail out\n"); + qmp->mode = state->mode; + goto out; + } + + if (qmp->init_mode != QPHY_MODE_USB_ONLY && qmp->dp_powered_on) { + dev_dbg(qmp->dev, "typec_mux_set: DP is still powered on, delaying switch\n"); + goto out; + } + + dev_dbg(qmp->dev, "typec_mux_set: switching from phy mode %d to %d\n", + qmp->init_mode, new_mode); + + qmp->mux_mode = state->mode; + qmp->init_mode = new_mode; + + if (qmp->init_count) { + if (qmp->usb_init_count) + qmp_combo_usb_power_off(qmp->usb_phy); + if (qmp->dp_init_count) + writel(DP_PHY_PD_CTL_PSR_PWRDN, qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL); + qmp_combo_com_exit(qmp, true); + + /* Now everything's powered down, power up the right PHYs */ + + qmp_combo_com_init(qmp, true); + if (qmp->init_mode == QPHY_MODE_DP_ONLY && qmp->usb_init_count) { + qmp->usb_init_count--; + } else if (qmp->init_mode != QPHY_MODE_DP_ONLY) { + qmp_combo_usb_power_on(qmp->usb_phy); + if (!qmp->usb_init_count) + qmp->usb_init_count++; + } + if (qmp->init_mode != QPHY_MODE_USB_ONLY && qmp->dp_init_count) + cfg->dp_aux_init(qmp); + } + +out: + mutex_unlock(&qmp->phy_mutex); + + return 0; +} + +static void qmp_combo_typec_switch_unregister(void *data) { struct qmp_combo *qmp = data; typec_switch_unregister(qmp->sw); } -static int qmp_combo_typec_switch_register(struct qmp_combo *qmp) +static void qmp_combo_typec_mux_unregister(void *data) +{ + struct qmp_combo *qmp = data; + + typec_mux_unregister(qmp->mux); +} + +static int qmp_combo_typec_register(struct qmp_combo *qmp) { struct typec_switch_desc sw_desc = {}; + struct typec_mux_desc mux_desc = { }; struct device *dev = qmp->dev; + int ret; sw_desc.drvdata = qmp; sw_desc.fwnode = dev->fwnode; @@ -3316,10 +3415,23 @@ static int qmp_combo_typec_switch_register(struct qmp_combo *qmp) return PTR_ERR(qmp->sw); } - return devm_add_action_or_reset(dev, qmp_combo_typec_unregister, qmp); + ret = devm_add_action_or_reset(dev, qmp_combo_typec_switch_unregister, qmp); + if (ret) + return ret; + + mux_desc.drvdata = qmp; + mux_desc.fwnode = dev->fwnode; + mux_desc.set = qmp_combo_typec_mux_set; + qmp->mux = typec_mux_register(dev, &mux_desc); + if (IS_ERR(qmp->mux)) { + dev_err(dev, "Unable to register typec mux: %pe\n", qmp->mux); + return PTR_ERR(qmp->mux); + } + + return devm_add_action_or_reset(dev, qmp_combo_typec_mux_unregister, qmp); } #else -static int qmp_combo_typec_switch_register(struct qmp_combo *qmp) +static int qmp_combo_typec_register(struct qmp_combo *qmp) { return 0; } @@ -3532,7 +3644,7 @@ static int qmp_combo_probe(struct platform_device *pdev) if (ret) return ret; - ret = qmp_combo_typec_switch_register(qmp); + ret = qmp_combo_typec_register(qmp); if (ret) return ret; From patchwork Thu Feb 29 13:07:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13577091 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 038EAC48BF6 for ; Thu, 29 Feb 2024 13:07:25 +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=f4WXgkQr/XrSRwV9CT8Ad+BmnUNXlImtrvGEe8mtFI4=; b=DnUtUmFIWYxp36 FsWPwvHw+bHyQR8faw94NTk/aptHpeVZChzaojDpcWpi7OMyecOER5/pjuo8XrOEhvgAuEw6JXJc2 FWyym1MwKEPBM5/cNmbIKW5CKuyygrXkvMfReKJKH7aHXkx4C4mvMPpaHFCU4+eF6xe06dsbj3Fp1 r9bJGlJxUsj0sMO6Z522bk/sUnPvdgnSMscTnPlTI15CQSfOSpdPB2HAaHIGKWxd0ZN+zjfUdAqod pXHgLIVkQ6fHYA0xxJL7RIJ2sV6xvkp0FnRoMI0hjD8Ytq9SL4KIcB2yuGJVekycF5TYPPdwar4uJ 1yC5qv15AKv0vfMKcyWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg8C-0000000DbLA-2GVY; Thu, 29 Feb 2024 13:07:24 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg85-0000000DbHB-0KhJ for linux-phy@lists.infradead.org; Thu, 29 Feb 2024 13:07:19 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-412b99eb5cfso6018955e9.3 for ; Thu, 29 Feb 2024 05:07:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709212035; x=1709816835; 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=djTK4QWx2RqxzGqF8Cq4ZaFcpyWxxa+r0xmgHQrJJjM=; b=dCkEBe3AQpFOWxHGH4NXX3a9kGHS2J/bArcJgzYmoP+odJ+9aO0HD1oqexSKQXYiYq vdWZKtiGBRPCIJhOhZaNqZ5/VFhZUV/P6b345sf6Z4PEhC5aK6nnAVL1MKa7/mSZoOG1 Cke2teDFQnrxgqZLRlD48LSlMX4yxcMtunl+z9ATHU7X1lN60yoO4qdCFvczxh0fjMyF w06mWH8RMLhsAFZXH7LoIMADJmri3VtlHtatDejoZUAMTP+j1P2hKLPkLeq4/cLZn3AZ Ha2uY6Vxh7xgoOAsTkja9Y2mN1OEpk/GR3eGsau9lhPwqQQjJZGY57QilvZH9RtQtpxt DuSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709212035; x=1709816835; 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=djTK4QWx2RqxzGqF8Cq4ZaFcpyWxxa+r0xmgHQrJJjM=; b=n2Yq4hy2dvA/HYOmN2GAzkXRfV6zsXwxC3lJD1joPGo4RJnC9C/YBOT/T8dwUkNGln DOYBv+BH+PI17QhhTO+s7GQuOTtTeHUeaJXDAel5s7iTCSI+/HxTnSfcSAkjaxGqHBeL /9QLQ7zaJgLsRbHkyJw4+JbjmnTjQ4PZmUVrn0T5CbaneKAFzV6vOZ7gZ501+SeBx1DU q0Yu63rW7iz/jWbRsTwLv2VzTZvKCqMzjxwbvnSF4NHz6gZ45FL9hQRFKmUZx0Oakb3x U+x2H60ioR+9EDllC8IiD7p1WQUqBr9Njkfsb/p8J7IQFTDSQ34rfgvAycNquxhLxtAU lWZA== X-Forwarded-Encrypted: i=1; AJvYcCWU7m1ybAX1hwtA1oDpu+YlhnSAmg08WdlnVSQldHk9DWnUQE6tqXSU4WlKGAfEDnfSpNzeepMs5qppLI4RlUMbL/3JjtrRXOeNTorzAA== X-Gm-Message-State: AOJu0YyHOC8BiqGAcM3r/A59pVu0kRZ/9rz7zMiMqmKFitV+lpDQmX5A PGx6uZcIBK5qeaHVqrB6lBBGdtQhMwAk8JrAGA9hpkkUnz7dq3nFJf+i54eDIMk= X-Google-Smtp-Source: AGHT+IFsLBUQujeobwIe+PBXF8p9tO8MDxUnuJMHt7vo2bYz6hqUMOeD8rjeD66N7xF8fiNb7HaPxQ== X-Received: by 2002:a05:600c:1c15:b0:412:b2fe:6e46 with SMTP id j21-20020a05600c1c1500b00412b2fe6e46mr1883397wms.27.1709212035213; Thu, 29 Feb 2024 05:07:15 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id t7-20020a05600c198700b00412a38e732csm2071473wmq.35.2024.02.29.05.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 05:07:14 -0800 (PST) From: Neil Armstrong Date: Thu, 29 Feb 2024 14:07:05 +0100 Subject: [PATCH RFT 5/7] arm64: dts: qcom-sm8550: allow 4 lanes for DisplayPort and enable QMP PHY mode-switch MIME-Version: 1.0 Message-Id: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-5-07e24a231840@linaro.org> References: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> In-Reply-To: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1519; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=58NUV9okk92amQIHcmrvyddywNRiyxMSOvtlK9kind0=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBl4IF8UDzf8qs6mL+cMusxdeoc3fQAwLA0KUeC2ovw E+lkVHyJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZeCBfAAKCRB33NvayMhJ0YrKD/ 4m2Kis3LNB77dZB8vYp62njN8b2m/hqcE4OG8BzKDNwroowc1vKqWlvzjhknEKJQOF5oZX3iRLJ556 gB7oNGWgcrA1bHQqiOXEGIRXiHfrc9Potve9hyBNS1XaiftpnMbrQ5gdAhUQ8+2SocAssdXYjp76TZ vmU3lEQeo5nObYKlT7QAzxd7GdobWi1no2PmgJ9+SX9SbJBw7Tm+qsqXnSFJ+oZUOee2tEBMpVHYRH 54EMJDa+5KxnG+1NkbbDgNGiFajVRxgszB8+R446IB8CO7Z+DPmUj/whiB/iKoP19tpnMzzOX+nWVl +H4o6r7ihQKPXlnREoWvpZ14SdBwPooMrbl0fLG5T2YPDF+d0V8ntAe8CENos4UwcT4qe7T1gKjsuc KicVy2iEj5Ico2k7p5PjJZBgwnss3EY3UeTaYhw29rzq+bV88S/x0OIDd1PnGu1+truO75zE9Se/fQ GpP3EW5x+2xpo0C8sgNdlQT3ApgAO3aOyYvuWBxnloZEWyjHl3Dbaf1JSGVzm6afRFNzm48FdmWaA3 G/bZA95MZngsBvzmZlx2DArbQhXskVmiC+NZJWAmoX8bXtkCrTBt3qpC2HUcV0yZgGR92b6CUTeshF lZ5821eZyd7/ObrNZz3ZaniVEz0Q3pbGEIIjYiktwvlN3oCbGBXVwmpyzlqw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_050717_242700_E909D590 X-CRM114-Status: UNSURE ( 9.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 Allow up to 4 lanes for the DisplayPort link from the PHY to the Controller and allow mode-switch events to the QMP Combo PHY. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/qcom/sm8550-hdk.dts | 3 ++- arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8550-hdk.dts b/arch/arm64/boot/dts/qcom/sm8550-hdk.dts index 12d60a0ee095..86d6f993acd5 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-hdk.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-hdk.dts @@ -941,7 +941,7 @@ &mdss_dp0 { &mdss_dp0_out { remote-endpoint = <&usb_dp_qmpphy_dp_in>; - data-lanes = <0 1>; + data-lanes = <0 1 2 3>; }; &pcie0 { @@ -1284,6 +1284,7 @@ &usb_dp_qmpphy { vdda-phy-supply = <&vreg_l3e_1p2>; vdda-pll-supply = <&vreg_l3f_0p88>; + mode-switch; orientation-switch; status = "okay"; diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts index 92f015017418..2f6c76c9a135 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts @@ -806,7 +806,7 @@ &mdss_dp0 { }; &mdss_dp0_out { - data-lanes = <0 1>; + data-lanes = <0 1 2 3>; remote-endpoint = <&usb_dp_qmpphy_dp_in>; }; @@ -1161,6 +1161,7 @@ &usb_dp_qmpphy { vdda-phy-supply = <&vreg_l3e_1p2>; vdda-pll-supply = <&vreg_l3f_0p88>; + mode-switch; orientation-switch; status = "okay"; From patchwork Thu Feb 29 13:07:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13577093 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 9415CC54E49 for ; Thu, 29 Feb 2024 13:07:25 +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=6I8NhMK7UAooWJ3FDM46mod/GT/qQw6D4M9XiyiER5Y=; b=G+9pKlg7Bt9eyn KfvYp+MbXb0+NrAUikTP4hZnwn2+Tf0gTjZdDyNjGWfXmwwuL0cb0hpa7Lk6Wrwxta+2kt9HUdh1K I5o3aCQteFMm17T6aSsyx+80/D9yLvXhlb0CAkZmOHAAI7DCPx2rF8gaqQIVqgKp+rXFKxKGmOC2F 3tSCfXlDMHEv8uvjU6N80aehDxTjv2r2Dcxq6KNs6SyfjluswoxZdDI2j1VLEYiDUSBY8gk6ldbBk m02xEu2+SyRBn+Q/TkS2THSIoG5dPk0CO19qMo7Uvcyv2DP1OjvGU+DEDH05o11uupvUccVxrMUV+ ZFF+VQq7Qa7pviWVTjFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg8D-0000000DbLQ-034g; Thu, 29 Feb 2024 13:07:25 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg86-0000000DbHc-1lIR for linux-phy@lists.infradead.org; Thu, 29 Feb 2024 13:07:20 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2d311081954so4409611fa.2 for ; Thu, 29 Feb 2024 05:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709212036; x=1709816836; 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=Xt1W5faP85PAWQumOAeVXjmBkQB+qfkabp5eD5nJ+aI=; b=Lrn4eFmeBcgG6R8b30rnZhtqCVYOyjGbGdgAIvTzA/FKFjKAzK6qJ0p6/D65CYJsDF H8UULtiQZVEgXkHlwuFYa53fdu6A1MrmkpfhfWb9zyRFWFVylj5I1Y3jEPttf2xANTPG 1ybRoyK10d7P/EKlZhSPdnICuM+BtV1GRqEnMcnqtKlfNP97w8kLO1SXe+zx/+BzaDPH ZMF+hbPUlMD/41lGewh12R1evOnYizUNm3ZW5HZnyshr3sNp59lbJCUIp/a2K1l2EEMF KTGYDjVg9hsMRPr0DxV/iCs2n7P+m1W4hc8gqOQ8cQgq2ZNjX5D5HDnoHbIU1680WRR9 UxdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709212036; x=1709816836; 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=Xt1W5faP85PAWQumOAeVXjmBkQB+qfkabp5eD5nJ+aI=; b=UF44cjYR2JppdrGT0+JIw4GwB7QTkHoyS3ncO6VI9x1Z3motcM7drSUhACmUMPtx0u rc1UEwu5LluwvYh8FSz4am4vUmXGrooA9ZUV7trKoerFeFAk+PupE+7xLT7iUhIb4OnI j3d44rFrRiu2FXA0LrSxqyupMjSDcPbTLAVz6//mqDukMeMpql2iBiyCBVK4WcvQ5cn3 0W+q4cqUXCg7Ddvh+Vdy3sr4Z73vI3YyeXfCAdiLKrpArWr1Gv044/AyMOomm63PE43e Gx69psoi+xmK7tTNLuYcA2pOEt0SZPFDoFLIbJszAxPDbimC+L2/VNiqyDQwbESADtwZ 6Ehw== X-Forwarded-Encrypted: i=1; AJvYcCXXiXNsccc5O4U6H6JtYrZLGOyMeIVK6UHiAak/+xXtXW72p91MaqNYqWzmVf8cH5/1P+XU5ys2yl1ux3/HARzZ5OmwbBVheirm4OSQsA== X-Gm-Message-State: AOJu0Yz/A3KlCmH/k+uSgeEmIwRPjuQmaQEsUK+XZMuBjZ/A1cUWJNKs aJ/IiNVYJqo8hqsoy318B8SGaq53AJcL1BCeXgIS0NLCqBFqe8Z0g+2aO17U8Oc= X-Google-Smtp-Source: AGHT+IEC7e7Knw0M0ILVJfYrukKdzBj70uBdk2cN9FZc2XJm4ZtvVGGvMvO0ORqpmrytaQdJgTB8Uw== X-Received: by 2002:a2e:925a:0:b0:2d3:1f1:d408 with SMTP id v26-20020a2e925a000000b002d301f1d408mr1330088ljg.0.1709212036293; Thu, 29 Feb 2024 05:07:16 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id t7-20020a05600c198700b00412a38e732csm2071473wmq.35.2024.02.29.05.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 05:07:15 -0800 (PST) From: Neil Armstrong Date: Thu, 29 Feb 2024 14:07:06 +0100 Subject: [PATCH RFT 6/7] arm64: dts: qcom-sm8650: allow 4 lanes for DisplayPort and enable QMP PHY mode-switch MIME-Version: 1.0 Message-Id: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-6-07e24a231840@linaro.org> References: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> In-Reply-To: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=886; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=AX7XuHTDoRahKMAp+cH7GEaNZR5Qd0pBmGI8tAPbhQ8=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBl4IF90QBAS6ajIUqSeE3L+wyYvQnNnniQUAW+vzOK eUT0lRyJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZeCBfQAKCRB33NvayMhJ0QSKD/ wLsTQUePv4/u6Ehr2mKU2piyxeS9kM3cXKqGejQlkzPnv3M7ZpQ1aBv7bEybprYefYzmXUYhUsZu3W si2yvhUGPAzp3Sp8LlwlewM2vSXzc8/dHPlbsKwv4fBGIu6wkmSmMPh/Hzq6Qegr15ZiRoIwqcYcEF dKgPUOOx+LnCqhDJSBBTXRg/O8bSk8BvbKlrHBDZg0p9tnCNCelDCX0LnmGkx63qAShDfeo7p1zaUa 7BLK0L7awpxrpl3lQS6oFuwASHNvitTmtd7Frdj4/jeLwpFUKtsgshPB9Sq9q4aww1I9bbPV7TuUZb IpldH0pK/KF/i26xmmnpEkb6O2xZ9cF9YqnO/NHs50dFxSr4ib8ERzmxoaIADSg7iMDqg7U+zn+t5r eAfx5xY93P8F5XhOfNlP2VUy/XEedGbsk1kkKUqk6yTTRhRLb6bygCTJ+gA/JUXfUhJ5VDkNKeQcIa DNohs2UT28UVehlsWXNVXi70MhrhPf9dfA8OP5hRoeDyAcaZAb6tnFqFLQm+Fgc8bw1uV7VDjZPGuW VF9yUabDeOmONuSFiF4bRDvPHbsPS6Vh8mgp8jnV/mR/BHMQGvDwpKjx3k0rYMAj9Hv1DV5mEViwKh P5oazDg0p9ax/nYsywImDJ0ACTkhQEJGsapxg10X3IwPZw4enUXIf2fWTOEw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_050718_700118_A532A8E2 X-CRM114-Status: UNSURE ( 9.27 ) 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 Allow up to 4 lanes for the DisplayPort link from the PHY to the Controller and allow mode-switch events to the QMP Combo PHY. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts index b07cac2e5bc8..35259ebd07ce 100644 --- a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts @@ -823,7 +823,7 @@ &mdss_dp0 { }; &mdss_dp0_out { - data-lanes = <0 1>; + data-lanes = <0 1 2 3>; remote-endpoint = <&usb_dp_qmpphy_dp_in>; }; @@ -1224,6 +1224,7 @@ &usb_dp_qmpphy { vdda-phy-supply = <&vreg_l3i_1p2>; vdda-pll-supply = <&vreg_l3g_0p91>; + mode-switch; orientation-switch; status = "okay"; From patchwork Thu Feb 29 13:07:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13577092 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 08185C54E4A for ; Thu, 29 Feb 2024 13:07:26 +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=p6lC9r4P5Vkb2g+WAoLU2jOwmQrODcRftAQGvcnHyVw=; b=05JFE0OmpYimvH yL18D+wg0YSCpc2JZIWzVQNwVCWWaQtiLZh5rvbHh7yFRWMxF7lVGxgrXVAxJepTw46FXcgRL1JEr cywMqP6na4nocp0ifJiguWqIXMKLMIL4BPqy9DlIHUm67LA2wrBT4ev7GbqHoKRDRBOCQvMNd/+VX 8kzl7IBnYMSG6QfcCWEuIPnHsq1Z4zXv+SwJYXERw6ot0fOPSintfZ3eQtf4y1LqlPTuybkWgP/KJ jjEwyIoOHsQDIAO3Jro1ZrfQCYPc3ZE+XgSbbWAfZmQ2tRSqMQXrdudw08Z/tdEWZQrGSjakNervO 6Z68Gv5PbqQqXEchJ5bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg8D-0000000DbLj-1iIJ; Thu, 29 Feb 2024 13:07:25 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfg86-0000000DbIf-2POh for linux-phy@lists.infradead.org; Thu, 29 Feb 2024 13:07:20 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-412c24280ffso1376845e9.3 for ; Thu, 29 Feb 2024 05:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709212037; x=1709816837; 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=fywjC4h+f6+K3smJr1nJvUkccespMrFvMNirPgXOt7Q=; b=VOe4yp4EaQcHNRIphxFV7I5SevIcAnuxYWtDTpja+sc7wT2xfYuUT6VH0hcQ/DC7tF KvWWknhn8tRvr3LAI1N5Nt7PctOMIrmnOdWRmnOuVFDSOO1CjVLxCBZGXKzxoT5fw4Ml B7SWI48/4UG8JKA1KzG3nc2DSVgAHHuv18Ekqw1eVpt9m8XaoguUgJW/Ho5R9Gxwzztq 0xawkTD1FdxH7VBPMlVcNMF20JUxFO8a73ZRJWEkmA+itGY92DpqhEO6YcOv7b1+uDMh mT7mdzZ3en9vRsYhPOFHCjjSIgHfVr/seuieLevXRGeGmUceb7Xr1h27G4FvDvnpIssf 9uSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709212037; x=1709816837; 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=fywjC4h+f6+K3smJr1nJvUkccespMrFvMNirPgXOt7Q=; b=nu4nmkD4HQ4gtqhai+RIYU2CKcs48TDN5mzFUDq7/1BuSRgvxNtVr2wimw0MktRAM7 QoJpy1wB/aarqxwOTxHqumaiEpPjKCGIqQN63Y1NxlIVlXvxGF2n6dZcjhDRuRl34Td6 Yqw+RzrlmplY7XY3n6Jt4vtlFzvBA1s1YsKbx0rl09RYuFtkpnfSU336c6n7O1mmqXHV XdzohQe/tNTAym04o+01BPQdPTARCvqp5+LraFvfFr7qigBbqJOAWGu24LAehxxcYZ4A dfRcEPtsnJ3WjIh3pD3igdjjuGRAvdpSVN1TX8S3LWavB7qso2JSd8IGS86ZW6NTnX1s 1BGg== X-Forwarded-Encrypted: i=1; AJvYcCVKOmpJlLwJFOxTG5vZCOCNfDqfMumOdRObChXq5X6aowLmsfMyS/MLUr8v741CKUYd0H3AAaiaDW0fO9UOdnlH/RxysmmVvSfINsO73Q== X-Gm-Message-State: AOJu0YweXJ2I1mET9WrnQ3hSSf8gNIkBIMbiqPAKKSJ6LEWGiGWxDCA1 w0dKleDsm9IZWrple/lxHS+AnH4Et1WSfW2a0fST2OhRuZsK1cwp4WDlc7EA6UfbGWCOvnRXeVs VSSU= X-Google-Smtp-Source: AGHT+IF5SHeIBv4y7JFQoUnfwEl/nga/kneK6KmwsmHQJMRK9styGPFjelcmVyl29oT75A+1YByctw== X-Received: by 2002:a05:600c:4fc6:b0:412:c1e0:e95c with SMTP id o6-20020a05600c4fc600b00412c1e0e95cmr550358wmq.12.1709212037288; Thu, 29 Feb 2024 05:07:17 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id t7-20020a05600c198700b00412a38e732csm2071473wmq.35.2024.02.29.05.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 05:07:16 -0800 (PST) From: Neil Armstrong Date: Thu, 29 Feb 2024 14:07:07 +0100 Subject: [PATCH RFT 7/7] arm64: dts: qcom-mode-switch: allow 4 lanes for DisplayPort and enable QMP PHY mode-switch MIME-Version: 1.0 Message-Id: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-7-07e24a231840@linaro.org> References: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> In-Reply-To: <20240229-topic-sm8x50-upstream-phy-combo-typec-mux-v1-0-07e24a231840@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1314; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=MsxEEfnne02nqOkZki/+nigAQ0nhYoGqJj7vVZuWZn0=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBl4IF9MdD4p3qfj/k9iDx4mHLqSVCaj4RDbCJRWBM7 p5FfNVGJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZeCBfQAKCRB33NvayMhJ0QkJD/ sElXkF1lTcwKxlvSHshNzoZANrB1IsApIQKCsylEXa3rV848swZ0XipoTQ+DlYBLwtQZlFbQuMLW+V lQBLxxZ1hRmjE8c8vBzqVPtWwsBDdkzli/VeDPA4/iV4qsZ8L0ZGXyv7QE/Rj4sCAORdCo0m63M+io rJ8MXfFUVeWcHhYizPLjjJ/4x6M4Hl3oe2hbCRjUS4h1rbz+rIA/4/sQ0fzzw4R0Fut3rIczCKetkL nWSwyzsAw9PLfa2Gr58/Y84zGs4/MoLq7hGxndGx6VK9VO56tHz68/O7QANPe91Bmm3dZ+9fN8T8P3 YSFhK/ZaxXpvzPP8tNcvCzuhu6JiN/bal6NlNWqen6edtPsRFKgQP2Y56dsoExRw3vTi8OQWFjO81b jb6aSVR1rI/PTIDKVRPvG6oy12Ili+6haJwq/ZhKUQYd2JL4d5GFGxE5NcLXs7NEnpZq1coyblzbM1 NbD8qCEzRPIyK/2mAa0UEiDmhURs56Yx9vNe9DWRL/Jxeyt6Hx5c5trKuzHNBmFJZxy5hZsiTCB6+m 7kCy2PPviHgmk+mhTgTZrZPuvTrtonz96w0o3ZKL4vaMgIi8mfz2YSK4Oj6tsbZ5eO7URXeiPj0hte XDz+8cgf6uMz9YxJ2A9fxXwG41jlapzlRtdeabuWBo4mIWY2P0yk2b5GIXbA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_050718_855948_A77E77D4 X-CRM114-Status: UNSURE ( 9.07 ) 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 Allow up to 4 lanes for the DisplayPort link from the PHYs to the Controllers and allow mode-switch events to the QMP Combo PHYs. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index a0fdef55a40a..6c73e0fc001f 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -556,7 +556,7 @@ &mdss0_dp0 { }; &mdss0_dp0_out { - data-lanes = <0 1>; + data-lanes = <0 1 2 3>; remote-endpoint = <&usb_0_qmpphy_dp_in>; }; @@ -565,7 +565,7 @@ &mdss0_dp1 { }; &mdss0_dp1_out { - data-lanes = <0 1>; + data-lanes = <0 1 2 3>; remote-endpoint = <&usb_1_qmpphy_dp_in>; }; @@ -1112,6 +1112,7 @@ &usb_0_qmpphy { vdda-phy-supply = <&vreg_l9d>; vdda-pll-supply = <&vreg_l4d>; + mode-switch; orientation-switch; status = "okay"; @@ -1149,6 +1150,7 @@ &usb_1_qmpphy { vdda-phy-supply = <&vreg_l4b>; vdda-pll-supply = <&vreg_l3b>; + mode-switch; orientation-switch; status = "okay";