From patchwork Mon May 27 08:42:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13674859 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 0388BC25B7C for ; Mon, 27 May 2024 08:42:52 +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=ubQRgU/yYzfnOjV3JhVFTUraFaeLh3ZCjM7PDSjT+fY=; b=HoNj2UHY2nwrz0 W/QBd4QF7ovwBIg0FQK85D5v1pekiEj2VT8jdg4tiI9MBQGgdy0Rr5UGHXO06eRBjpYNMCpu4XCXL jW57rAVIhv0SYXQdZphKjEOFbVqBG43lIGexlnqGaVdP7NVpNzZTeepUJwyFeKDvR5H5dGgEoAvKw oC0jLlA7zVKVvfONUMYvFyMKveRNZjKxEhpQ40i+06vMV/+lLFKfzXju2N/D3nfZET5ESlkpmERiT 8x03WqM3G+KEagC8dBNtq8YFfJimLhZG8+ZLoaUhwNKsv7OV4MKM4a/tft4jZopAS0HlgEQdd6h9z nYt1vQw775+QzU75vlfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwR-0000000EHJb-23lv; Mon, 27 May 2024 08:42:51 +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 1sBVwO-0000000EHGb-2sWF for linux-phy@lists.infradead.org; Mon, 27 May 2024 08:42:50 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2e724bc466fso96581851fa.3 for ; Mon, 27 May 2024 01:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716799365; x=1717404165; 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=wYVqqrufrlU4tP6uYGCro4lra2OX39FvNlNmisAjzCU=; b=d2QHS9BJrKTgu14ymMithvYsBPjpq/3vvLGqwvZbQQvYGvzKzws0Rrps1z4alOWZfK vaWD5Jp/5VWRLiWesmN+OrEr+AL2ZpvJ14B3oe92pC67+VrVJM/e0/HHp2x9ZiXo2Ibt 8mUE1SKcTG9HZ7cDgfklN74s4ysg90EK5l8VBwLQJV2L3u0ljMFcOZeewHuZ9s+QGErC ax4cMhnxnUQKxndcaAUJ0QS0NtJ8wlPvPKMpEo9l26oJrGosEtFQtFcH7XJkWzTTtDkU H0CguCcJvXtkvuom75MBkpfME+Lll+LrroEC0cXDaEhQe3XFU6mBdIUj1R3HSCCa0DuC YHlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716799365; x=1717404165; 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=wYVqqrufrlU4tP6uYGCro4lra2OX39FvNlNmisAjzCU=; b=UbtCpqeCh9VULf3sqJUJugDZTRj6CHUkBnXIQKNWIwje3hG3TcrfUOPSv7zpwB4DSC u08uMETwuFEOsUvPjYdV1kSch+/3eI0D4zQ2Z1P8wSQ7r/C3HKnfmm4kcm+mGFO0sxA0 QfZJviPFq2KXS4ToINNO9CzimxOmnpepfE4AqYUYsFfxvie439S/X2avV6b8RLC0ZgI9 ZCAcc8luotP9e+HN+XDs8ooIAbKQqr7o4PU/Oam95dG/OirGYTyimD9NIsdRnVNs2zdi KD+yT9Jc1f7pBW5EjHxFfu4GEVPDfnXsqvAxVB+HR2DqvSgBioLP2sjBGUqndhMa9IrN PMxA== X-Forwarded-Encrypted: i=1; AJvYcCU7mQ3cHNf0fAU6Z3CB2vwSerGroLqDOVbr+OdO9xixYBl9NOFQG3xjhGydRfg8JmF7JCUmckGi1Lkl/erdYJcmS+pctF8RMlzTxl3tkQ== X-Gm-Message-State: AOJu0YwSDh2HqLT7AbPkfCzGy8ktYtHAPn4D5iRe+FpWAXvOudO/cqCq sKhPknw42nuqu2QX7VUKMnR4Z6bNmZq3b4dGBmSqi9ddDZ66DtYKCRfwHPR3kqQ= X-Google-Smtp-Source: AGHT+IGqVjhmpV6P5dYKIK4bQm7p4J/a/8bHzzCxS0JX9QjuVHpgXeL4JdCcI+kWd/pi8uJ22Nc/vQ== X-Received: by 2002:a05:651c:1992:b0:2e7:1e4a:31d3 with SMTP id 38308e7fff4ca-2e95b097761mr98346481fa.16.1716799362952; Mon, 27 May 2024 01:42:42 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3558889fb57sm8447292f8f.114.2024.05.27.01.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 01:42:42 -0700 (PDT) From: Neil Armstrong Date: Mon, 27 May 2024 10:42:33 +0200 Subject: [PATCH v2 1/7] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp: Reference usb-switch.yaml to allow mode-switch MIME-Version: 1.0 Message-Id: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-1-a03e68d7b8fc@linaro.org> References: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> In-Reply-To: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Krzysztof Kozlowski 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.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1520; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=FSjR/z57MPpK+sFVQN3f9Y5HY3fXrry6aEHjLvU6BMI=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmVEd8GmfhAqkq4Fqoj88/8nK66iClT54YKRfYfb0P 0PAPK7+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZlRHfAAKCRB33NvayMhJ0Q0nD/ kBMcULAeJSxBGlLBsUcLneHOfYhQd3mHi+3AO40RXHfYiJ/HadsPEmSIK6u5QxD+p9eKXY6IBqfE+L IP1psTwbYV59r9PQclAq+evAa0bpzxtlHXIt9tH/hncy6Lj5fSYImp5GvMFdLZy3hgPcZtNfxmgDc+ obFtz6z9+9R/5OaKbFf/gofv+/Djfw1H0V1zX8r1gzws1fTQGUnPqXQcuV704oKNT8k3Lcbbhnm72A SJgbW/jT7H98OM42FjJQn26g6MOdrL4bvCVj9htpoNZIEgv1l6U5wEWx9VhnfTnJjJKUO85mOXqGeo GT55odHIc+yy6nyZtlk8sCEVWb5Tc2hY9akaeF1HL6iYkT8OUGOETN4YqEs5F6B1h8xEUZf11F0lNI +KbxRgq9nb27IapqLzD2RGKRl6E4JJGG+63A2jxZ7mhp1HHddOTTGXnCqsvRQuY+jyhCLIx/XqpNz4 MsA6SocfppaHs2Vse1Om19Xsbvl/yXqmw5PlOPcp7UO0IxWywKVhZp/9EgJVI8WdwRpps4fkDgDBtu MJ/leX8S5QAiwCCJxz/sekNnBmYC07ILgdMkmMLhgrHoZAwmoAbo/HaA65JV6Dk2LHyMtk4aYbfOJX jO3weNYZlRKf/xhplQ5j13g5oi/kTsfRzIpOO3HztKCljQIj2ssFvsNPWRzA== 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-20240527_014248_813699_DE0E989B X-CRM114-Status: UNSURE ( 8.84 ) 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. Reference usb-switch.yaml as a simpler way to allow the mode-switch property instead of duplicating the property definition. Signed-off-by: Neil Armstrong Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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..5358d3a6fde3 100644 --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml @@ -71,10 +71,8 @@ properties: description: See include/dt-bindings/phy/phy-qcom-qmp.h - orientation-switch: - description: - Flag the PHY as possible handler of USB Type-C orientation switching - type: boolean + mode-switch: true + orientation-switch: true ports: $ref: /schemas/graph.yaml#/properties/ports @@ -104,6 +102,7 @@ required: - "#phy-cells" allOf: + - $ref: /schemas/usb/usb-switch.yaml# - if: properties: compatible: From patchwork Mon May 27 08:42:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13674860 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 4F159C25B74 for ; Mon, 27 May 2024 08:42:52 +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=awhTSBViwD6625hl81u/pe1HQMsd2Qe3qmXMaIxmzqM=; b=rLDLmPAMf83T4p W4NOcwCEu/FdjQssHLkuhXF47p7Q53H5EIFljESjohdjUY/Eo0IlrL443++qg7eGAf69t4Xo1ezVD obkVEcZOM7DtVNmvIGocnClQzBYLagO1b0Lds2zOkcl8fNnRz9HKH/UMCy0piP+5It5/zCD7rzxkv t8N37On3SDiKMif1eV5nwgWcwP9Rup/rAcAQrlB7VA0P66zQRqUxPdUnV2EVS6dNko+SS4YL/X8qm 0MvNDp5N4iV8fHjqmLHyaEcxALxkz74mjxdm4GNcUDNoRoNgfMNn14pPTYvCQVBZ2uRSqtcIQQZ4d Rn89L6F7BA+Saht4T62g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwR-0000000EHJs-3yqU; Mon, 27 May 2024 08:42:51 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwO-0000000EHGo-408S for linux-phy@lists.infradead.org; Mon, 27 May 2024 08:42:50 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-354be94c874so3907490f8f.3 for ; Mon, 27 May 2024 01:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716799366; x=1717404166; 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=D2IsXERwwkHQn+Hp66Wd5IbKCroL6ys71asrAFeZRd0=; b=v7gkUXVakUaCMupsXrQ37u1VDxC9CcPiN/JMaZvunzlRSW0hVvh5mrc+d8r04qiym8 7RQskHL1UdE7fgMl3Hs8toVfcFvKCrTkwTw6WGEvvBjXE1NzqibJ6WOM8ZdAVFRiDStK t3Y4sptwc3CYMWkaQbXywdOqAEy8bRs9fItCXi8MVl8JuVgP1gEGApQfju4C8nIr+5ia S6i7CP0TOGYM5QCri07c01/4uosnBn2Bj0jsj5ugbnxcF9kfqFlSsrsmYMhERq4kFvv/ OOjUCGeTapz97i48Q+HeWVryq24oM9M+lhKgTiRAx9+krewrLYNYBRCjSFgy0IkHQF/i 80YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716799366; x=1717404166; 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=D2IsXERwwkHQn+Hp66Wd5IbKCroL6ys71asrAFeZRd0=; b=N0Yt4+YSQScR9Bk1mpjgBqI5e4Wc2ueyzxRN6gOeQbP4YOZWnkajOamoMO7Oj84JQE A2oPPiyv4RNqspRMZq1Rn9UMkeUzM7Cu/BBjC/sRB24CjaLpACmsz5+L0KxYkgaFcV3L bjlAzMoTjqLVcqvfT3YXca8AaAA8leQfzQdINHNJuFVK4yNRYO41FtrTi1TnRtKzUNnB kuFOY2QHv4OGtzGi3Io1ZClEfYmPBm2JFSXnvsYV2PTPfofYBaIMu68B8nrRfiYUNQ1b pfP++DNW9MoFYNoor3CcttbXfUocD1hWwBhOA8dmKB08C4dnhh17sEIr13TD8BZK7Kfa qY9g== X-Forwarded-Encrypted: i=1; AJvYcCVxLEFFSXFqS70Zm9B+3wfyRvq8BsoQXDQfB2IGXr3y3p0wmfJST+glFCiUpSh/QYfDZqb+niqXqsIbdKN+V5hRGp3S+Hd0Mj/1PrWOiw== X-Gm-Message-State: AOJu0YxSHs2Hls5iMgrryysX5fmN2ehrBy8Xuc1Wod57LAUgMns+n46e 98zvsw/lymLXwE1d2eCrlUsaxMlVCv+C5zMy3i1UJckW++AoNPw5Dtm3s+5SEBg= X-Google-Smtp-Source: AGHT+IEuz+Mn+QSgT8qOU9yvwfXCm9findguajR5dYkQSCJG+sgdEJaUN4Qzgzs1gYlk8BZWub0uFQ== X-Received: by 2002:adf:ef06:0:b0:34d:ae55:9dbc with SMTP id ffacd0b85a97d-35526c2580emr8875481f8f.16.1716799366278; Mon, 27 May 2024 01:42:46 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3558889fb57sm8447292f8f.114.2024.05.27.01.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 01:42:45 -0700 (PDT) From: Neil Armstrong Date: Mon, 27 May 2024 10:42:34 +0200 Subject: [PATCH v2 2/7] phy: qcom: qmp-combo: store DP phy power state MIME-Version: 1.0 Message-Id: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-2-a03e68d7b8fc@linaro.org> References: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> In-Reply-To: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Krzysztof Kozlowski 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.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1271; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=VXXtf+CxFirDj8JdDAfT60xN71u6IzO9Gzrn6JM1ZZA=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmVEd9DbrO5eFkHDcV7BFyfcSFoDY9GOFx9L/4cBoo QQ6F2O+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZlRHfQAKCRB33NvayMhJ0Tg/D/ 9Kqa4zSjLeuYBuHqUIvtro8GoSjzdAJC0SVyPEIE3mA+/kNewBJSEfNwiUMMBY1fNo9fWCmc1c48L6 u8ZGhwLCHzgeaRLimAYjmOnVLkt07nXxitoanFkUB7H9EdvfB27rtRVyInZ2AbN+Di+s6fkts7F6LL 2GtVJ9Swp1l8Sfyj+13LqoAqlSYAVlWRy2VP3wDxuX1SFfpwNz6AutNluqpWxy81/UeAZzVnOrdHa9 u7r/Rn8vYHw2SjkswAcNvcrho9SgauKlXFGIl4rjC81ac3kRkNQ744gaEHAwwkqf8RQ5JjCEScknK9 mFz1nH3KhRfI0eyPGKyA/pC+lorKwuxmWwzSRUWjQfkkTtJyN2kVE33oAPV+MA1xTvGM+688aoMZiI pUgcubIpMTm7O6K5/LgufrbYmyI7v0KTQRj6LY+g4N9I6nmIsia3FeUMNQudceI3nJBkTxQh4CMLFa GEuvAJSt8xK9oM7vBIiKSLTUW79MKJyCHaZ1Zi0G636u2Ja7sgbZtP6GV+7MlXo5pewjavhK1TwmfI JzB5LEVYoc+x05C5qxp72h+GU6A7cOooYQLgie1gTUOS6f4kz87Htmn8NY5k97f+NLvkhq04GY1hsa Lf1NjC/fT7WzTs5mkDb5jlQvIOGtZtkAsl7Y8zyhBzhOLQmiC5Ts6MWfWxcg== 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-20240527_014249_133402_63A2C9BA X-CRM114-Status: UNSURE ( 9.18 ) 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 Reviewed-by: Dmitry Baryshkov --- 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 7f999e8a433d..183cd9cd1884 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -1512,6 +1512,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; @@ -2685,6 +2686,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; @@ -2699,6 +2702,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 Mon May 27 08:42:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13674862 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 F3A9DC25B7E for ; Mon, 27 May 2024 08:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=V1ytuQQBxcTzEG+hu3ZbSlmKNDvKcYlJ65NJEVWEe5k=; b=n0+8b0XMsemJ+f psg8G8HQSgKVscow85C0W+qrcSY2XF9XLLJ9vbJ3Y7iRSnAI3SVjyqdVcD0lnTg62mXnzg0oEp++c UQm9d3/o9+E3WxS46bIk/yQygcRNlhT6Aim6UEYRdLBgPQ5HNmBOIC6i2Iqr6qF0x564Rh+sT1YqX L4nDlnBSfP8Ssa9WJ4O3DMwmvzmgcrr8a+P0dBhEc2OTnwRGdElBkoVi73yu1inGcQBdzAXcFVD4l Ih+mfs8IX8nbHunqK+zpT8mdzVqpV/TBwvSTHwbrKdrpRiom3tqKHxtdgj3/bwlMTNMMzS8VEnwD0 +EsKg36fiIopeIe7PBlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwT-0000000EHLG-276I; Mon, 27 May 2024 08:42:53 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwQ-0000000EHHA-0mb5 for linux-phy@lists.infradead.org; Mon, 27 May 2024 08:42:51 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-354c5b7fafaso5205794f8f.3 for ; Mon, 27 May 2024 01:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716799367; x=1717404167; 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=5fM2JQC49aLohuvAOQ03vLAtXJ7DuKlglKcrOA/6ES0=; b=X5zSelyfmxqgjdHSPwCCK3UIoImsEJhwS9gm/yHdqsy7ImdJSptwRW3CMJof1EZnXO HbUnmWZYId98wCjou+N1hHzs/OxsvaEfqvac/24N4dvA+84OdvmI/NWSzT2l9Y3pGbT7 1hueZ/df41y4mwEIFAFLeWyfa106GpRjpEQjj4NGLKuwR/mSiw5RICEb68ftqGcnjdOj 4m7PCwbbD3HNVHOcjWVgD+sCTWOoYi/Hb/qtS2b2RagoV6YD3kL5VktHApIGnQYy5ner IwZmw8cqbDlOespoa2cDWftcQRq7utB9PMwpvlxXaFtpPCy04JnKYlvMktjC1bz9V+cf PtQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716799367; x=1717404167; 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=5fM2JQC49aLohuvAOQ03vLAtXJ7DuKlglKcrOA/6ES0=; b=Du3nBkiy2U2GoP7JR2QW7yr5lRwOxw8qkvZNtrFPM6j7Ho7AVZIeWPqy/XwTz/hmx8 3bYrZ1uOAgEbiCba2zf/m6EL6CpaTuegI5wdSg6wnSec5XVa+sVg+2W2zKfXMAGHlsTT zgOkVlJ5BiknHRFRGdfO8yqs5mHzuhCkzQszZXxf5XAWY5qBDS9ldPGZyqKtaQ3iBdeY d4ZQnIhs+kstK5iu9X51oRduORPyHISaYYIC3G6ekwbFUmfDP/zcTYfRptmLZa9FtdVl +iW0OtAL1zez6izSGWkW0k7wxXXlJk6j7kfOfbaVy78hPRM9GMuvPsJjZG09U/At4Ikb YHWg== X-Forwarded-Encrypted: i=1; AJvYcCWkdtraNoWaBYB7f5gs6xuJ5l7x8gO3m4GthSQ6cNz2Wsy4/niN3gFUtca9ZlO49D++DgO4zTR9yBsJBMiRk4A8ZAjChCu2n/w9xBGpRA== X-Gm-Message-State: AOJu0YyxnLaO31xMYQQSmp9wPzU7cgMsd6KOiM4LdV7+BLTjdkpA+fMi 7P1xM7BSPQP/jYhCfluh6r1C/kAZY7EeQJLRIiohIB2gA8c8a7DKwxthJ0O8NBdILfGtNLpGKb5 QTb8= X-Google-Smtp-Source: AGHT+IGa1M7vqlIE1C58dap0MUYea0CUqZITS59MDPsSM5pvcClAnYC6Q9OxDuJHFWpJZfB8rOdMgQ== X-Received: by 2002:a5d:4382:0:b0:354:bde9:e286 with SMTP id ffacd0b85a97d-35526c18f20mr6513910f8f.10.1716799367174; Mon, 27 May 2024 01:42:47 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3558889fb57sm8447292f8f.114.2024.05.27.01.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 01:42:46 -0700 (PDT) From: Neil Armstrong Date: Mon, 27 May 2024 10:42:35 +0200 Subject: [PATCH v2 3/7] phy: qcom: qmp-combo: introduce QPHY_MODE MIME-Version: 1.0 Message-Id: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-3-a03e68d7b8fc@linaro.org> References: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> In-Reply-To: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Krzysztof Kozlowski 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.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2828; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=64NV6QzxOvpeyMBuyWNXD513V021rtwBykr1hxoHJD4=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmVEd+Iqk2CoBGSG/vvhX6fqwQ1IgBdRIZAOChhnvF X/Z5q7KJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZlRHfgAKCRB33NvayMhJ0VVkD/ 91JOyMvWaIuisFv1fb/z+0SJSAlcj9xc65JF+wOjXsIhJ8j4mVlCyUcYfGOEN011OCzET/GZ8C8GjX Q8GVS1X2RTKmwXwNKsULIdwDnf5Mep/go2GLeUBhTG+MmwelkjWV8fkL6nubsBzsy+0CCVIdd1GIPm 5COBZQEzS9RAqg2xEBGvFkwQ3SbQpfCGWG+DUXiQK/KV09U0ygYpTkP/udnODf5wdzNC8qmvqFtQ5v 5mUzE/al55I+TlLnkoPEmWRCuYfx1p0S8tS7uODLI98mwOqCqcSBDtoLpBN8KxZFVcQDJBgC1ytoqB GxsyYZJUBkJd6ahagAOb1tQsh5aRtqzw+rPmorQmL3ngMR6A4z81ude3rjs968fYU9vT5CrpGxs5Wd 68c/H4ycD8Zn20dQnnFatuLETOwX/qEdMonl3aiS0qMvBSkn4vXWTxooWBvsTN4KZTczwE6jhskaJp yTfnYkekv/8USAKiS/xT9zfRnn9bQRfv8zwdnIWYKJHzxlOatzCpZoe5bGqJwwUziDipdTr3ZoMhMV COkGCTRVZx3RWyd7sUceNCgsUg63DqF8D5/TBlv3EjC3EaOCkaSY2dBMk/GxUPFMi1qguU51YBpPow zxHNEsGQkQcimqSQfU7BhOsUGJdHVumRmYWXxOWx1Q1e+yt59QB5iNCMvFDA== 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-20240527_014250_291335_FA27E799 X-CRM114-Status: GOOD ( 13.81 ) 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 Reviewed-by: Dmitry Baryshkov --- 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 183cd9cd1884..788e4c05eaf2 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 */ @@ -1503,6 +1509,7 @@ struct qmp_combo { struct mutex phy_mutex; int init_count; + enum qphy_mode init_mode; struct phy *usb_phy; enum phy_mode mode; @@ -2589,12 +2596,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); @@ -3603,6 +3631,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 Mon May 27 08:42:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13674861 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 54C88C27C43 for ; Mon, 27 May 2024 08:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=caRHxNitEFZaM55ETAJ06pA9XlDBOvFOzgnE5gls5U4=; b=Pe2I7ivUpKvx+r b2C7IpO5Jn4q28w40SJMFtCXzDng58DP4jEqWYA3ILAAoQO3jFi3X5TGnHlmyhMHrZXJHT93kf6qc DEa6RQUfawyoVoFglmF9YWTJx4tly4Yvl4gFdiwFTB+6q8a/qHdh3c8raUPAx6AzCHBvOe8AXmD/6 hsAXbdaHFFnJwkKvjq12oR6sSznCoa0HUvrhs4Syk7RSnDgHqiEA70qlyNoRcwT/n2eGeymT/qpyb Hr9vpn06MsbQQIt+3fUAv5ItNHiuGUoCbR6lcaBVuN+YBy/u23JlVPTCw/pxbDyFmH8prIqiyPYnj CMADI6ha7TzRmLPSN4Ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwT-0000000EHLW-47RI; Mon, 27 May 2024 08:42:53 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwQ-0000000EHHJ-419i for linux-phy@lists.infradead.org; Mon, 27 May 2024 08:42:52 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-354cd8da8b9so1721493f8f.0 for ; Mon, 27 May 2024 01:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716799368; x=1717404168; 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=YxS/sF3QMS4pEv+lY+qbGlLSEUONW426ub4A6OzdIao=; b=cppOpwba0je1HKtgfwC7h9f7KiFyb4VFxql3ocgdBqNGo6n+qT3QAcJH81X5TIhXC0 era+zxEQidqyCyupUnDiLQ7MuqKedsrn6HiuwfwGYXV3YapnDxYU7iuvmHlIY+iEClcd ENJOC3WySqAaVA3FI4AQDvIqLEICX/G+EXvSiRi64B5xqffB8OEodaV0UJh7uWZo/HFb f44fbSY8PGftRhZuM/v8AxMnbgCorYJ3YS63dkeV0GgRMT/YPe058KBwjvl/DdhyLdDI hAhe2/rYBiocJ8sHsxYZlJ4l85uXdB7Ly2QBiT/NH49+4OCtcDmx2eosKj6ONn54Fwhj OA9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716799368; x=1717404168; 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=YxS/sF3QMS4pEv+lY+qbGlLSEUONW426ub4A6OzdIao=; b=OXf2UluO++cw6EsbwlyK9EQlgSUz0wRZtZuOks0/4VpT9BxcyW7npt1+MAjP8LONvb lj79OEnrXVSvGw/mUhTEw1KbEywF0KyhdNsjGh6UAeF/rgOKZiQL4rFWXZ40GcBsedhG c6XUwsOIffuXFm8ARtzehTzT1f836zG3i/bEy+i0+/9RiL/yQjoszvSN5lgnkgXWDtCZ d6XflV9lZ12ZCBPnZXwjyAf95eyujKmdEwqmOF46uknyd8PMiHTdA2uv6vEM1COcaB36 eVZMLWQ6Ne0M8+wFSrCIgMXWqWxnx0KSphnVgOdJXzsOeKXCM9wmNxRZSOINr6WQ67ZS GQ4w== X-Forwarded-Encrypted: i=1; AJvYcCXrKPo/RgO86CadRT1xciNE8nuAtZLRfHK8G1cUpLsM1hIwi/tQHr0OpSFZ3BZ3KUrwYl2mn97HTsjbETQK/JUYmVdPZG6p1UwkEbrACg== X-Gm-Message-State: AOJu0YzNRKseg5f13CR7Zk+1kKE1FXgRwPdIMzxDSmsyoTX5kau/slsG WcfPjG3IQPsC55QOqNI9//4p5kXZPOcYvZP0do9IDeyKqEroyS/3lqsUBhmn9rc= X-Google-Smtp-Source: AGHT+IHvYNYI+HYZ0T3aH79X8HjHbOAAMpCSMNdGza6OuIPLY6XiVGDoTfX/QWPVjBwhKX7xTtaRfQ== X-Received: by 2002:a5d:4a0b:0:b0:34c:9a04:466f with SMTP id ffacd0b85a97d-35527055733mr6097723f8f.50.1716799368167; Mon, 27 May 2024 01:42:48 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3558889fb57sm8447292f8f.114.2024.05.27.01.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 01:42:47 -0700 (PDT) From: Neil Armstrong Date: Mon, 27 May 2024 10:42:36 +0200 Subject: [PATCH v2 4/7] phy: qcom: qmp-combo: register a typec mux to change the QPHY_MODE MIME-Version: 1.0 Message-Id: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-4-a03e68d7b8fc@linaro.org> References: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> In-Reply-To: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Krzysztof Kozlowski 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.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5577; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=sHniYRJN3UOlGbmTUjhhBF3mhKVX5A4jgOzkdiNthQ8=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmVEd+RjMq1ikwOlKvSX0tp1PUo4ij5m+LcWVI8cZ1 doln6YSJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZlRHfgAKCRB33NvayMhJ0R3yEA CEgX/83nEyu4aKS5hHCxQY5xF0LaZiBmIIYxauh+xU/qwPYmX4iRcyMX2E2mrqTAiw+kj+mcDEu4pX vooy6j8vWgx8x4MLb2CA64VrtT3IEX/IeFVIdDRZ3K0pZURqkV2/ivYxBYJDW1L7gHvY6xK/gEJk7z LkKiaDPo8ZWkyfhbRERNEUCASt9jRYaD8S3negkgCRMcbBsX/DztzOzfAa6/pygoYNvTXJKKqs5r+J ctT8NLhx/iP9kpZM1c9zTcurNAa6PrFhZKgq6EQn0HKoYeC7NhDD4mqDVabCmGSzPqwCML08QHReEj O6uiUl1mKKHZ/cUlRbPXABksK/m1aexFq+yVgkOjRl9NguZA+YuT/pIEl6+8PUTGYrmS3I7GI+zRyz 4zaRraEkLe6GvMW4owAV8pDs5mRtDShzz/MFE2XQJZ1wH+128QR2wETyvdvJSC74Xu3Aa+fNDnlI4s eW0vH896/NV7KHTEdj2wRh7dJQSyk7myac+iowsiIt3e0ym+unhBi8mVzde2ft9tjTJMwg3v4lY9Re DKrZ0NfIGrZrQR8KfNxB4e5uiLlTgsVhdCGbD5hC8MHcgA8TIa6SQ1XThyi03x4FimYKNyYla16vCS VAvZ3H3qzwny4jlXz8e8o1/GvMq4A/FTuftdosLMWWdMEPXCx1QCxuErz+eA== 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-20240527_014251_047576_F4A0F150 X-CRM114-Status: GOOD ( 22.57 ) 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 | 123 ++++++++++++++++++++++++++++-- 1 file changed, 118 insertions(+), 5 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index 788e4c05eaf2..b55ab08d44c2 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 @@ -1527,6 +1528,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); @@ -3353,17 +3358,112 @@ 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 == USB_TYPEC_DP_SID) { + 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; @@ -3374,10 +3474,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; } @@ -3609,7 +3722,7 @@ static int qmp_combo_probe(struct platform_device *pdev) if (ret) goto err_node_put; - ret = qmp_combo_typec_switch_register(qmp); + ret = qmp_combo_typec_register(qmp); if (ret) goto err_node_put; From patchwork Mon May 27 08:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13674863 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 E1E0FC25B7C for ; Mon, 27 May 2024 08:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=F+03DlssazdPRSn6XyGLkP7gNDWTLjfR7GpcTprtpiE=; b=3DVVx6XGA3U9b2 xRyqSDyGYcVUGBY/X0w5+AzWxzSjn9Kp1w/IBhtKlQOTahBduaEPVvedOwxHpCp1Ry3Kt4v3qxR2a LWwYxCxuCyDlaNHqb0I+Fb/CjNF0JYcLjJQ5Zkoe+18RSY9io1lFqEsmpVTuXGK02/riIaTgMVSm9 hiztgeP/tDiTa9LgEsT9c/Ld2qD6x2RCHkMMlEOtUchUe5TPXCVVmMJL1rkJyR2ICHMcyzvExo3gj 9yPb0rkD8Mowy/YxmUvcXNPJppRqlYN1HHmYXbKCJWOJtg/EgxVAFTtudTTT70J9mE8nUzod9IhIE /QxJdaC6NLG8bDcJ5LLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwU-0000000EHLr-1p9a; Mon, 27 May 2024 08:42:54 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwR-0000000EHIC-0HH5 for linux-phy@lists.infradead.org; Mon, 27 May 2024 08:42:52 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-354ba5663c9so4398814f8f.0 for ; Mon, 27 May 2024 01:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716799369; x=1717404169; 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=VaEF4gO72oykFIStkZdCU9USqrBYmrQ/jBFI2aUzk2E=; b=oIH9CAhAaNtBUISj0VsiUhR2hoQu3Qn4WT8VY4C/6OPapyLaEw85+XeHjjL7qL1jY6 PiJjw66gg5B+k9+QgcQZthrbvxqZrVGHZLsG4FfW+WEcy51gw4vu3/2S5sv61QehikVW UM7SZ3S8ug6Kjv2R/WYvdV6IyIURSnkVqbIBls3rHpI7cw7C0IOxhvXcrqrdghbGtd2Z dNteYwcGNtsOZFIdzG23pYU3bYp2rmn2ZlyZjhUFV68OlXHr0qA+1O39tGUUb9zNhCOe BDHDvXKoJZQcYKsTaU0zn23UuC0xRSt7rvG4HsOFfdyl4g0HY/NBg/lstTil/F3QPmEn +mVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716799369; x=1717404169; 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=VaEF4gO72oykFIStkZdCU9USqrBYmrQ/jBFI2aUzk2E=; b=AuY8DCK7M9xk4PpVCvtvxnP/XH4LocIdqDLPbP6gSUDNSe8S4N81qoTtm9VUFzeYnv c0FfDVW8SB7ObM3UQZ9D09xwf2SuzUPrzfNjlgtymY1qCyF9KjczZznQatY30Nffi1ek Ch81LbZcx90sLV+ECcIRmtl8oDUyMZtiqDtz3bUimBLSmQJlSJBsWLWLgoxI5pctMYKQ yD/ddSD2MjGGZ4XicjKgaRUuFai0oXhk/tN0/9NQ2AKLtmfg7wS2M/x0W3sFBj/URDva YCsCzRXUdymjt8r0el5u7/TESmEngY2RzyFd27Ujm3vHuxcXSYxPGTeS2UU0j0rPLO50 ka/g== X-Forwarded-Encrypted: i=1; AJvYcCWM+mMjsGQOBbnr3TdijvdwQ64clZHVhle2a8nrg2TdBro87YqpGm2lTKYOP1+tibQHXoBWOkuT3S48VYadJTPJBESkpqcLhnLz/oZmZQ== X-Gm-Message-State: AOJu0YxoNY1xcB1Oh/COT6CJ03ZdHqdevcHG4KCsfhiAFmVTX4tGIjsq k0QlpCFfM7qZIybAzpPTH+k3DN/bOswzbtxvAbOSz0vvnrK3DCoqOpvMLp68JxM= X-Google-Smtp-Source: AGHT+IFlox+JYA/TQIiL3yZKdwNn/gUx+Gg1nkb+lMnlc1O4u4ePjX9SmBqGsxeiC8TMhuH9h/OxLw== X-Received: by 2002:adf:b1d3:0:b0:354:e746:7515 with SMTP id ffacd0b85a97d-35526c560f5mr5700618f8f.34.1716799369100; Mon, 27 May 2024 01:42:49 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3558889fb57sm8447292f8f.114.2024.05.27.01.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 01:42:48 -0700 (PDT) From: Neil Armstrong Date: Mon, 27 May 2024 10:42:37 +0200 Subject: [PATCH v2 5/7] arm64: dts: qcom-sm8550: allow 4 lanes for DisplayPort and enable QMP PHY mode-switch MIME-Version: 1.0 Message-Id: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-5-a03e68d7b8fc@linaro.org> References: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> In-Reply-To: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Krzysztof Kozlowski 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.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1519; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=bUymvKgHwGJMNeWdO4E2xoRI1NZeMZTfq1gbdx2kTBk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmVEd/+QFKuSFUK9Ik+eL30bDuvC5I0nJH7qROWMla eO0Zq6CJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZlRHfwAKCRB33NvayMhJ0Q2DEA DNvwrXulOdcNRZRXI8w7ZpiXjlBiyTvyLLHoh4wv+9NlSrnQkFT6jfza8qR6v2QtHV9qs+cJSiVl47 1lqQ+8yIimZEbAnykiQdlFF39DtdZQQyBibDSpvxFqNLUFz3UXdGj8PFh0cq3RPypNegcL2taIxJ1a 9lZNNxFhWEuTbJu68k7DkcxiBaRb7LCZFgfNwnF8YsJBXQXB3A/CxpCdDxa3Iavpqm3n5ZYLtEENjT U96loPeH/OrecX2XVaqSWnvpBOJPB4N+SbwKYy8ZOZhqZ4wuVGmjL3ZCHIcAhwroTgIWdX31ZOIYSk hiZilxmaH7rOl0j2l7UemGBALP4yOnDgFey8g9a99pgXbpXJPEy+IcthMsmgaVScBDRWtZp3QEf5CG 4LrE3DF1FsKl4kZMdaVV7lOEvFrYPZ/wgK3hdJU5iqbbbaaLqDEIQvdwzTCWcLjiKw5DLmeK5Rv7rV r9le0N1HO+F6snQPXI0+VfneAh7gxCvciV2x801DAGFzw2zfX7pMkgDUfj/uMBiqDniCkfFbL3ap/U mOcdK+LJJn+lsepGqd7tGUZyOtdTF8TRDQnlTdzYmOaseH4S8ep2AmvKCB6dV/sLg00tUMX/47TlrU NVQiPQfoOZ3cSVgn8RKyi2sQdh5x9JCchZHscZvlqiQsTrCHBYB4Ycoxt8tA== 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-20240527_014251_173494_3BD827FC X-CRM114-Status: GOOD ( 10.37 ) 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 Reviewed-by: Dmitry Baryshkov --- 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 ccff744dcd14..a95949c01f25 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 { @@ -1280,6 +1280,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 39ba3e9969b7..fbac5270b4d7 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts @@ -795,7 +795,7 @@ &mdss_dp0 { }; &mdss_dp0_out { - data-lanes = <0 1>; + data-lanes = <0 1 2 3>; remote-endpoint = <&usb_dp_qmpphy_dp_in>; }; @@ -1142,6 +1142,7 @@ &usb_dp_qmpphy { vdda-phy-supply = <&vreg_l3e_1p2>; vdda-pll-supply = <&vreg_l3f_0p88>; + mode-switch; orientation-switch; status = "okay"; From patchwork Mon May 27 08:42:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13674865 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 EBE08C25B7C for ; Mon, 27 May 2024 08:42:58 +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=JnAWlX4pOwbCOHeVgtaDp4Lvh8BASXm5KZaw0eNYfPs=; b=bJA+4Ngx4KUxWa wB7/PbYEtpsqTAj2xarklu3E1Ynv1t7hEcEsVvvJIorkl19iXOYvFLj6Q0z1etzcGA8Kb+gqMq9bf A5JnVRsjRclrUc3ig8fmPLz95qy6foFt0NZfpVhODIjBS4wt5CeJncq6neOXsxxUbjH7EpNwJlKXt 811UDjjWBarYMuCbKuTbu+QIpDYxg6BZBKzWN06urrrx6RKrHqcBVs37qIZ8Oz3doyLoJIlcUXnl/ fSQR2+Ui8qBz3tJWAeGUhsqRidYIN3S6v4NyW72gzKjPLyXUtldFtX98elskCwQxIz/kSSj3JRcE5 GkbcsyaTBKWOdjAr8srg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwY-0000000EHOK-2Lyu; Mon, 27 May 2024 08:42:58 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwT-0000000EHIu-0Fll for linux-phy@lists.infradead.org; Mon, 27 May 2024 08:42:55 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42016c8db2aso46993025e9.0 for ; Mon, 27 May 2024 01:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716799370; x=1717404170; 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=D2LJ1RO9W9ZmiplNXqoAHVuLIaBqUKAjCRHOSbo1zRE=; b=yMCeMxXZ6nX0ebvdyG9NqcmvCtB4U0VU4cgE3OOAPuTsHGk9HFp8qG6AXTPjfMtUgq xUfJsCaWgZ8DpW2aRgGcI2/M/tPGjaZhuoGy0V934fQ2moF6VT1M+Bc+WTuhlx0F3EzO /UGyqO+nGrKxrlLDQEl3CJlexHejpk27rElqCd73G0uwlGrkZ9MMhcOlobmm71hazrtv TpYX20ulBWRzHtwF7p4qjEuQ1QM/WMyJlI8zzDUBz0CFurFRyAUgG5j/3ef+zaBP3c5T HtwfVaNteLiXUX8MNZEgb2mm5EbK50C8Y4DFJO0MOYaSRDBl5SB32zIRgNCxsFaGJuCx bcvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716799370; x=1717404170; 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=D2LJ1RO9W9ZmiplNXqoAHVuLIaBqUKAjCRHOSbo1zRE=; b=dnhhQNs9RDh5P+6Y7MLRaltGguMkrGKAbmD9dKrf9otKEikBRdEPR8LfE7tmf8Iggs Bc7PMFdreE50DbdhTYzAM1Xr5lVDWaAZzoVTrcnyfpi1cnnS0pzqG3kXXuTAcWWhOcO5 hyIfUrsJ8GN47AW12NPa67UrTU43ywWk+9WJTQnrrOaXdemSNtAyoMDIdLTdNGwNNiP5 4k8aYE8glMKUdMolIEtQCnYUyQ5uZRb3Ncees3DDuhvKi63loUXqflV2kES5rGn7F93f pp51e9vojt5EEEKCmait9OU3tgtEXWClS4IZo5m1wpJ227iR0iKk1itvdTnJp3j00SIx Zrjw== X-Forwarded-Encrypted: i=1; AJvYcCXinlx49ULZcvz7/Rz4yBa5s5119ojUzbL8wEWJU0QSXThqYOrQRXHIi0pGkz/wf5TyJd/Y6raENXs9tXuwkEs+mH/gD7uWJdQRgNqyKg== X-Gm-Message-State: AOJu0Yy7JrRpjcGs1SpX5aGvhnS7q8Yyp5oKln6kFZzY+ZWpJsilJOzU 6CLnr+243bp4Y5axZBOZAQvEXLC2St2tjWyQB+lSrLkffQYvJKauqLzUg7OnPao= X-Google-Smtp-Source: AGHT+IFdORbL0x+whnPJfYGPCVw/jWchVW0zPlS/w0jEjLQix7QZp7p2sKG8QPCYe49sDQQDgjJXgg== X-Received: by 2002:adf:f707:0:b0:356:49a8:7e0a with SMTP id ffacd0b85a97d-35649a881f9mr5480493f8f.11.1716799369998; Mon, 27 May 2024 01:42:49 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3558889fb57sm8447292f8f.114.2024.05.27.01.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 01:42:49 -0700 (PDT) From: Neil Armstrong Date: Mon, 27 May 2024 10:42:38 +0200 Subject: [PATCH v2 6/7] arm64: dts: qcom-sm8650: allow 4 lanes for DisplayPort and enable QMP PHY mode-switch MIME-Version: 1.0 Message-Id: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-6-a03e68d7b8fc@linaro.org> References: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> In-Reply-To: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Krzysztof Kozlowski 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.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1513; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=NP7tAZcAVmpxoSMiDaYof/jNrt5rk0QngILAlS00ha8=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmVEd/GpAuxlZ3geRUZpWH7CVDUJQ+wF4m4uHJPlkw xEjpF7aJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZlRHfwAKCRB33NvayMhJ0QqwD/ 4whHfSuSohMllMQlciqb8HcpyxsE0IsTyef8jOv1thGDKh2GRgoQfuBVFEmnGOWKm6lXQnbsSWT5A7 VxKpp3BJsajvzeHB5r8mXfbORE7U50+q+/C5SStC1d+PYO2PRPiVufnyTAH4NSEiAs3gvvrvNFf3Nq u/P9uNDjYvlKjaKkDSjeDZFEEBcIE7rTROL7WHUVG0iQn38HH6vdSW1q9MpbLkHJqBYmxFPRUoMWwx 6vf5kUiJTMlJp3+1TRMAq4+V4tN9UdAu2clLHDOXU/AQVaYMjFi+FU0n1daQ6XvMNBZFRaenmldfg1 SXI5HgnvaYA44fffD8YXljYmoG9BOiIYQva87CQNrRkqi7VHfI3yj6qDuiHHD76T8yMTMy0a+7oaOL qJnQGpUaKXR1adDbrD7z3ldmWIlba0szOiUi4frySzyR/b3sbvoGsyWv2nsH7XDsZovk+3o0yUV9g0 JPIEwV16rHsse4bMc7wnZnnzthXtaupo2AS8BuC4uQ1oB86rKkd/a7mP6qHw21Y23w5hYF7/5l2dH5 11kg31CAn9m3ZL80ckaVmCKhVZqHZBUwJEY6I1xgEXI9LN5DxBcQjVJm8zFOQSIK3SXuwuHs1nrxeu 4wJjofJsorZ7Q2uSX4uDdzwb5dWmrU1X56HM8EVsDQ8LeOx8FiKQEzzjpS1Q== 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-20240527_014253_342983_7117766D X-CRM114-Status: UNSURE ( 9.84 ) 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 Reviewed-by: Dmitry Baryshkov --- arch/arm64/boot/dts/qcom/sm8650-hdk.dts | 3 ++- arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8650-hdk.dts b/arch/arm64/boot/dts/qcom/sm8650-hdk.dts index 3791c36579be..9ab07e265321 100644 --- a/arch/arm64/boot/dts/qcom/sm8650-hdk.dts +++ b/arch/arm64/boot/dts/qcom/sm8650-hdk.dts @@ -872,7 +872,7 @@ &mdss_dp0 { }; &mdss_dp0_out { - data-lanes = <0 1>; + data-lanes = <0 1 2 3>; remote-endpoint = <&usb_dp_qmpphy_dp_in>; }; @@ -1229,6 +1229,7 @@ &usb_dp_qmpphy { vdda-phy-supply = <&vreg_l3i_1p2>; vdda-pll-supply = <&vreg_l3g_0p91>; + mode-switch; orientation-switch; status = "okay"; diff --git a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts index bd87aa3aa548..884e846842f5 100644 --- a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts @@ -831,7 +831,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 Mon May 27 08:42:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13674864 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 7BF23C25B7D for ; Mon, 27 May 2024 08:42:58 +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=oijZNy/S7FzNygYEwTtK1aOMJ37DaeYWBCCHzYcGf7k=; b=YyaYUfMtJ+B+PR NJElYXh9irmJbFTOI7+fVUZWeK1i2AeAcTg9UC4MNF+UPc6YFkFrYl0SXwGCzLD/NkTCIsRNv+lM2 4lBUfQf5S7BnP7CmNlZZOsB1mxeRu4PgB5vmrBPV41bEqSYUYek26Mv7xWuTYe2eflRqQcFiyixmm fW1VA2Tm3XYLhgMbD8R32iMnq2vwcCIcv6DgncbxkOKwiibAaI2ML2QHkTanp0ibp4SCRoLgXuT00 YLOOKtogG6JoeCY566/I12VCSq0G056glBjfdk3+SI8JBuSuEE6sDDZosJ58w4vWhRi1PimS09rvg OArDcR9IRQbDdx7inkVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwY-0000000EHO0-0a2c; Mon, 27 May 2024 08:42:58 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBVwT-0000000EHJd-0HmD for linux-phy@lists.infradead.org; Mon, 27 May 2024 08:42:54 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-354e0cc9c5cso4571936f8f.0 for ; Mon, 27 May 2024 01:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716799371; x=1717404171; 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=gv4XcgrE+Sm06cvS3N6RCuploOyylX22ILl1HxMDPcw=; b=b3GWwN+OHlNsUSHETMGx1ED3OHFQGGZCb1VnX3iL1n2ikoJIOz9nPJgEvD+v625cVT /fpUNSHH2g6a7SYjs0Wm4/FJ3Yg6dpRD/+DTHrODitYu6FsgCi7lM1ASHPWlUSkM74Zu K11L/ua4h4CxYwbM3C7SKmBqYuiwRwBuKDBJQLm1hHTUxBZV561HNmeF52EEhCA0oWtQ mVOQoYJAC3IXmcrKyoXDsxjXhwXkTZ6i3WqgtzhIrQsBuHKo4E1okW7ImQYzYVg/QG/M DU7J3dxEar+iyBz56uEMhG2uq/RTFkTKzHi6K8bc8CNCDIp36onrAyb1iS9kswtBiQJe gx+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716799371; x=1717404171; 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=gv4XcgrE+Sm06cvS3N6RCuploOyylX22ILl1HxMDPcw=; b=cPVTFKmaCuIkJ62efy90je+4Qq5NhZd9PRY0jEcpDab6ZCxo7GAnR2PS+2pIUaF67J bnQNVPYGcoyxfQMCb/hJUBpWlPDf3gL9d540e6lHYuAEfos+pVH/6K922C30dXdpw/rC cOPomYxXwmMNWkIHJvrYZ5oO3FqBAhRPieLmY85JpzWiTX1bd1YZYJl68kS30PbdwhkF UgFpTLqQAdtjGPA2ICBsDwpFzoikuN2G8S0hiNtTJ7IAxxM5USEnDc4WP6JTkJa5yVn8 H6ZLOteOIHKihmYxAliROa5+dhBx9OM1og86duD55pGvs084HBHA5rekoQZuqz2qaVNW 4VbQ== X-Forwarded-Encrypted: i=1; AJvYcCW1oWQbn0JZqD9HiPzwD0/CwtjIYV9sMdTuRIF+BW21zFC5rV4JfzPWXiVM7JBx5GpyYlk6/jPNiIuxltKHNYfnDshwqGrfZDKh/YbB0Q== X-Gm-Message-State: AOJu0Yy31kTIRYtXKz0uRGyiH00bBa6ymwu7Ee3W0HKZYX5Hn6JxII/O gs93D2P19+TmY7/7bGEEgUPnvh+QNMmLJFeW8FUrhkx5/ntlGhtHmPwyLFMUnKo= X-Google-Smtp-Source: AGHT+IHF22FK1+Ks6DxIuwzLPxEi57/bXJbpsEkYmUSNcM8jUjUfiNgSqFkwncWDon6TfTyIOBiLnA== X-Received: by 2002:adf:f48c:0:b0:354:f90c:63dd with SMTP id ffacd0b85a97d-3552210f11fmr6175693f8f.0.1716799370947; Mon, 27 May 2024 01:42:50 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3558889fb57sm8447292f8f.114.2024.05.27.01.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 01:42:50 -0700 (PDT) From: Neil Armstrong Date: Mon, 27 May 2024 10:42:39 +0200 Subject: [PATCH v2 7/7] arm64: dts: qcom: sc8280xp-lenovo-thinkpad-x13: allow 4 lanes for DisplayPort and enable QMP PHY mode-switch MIME-Version: 1.0 Message-Id: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-7-a03e68d7b8fc@linaro.org> References: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> In-Reply-To: <20240527-topic-sm8x50-upstream-phy-combo-typec-mux-v2-0-a03e68d7b8fc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Krzysztof Kozlowski 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.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1314; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=EQYEM+nXLwVomhzLq6K3CGSxN/j1/41Ke38UOW9m/Bo=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBmVEeAHBZsJopuIKCfsXkjV2XRXahXRubswN6LvOMY WusZGAeJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZlRHgAAKCRB33NvayMhJ0f+hEA CdjaqatyiAaFU3k1VieZt3QmCuHnjKxT4lgrTMmAKQxCydsv6Z82g1Vi5hugt8ZZ73C5iXvHSAn8kK lOHQ2h7F/uFFFnfyIPl9wWPLnwo4f80hjcjDdcQ4qWKIMqdKyu8EKroW76xvNKQTZ7JFxpVQLy3B35 qAzYO4DuzIMFQN8hfCloPuH53SGceSqzMoluoYoVudwwXG/+WD1guBLIP/QWjPY61P+6dfoLv0Znkh oUCaigX/PO/BOUc7XAmzvy47Zrn29i+SO1M5NgV5C6Tcftv5z0vy+l1regR5jowBpxEpIYedIrKhk6 XbBJnWvF05Fqkw7hPajqX8QsiCEA59lo++GQJ5q79K4IFY1dU0Qo5IMY/Vnb2ucN9GLyTvjM+nO5O1 3Ch6HkJy9Jouan6hTwNzE3FOv0+r8T545yu3hy/SJiN7ZrOlN1+By0WcuTiKIV6IaV0nMGhK42nJkk 1bzatzIoi7XCux49BBqxN/5nFIwiQxgoKh1t7xV2cQHnMve74czLScmjmccl0+nYMqz402l76+Mln9 meH2oWuuCRHt31GiMgVauvFgnucIXdjXjcwo8cXaO9kv2bRwpjX6pG+K0fnrpIr28ykj2Gc9NID/vi txRALFfvbNwq4GIYFlYHLRDZFKQeT7evtqN04nYxv/iNQEiK24MBgHfDrRMg== 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-20240527_014253_266122_52B59F64 X-CRM114-Status: UNSURE ( 9.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 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 Reviewed-by: Dmitry Baryshkov --- 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 e937732abede..bcd38831f9d3 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -593,7 +593,7 @@ &mdss0_dp0 { }; &mdss0_dp0_out { - data-lanes = <0 1>; + data-lanes = <0 1 2 3>; remote-endpoint = <&usb_0_qmpphy_dp_in>; }; @@ -602,7 +602,7 @@ &mdss0_dp1 { }; &mdss0_dp1_out { - data-lanes = <0 1>; + data-lanes = <0 1 2 3>; remote-endpoint = <&usb_1_qmpphy_dp_in>; }; @@ -1143,6 +1143,7 @@ &usb_0_qmpphy { vdda-phy-supply = <&vreg_l9d>; vdda-pll-supply = <&vreg_l4d>; + mode-switch; orientation-switch; status = "okay"; @@ -1180,6 +1181,7 @@ &usb_1_qmpphy { vdda-phy-supply = <&vreg_l4b>; vdda-pll-supply = <&vreg_l3b>; + mode-switch; orientation-switch; status = "okay";