From patchwork Thu Jun 1 14:07:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 687905 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 493E9C7EE23 for ; Thu, 1 Jun 2023 14:07:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233780AbjFAOH0 (ORCPT ); Thu, 1 Jun 2023 10:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233687AbjFAOHX (ORCPT ); Thu, 1 Jun 2023 10:07:23 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A830E1B3 for ; Thu, 1 Jun 2023 07:07:09 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f6d01d390bso9269515e9.2 for ; Thu, 01 Jun 2023 07:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685628428; x=1688220428; 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=gDXbkTppdjxAQ8h3R3G3hKWJWRPcHZlz999QVqKCfpQ=; b=ESrafRqymDIAEtGcBVrYIbqesxFh4y44UJCrFQZAgEeNDSs4PlFzn2dJGuwZJC4rGW KCRj5Yu9BCivOe5fo2ovHCgNyODWqfTas5VlmRgjhJjB5Kv677aOEBYneJiH1Yl5Omo8 LpVkd3sUBbPTidlQs4T+5KUoyH4L7jU9Mka90+M0Re3OPcX28NAsFfJo7T5X/Z5tml9n AhZNBRQAS1VceOC/xLHYUDcFwdhIqdyCZHX1CRsV5QN0GQXGSn4Hpo3vKJJy/kvkhm+i P9zskhTmigx1BMGsM2H/yaCeCRcpjzc2bwpE+jTpmdDuCDjmUUsuO/zJ4la7NLHQP0mI RmxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685628428; x=1688220428; 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=gDXbkTppdjxAQ8h3R3G3hKWJWRPcHZlz999QVqKCfpQ=; b=ENwNE8FQB4POIKs1dKgV0ozvwrgL2i9mRR66ifJRWg9MHMFJrsSbJ3Mi2lkw38/Owv ooHIdjzCiWPUXsLL8Wx5U3PEiW4FZhzKP1BSoPGlWltVBuzALNwmj2eW5WvxPzrwPDXm rk5nFs1tgHVi+x05JIvokrswe8uD0bc5xD0O3lK/fKoiIAiAfp34GxWmnLucx4VaL90d QE0OftkjEtXTW0xfJGbW8xH664LylBbBx9XSkPu6an7BDz1P37UHsrAlkM5sny5Yh96w GPe3VpNJBs8lMKitFAMR8EaLmIc2oIFk1/vDWuTDFwEsYHoe383zON8VQEm3IKL/y/L1 p95Q== X-Gm-Message-State: AC+VfDw1m07gePXfNt+ty5cSLbUjjPcsu2Q4ZxrhBg6W4oxxxs/yslBH NHO0SWOSiFmrUsJbmWcfds0zoA== X-Google-Smtp-Source: ACHHUZ58I0XJymFL/i3IMgjigb//ajC4y2R0ISDG78hWNownQvH+1B1dy8mQKsegL9OlHc/B0X4pfQ== X-Received: by 2002:a7b:c00f:0:b0:3f4:1cd8:3e99 with SMTP id c15-20020a7bc00f000000b003f41cd83e99mr2041970wmb.28.1685628428080; Thu, 01 Jun 2023 07:07:08 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id k11-20020adfe3cb000000b003078a3f3a24sm10504166wrm.114.2023.06.01.07.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 07:07:07 -0700 (PDT) From: Neil Armstrong Date: Thu, 01 Jun 2023 16:07:01 +0200 Subject: [PATCH RFC 1/7] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v1-1-d4d97b4d8bab@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heikki Krogerus , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1227; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=cvE1/snGhi9JqHiPX/H9x4U1AzFta3//P9TFUvBRJSE=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkeKYHIwKO89Hmu4fpuG5/L+zks0oTkmwh5IzqUuC/ NghOYvyJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZHimBwAKCRB33NvayMhJ0fdjD/ 9cz5nH2w5E0PzN7Ncbka3ISElAsuejYJ8/1iadM9fKugu+gMIYBGfoyI9UwA58ybLNXBgFRDT/nv2n 9AUuyKQEAZ5uc8S7R5yqlWIdP1pJS67tu+mfywu0/nco1/PZUOM3eV3b9rIGAFR7NdkSN4+8os34r4 thFXMbAXw7G4h6l05K525TcH8KNsIowJ4C5LQ3PFDHmZ3XNp1IcUpQi8JpSXrIrMmYVr1ojRD+sGaI F31yOCS9uwIy4Tlyyrni3fzcyItDwMNLs1kAGXa1qBRaw3RRC2bm7vo30pPaeb3Pjan+KbvM+lhnRP qgf7NRdFppD5ClAnY5DjEbqDAygNI7Zq4K8Mi4gCEyKnW0mVppRVvNZycZiXPLAasLBb0S6kg5WHc2 0iWP0+IBjwclrlezAGiFyFZAEik/+enLw4q95xG1MrofWx0BjNxKTLVqtM4NjsAWKdLBodTg3Ai3dV Pb8IPemBJu46Ec7ME1AJxSU3U+XZ+Ld3EDenoOX7Ep8jmFm+DcS8tubVUND/2OGlxMgRpxs7qTNlpl /ilWcX9FJXm2Cn/IW5NcXvmwFDJvqrl77ozc4Fw6qRt8MbUFuDl3oOFUsXTvH1XdrsaZZOluIpedcq gxmD85I6MMsy8ztVfXrMYiKQjhYrJCs42WuqpdCU1F3e4f8U3yV8/oXM70Aw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On some platforms, the Type-C plug orientation is given on a GPIO line. Document this optional Type-C connector property, and take the assumption an active level represents an inverted/flipped orientation. Signed-off-by: Neil Armstrong Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/connector/usb-connector.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml index ae515651fc6b..c3884eed6ba4 100644 --- a/Documentation/devicetree/bindings/connector/usb-connector.yaml +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml @@ -114,6 +114,11 @@ properties: description: Set this property if the Type-C connector has no power delivery support. type: boolean + orientation-gpios: + description: An input gpio for Type-C connector orientation, used to detect orientation + of the Type-C connector. GPIO active level means "CC2" or Reversed/Flipped orientation. + maxItems: 1 + # The following are optional properties for "usb-c-connector" with power # delivery support. source-pdos: From patchwork Thu Jun 1 14:07:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 688470 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 961E4C7EE2A for ; Thu, 1 Jun 2023 14:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233709AbjFAOHj (ORCPT ); Thu, 1 Jun 2023 10:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbjFAOHY (ORCPT ); Thu, 1 Jun 2023 10:07:24 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 977811B5 for ; Thu, 1 Jun 2023 07:07:10 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f6e1394060so8746165e9.3 for ; Thu, 01 Jun 2023 07:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685628429; x=1688220429; 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=mLNlz/8+ewTofYujo4xBdn+VfsPe1NjsAkjdE+/T2lI=; b=oYPuYY+ZnGHUb2gUzJcoqU/WPjmS9SF6H+45VfaRbK2bIEFlekPpn6jdYNW6qJoJNE oANuOaPHdOv+nk3u/L886PIHSphZqPFgbwZrCp1gtwwOKGSnqTf/kgGHDAiLXWmxOrUJ qx+PUuNU9uKTCx7HosXyK51hZJ5ILVSoSMGM9JYhlEG/rXRlwQxLGFRfBapCncKRd+Zy BiLJTFz+32cQHrFrP+dQGpihARRJUlugG4o6eYk7GIcChiGezXdfyVNGoDpJtNDk2U+8 RgA2oYMll0nVs9W7utjz4Avh4MUzZzOplNSFcKbyaU6PymmVa5se/zGBfqipxprJoOi3 AoAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685628429; x=1688220429; 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=mLNlz/8+ewTofYujo4xBdn+VfsPe1NjsAkjdE+/T2lI=; b=Q6ewzEQqLmz7Ib8NgrPTyfoF/OF2CyF8NBniHvvcrIcVsbS6MXosgf+gfqfeEH+T7v ChB3ktuLfgPp91zKd1qXxhIPY24z+MzIBkzGWLuaJLqlzRB5qK1SVGVYNCFw6KxGslE/ D4KBtfpPRTcy7cUJeL3/8SXKleaJ17hEpTAmVkHE40wn2I7rD/klvaR5uRz7lHEicdnI Aosi5KzcyHykPWiv3eJXXFzwaJnfQz7r+4mAUqVqwtGxzQXnnEGLkCJqskTaoRq9PAZj u1jkZbNTB7KhB4kzobFJlLyhGZsgwhtOe+7hA4trbFT6Of6P9FDgw4DqtQc/SfPU82F3 b4nQ== X-Gm-Message-State: AC+VfDzA7uea65C/WMc8bxMgkaF7kppK52qdnn1Nq81Jp5ARUQV0vRTE 75Gik8Xmhq4hPQxcK5QJJSt8fA== X-Google-Smtp-Source: ACHHUZ53bB7fur2INmD7jFDFekH9sE6Ip63wOpxueHEdytfaVOlUl7/9lqGwHwjECiWr7sxyzIEdVQ== X-Received: by 2002:a7b:cc8c:0:b0:3f6:6c0:7c9b with SMTP id p12-20020a7bcc8c000000b003f606c07c9bmr2256754wma.15.1685628428934; Thu, 01 Jun 2023 07:07:08 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id k11-20020adfe3cb000000b003078a3f3a24sm10504166wrm.114.2023.06.01.07.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 07:07:08 -0700 (PDT) From: Neil Armstrong Date: Thu, 01 Jun 2023 16:07:02 +0200 Subject: [PATCH RFC 2/7] soc: qcom: pmic_glink_altmode: handle safe mode when disconnect MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v1-2-d4d97b4d8bab@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heikki Krogerus , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1767; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=gcoujHHWT0tH34VUiSmqNPPpiXV+hYxjsfgjgght78I=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkeKYHqwb2u6/0PRQUB2mxFXOdGo8Yol4BNZsHbFoJ GDH6Kt+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZHimBwAKCRB33NvayMhJ0aWxEA Cpk3xOJ9mvlf7QV+OPt4tMubv7GRx/KKlGwORuiPhTgCobutfQWEVHcpqXiuD4qiuXmuu2/F80SC84 v5/72PxzisvYMoLvha8UOsEYqpEwa8GVuTs+jeYMxSB3GYK8s7pMfzBLsmzuHf0m7HtbzNrAVNwJda RDoVS2VpJaF5wc6gWvssTiFEAKS92OGlwlOxlOAk7s8qB10zsEgLFwSO5eLl/w6/xD3Kc4bIxJL0jN 0vTLYdsgxpvBd1HJrlA/eo9vZqS7T0Lnsg3zh+WKE4scmI/w70JZifT03t6qtZmVCRE+JwiF00I5px xS5uxfrcqO6LzFnhvU9eHYhSkkLiXzaMIJdR4hEZkClfCCjppZ8LRRj8Ied0TEj4G+wOwDx729LKLI g5sqgPOFw/WnsLGcgFfdpxbyXT+ZTiB2ORCwaI74xZskabIrlmRKFWTgXdI9IRgLlX8cfo+UVkA0GE nuWJRcvGGRgJL3FqFC4tzPnMuif36+SoOmCwDpcw7K7zs8lVkE8ifpCpsU9E7EE5pblXwafWPYfGEK wrEF0XAqj6C26EGwwBf4OyjWUC32FgYm3EKhHUWJqUV6umP8b+Ms5VQd+zB8yKb6GuobNWs9mTiAVd BpeEHtnzO+GBZSR8up3QfQEvAeeCrDhtKqbCjVvLXK2i8nTgpmxhg41p1Epg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On some Qcom SoCs, the Altmode event mode is set to 0xff when the Type-C port is disconnected. Handle this specific mode and translate it as the SAFE mode. Signed-off-by: Neil Armstrong --- drivers/soc/qcom/pmic_glink_altmode.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c index df48fbea4b68..007d308e2f15 100644 --- a/drivers/soc/qcom/pmic_glink_altmode.c +++ b/drivers/soc/qcom/pmic_glink_altmode.c @@ -173,6 +173,20 @@ static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode, dev_err(altmode->dev, "failed to switch mux to USB\n"); } +static void pmic_glink_altmode_safe(struct pmic_glink_altmode *altmode, + struct pmic_glink_altmode_port *port) +{ + int ret; + + port->state.alt = NULL; + port->state.data = NULL; + port->state.mode = TYPEC_STATE_SAFE; + + ret = typec_mux_set(port->typec_mux, &port->state); + if (ret) + dev_err(altmode->dev, "failed to switch mux to safe mode\n"); +} + static void pmic_glink_altmode_worker(struct work_struct *work) { struct pmic_glink_altmode_port *alt_port = work_to_altmode_port(work); @@ -180,7 +194,9 @@ static void pmic_glink_altmode_worker(struct work_struct *work) typec_switch_set(alt_port->typec_switch, alt_port->orientation); - if (alt_port->svid == USB_TYPEC_DP_SID) + if (alt_port->svid == USB_TYPEC_DP_SID && alt_port->mode == 0xff) + pmic_glink_altmode_safe(altmode, alt_port); + else if (alt_port->svid == USB_TYPEC_DP_SID) pmic_glink_altmode_enable_dp(altmode, alt_port, alt_port->mode, alt_port->hpd_state, alt_port->hpd_irq); else From patchwork Thu Jun 1 14:07:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 687902 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2717DC7EE32 for ; Thu, 1 Jun 2023 14:07:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233675AbjFAOHl (ORCPT ); Thu, 1 Jun 2023 10:07:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233668AbjFAOHZ (ORCPT ); Thu, 1 Jun 2023 10:07:25 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52F671B9 for ; Thu, 1 Jun 2023 07:07:12 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f6e4554453so8649355e9.3 for ; Thu, 01 Jun 2023 07:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685628430; x=1688220430; 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=V3z35kLjtVuNkh8LHdIFDlyQAvirx/CBbOVPwkvzphA=; b=y5/oETRa03uuSXHwuLiyXWSVNCC9Qnzt7sq7Cb0qYu6SBkus46f5CLA5UxoSVa5vW4 64LS13I8FXyBoe1VP8sZ8owpBA91KvBi59IBoY3gI50hG2JELRBGNkP0tjORl/2/n/ho ioTLw7HG8+2038f63E9yme8Pxim4GCruGImjeeGRBecCgyUaEhUtk2Tye5Dhh8yo5jzC hGtoBLNheflJP/w4QkJYSSb5WiMGU99cCEnqP0hGET2BpqSXqgr/Yh8TnfhzSaV2UDvD 29JYf1PAoz4ZJfVJCNqnPkp1VGASNwS/4DlRU3U++PwQ5TZu+PK7u+PrIvgVExBBMSLf V3OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685628430; x=1688220430; 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=V3z35kLjtVuNkh8LHdIFDlyQAvirx/CBbOVPwkvzphA=; b=CRS+fsCNGvyVJn6tIdRdmSCQ60cE6/4tT/ohwYZOCv9JoPM3ZnEWYLmwKrFqyndYj8 hb8PGsR6zR/pM0PU1Ddv/E+TAm/z0vPw96qqtq8SJz9ki899T6lzQcaSt/g1/TU6BU+S g7stHZUCcTYSe4YavOeeiiyDBPCFK0hRExAhh5pe0Wn95EYzt09COfJbM1VaN3B8fj35 VDAfXpGBxCbaNJE90ueX3fZa1Cau2G2oPA3wC/k/UhH6XMZs+Q0VqoSWz4C8xHzk1IAk sAKLI7HppYvD21PQZsUV5xlQxSrA0pm2mULjwH8lHSBMsrdPg+VcNLOFUdBkCpzXvyXg kftA== X-Gm-Message-State: AC+VfDy5cE5/gkO6IwB0dRwtwRInx2gKn4SqTKpYx41KKiNcvtpA+SEe vssc/Ko/raxmP58wmgj+G3L4Yg== X-Google-Smtp-Source: ACHHUZ5CzLNx60c1NjSH+2PVivdCwFMDwJYuA3ptSoHHTHGRrdd+pilefHfzahocA+HHdcNzW0ffkw== X-Received: by 2002:adf:ee49:0:b0:306:3da7:f33c with SMTP id w9-20020adfee49000000b003063da7f33cmr2145483wro.63.1685628429947; Thu, 01 Jun 2023 07:07:09 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id k11-20020adfe3cb000000b003078a3f3a24sm10504166wrm.114.2023.06.01.07.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 07:07:09 -0700 (PDT) From: Neil Armstrong Date: Thu, 01 Jun 2023 16:07:03 +0200 Subject: [PATCH RFC 3/7] usb: ucsi: glink: use the connector orientation GPIO to provide switch events MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v1-3-d4d97b4d8bab@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heikki Krogerus , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3571; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=nJzT9fSe7XhRaSGcBOCqWkQuuh2QqOFxCUaZKNz/46s=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkeKYIcAjNdfLajEPadXGFRYAAiXnX1eiGjYcS0J1r 3lfUSwOJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZHimCAAKCRB33NvayMhJ0UkID/ wK4HWOcabQ64d8G4yr346nWvW3b/N0rmtpPOOcx7H0jLxfL6rrDvs0fDdvei5eDdEVrEJPGhg9cZl2 XMcJan2rmkEsdTccIEwzO1rc+FKSaT8GmMfi2aTckhTLB4oa0Wu/lnibmisRqTo4Dp0GsZrMPR4G+b yPdqkFgHbxd2F44bYT8YW2V5sChJY8qFhnHprkxTveAxSpmJgdfPTTSqXs2GKeUq60IDf21FRus7SJ lLj6d3LtTmN6Mnc+qyfDF3F4cRV9BDGXZquNOsVFS7vc2sSiS76DSg/qN8qpLO9ZiLbR7oXdmBfwGi fwtUYOnpR8aKnMXIOiXI6nHox7e65Cjnp5L+nCcE9Ny/OKYGH6onM06FRlabhuNccVmoN9nnqjdK1/ 5OszzVugczqk8TLN8IbsFGr7YMewNdihVFIzTRMd0dd3hHIzZl6hlgiP7rUk5wWKbhGXCie/anlM4h 62VnNLq9RYqgvRsm3FZD+7KckM0C+EqqAsUeIs44W5C94DVa+gdENeJUldXsXpPxJUXQfhFUgHWJvw i5Ejwql6VLXDLb0xRLyUXgbtSEb+Zd8w53ZY+ufO6QQ/ijeYSI7I82bScSRciFayIQLfaLjcp7gaE8 DwibO4KP4aKnI9PAvt8M3u5BP2wsaviTMeBxYKCeubkjvDdUuOsiRx/XyMmQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On SM8550, the non-altmode orientation is not given anymore within altmode events, even with USB SVIDs events. On the other side, the Type-C connector orientation is correctly reported by a signal from the PMIC. Take this gpio signal when we detect some Type-C port activity to notify any Type-C switches tied to the Type-C port connectors. Signed-off-by: Neil Armstrong Acked-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_glink.c | 52 ++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index 1fe9cb5b6bd9..88491dbff7e3 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -9,9 +9,13 @@ #include #include #include +#include +#include #include #include "ucsi.h" +#define PMIC_GLINK_MAX_PORTS 2 + #define UCSI_BUF_SIZE 48 #define MSG_TYPE_REQ_RESP 1 @@ -53,6 +57,9 @@ struct ucsi_notify_ind_msg { struct pmic_glink_ucsi { struct device *dev; + struct gpio_desc *port_orientation[PMIC_GLINK_MAX_PORTS]; + struct typec_switch *port_switch[PMIC_GLINK_MAX_PORTS]; + struct pmic_glink_client *client; struct ucsi *ucsi; @@ -221,8 +228,20 @@ static void pmic_glink_ucsi_notify(struct work_struct *work) } con_num = UCSI_CCI_CONNECTOR(cci); - if (con_num) + if (con_num) { + if (con_num < PMIC_GLINK_MAX_PORTS && + ucsi->port_orientation[con_num - 1]) { + int orientation = gpiod_get_value(ucsi->port_orientation[con_num - 1]); + + if (orientation >= 0) { + typec_switch_set(ucsi->port_switch[con_num - 1], + orientation ? TYPEC_ORIENTATION_REVERSE + : TYPEC_ORIENTATION_NORMAL); + } + } + ucsi_connector_change(ucsi->ucsi, con_num); + } if (ucsi->sync_pending && cci & UCSI_CCI_BUSY) { ucsi->sync_val = -EBUSY; @@ -283,6 +302,7 @@ static int pmic_glink_ucsi_probe(struct auxiliary_device *adev, { struct pmic_glink_ucsi *ucsi; struct device *dev = &adev->dev; + struct fwnode_handle *fwnode; int ret; ucsi = devm_kzalloc(dev, sizeof(*ucsi), GFP_KERNEL); @@ -310,6 +330,36 @@ static int pmic_glink_ucsi_probe(struct auxiliary_device *adev, ucsi_set_drvdata(ucsi->ucsi, ucsi); + device_for_each_child_node(dev, fwnode) { + u32 port; + + ret = fwnode_property_read_u32(fwnode, "reg", &port); + if (ret < 0) { + dev_err(dev, "missing reg property of %pOFn\n", fwnode); + return ret; + } + + if (port >= PMIC_GLINK_MAX_PORTS) { + dev_warn(dev, "invalid connector number, ignoring\n"); + continue; + } + + ucsi->port_orientation[port] = devm_fwnode_gpiod_get(&adev->dev, fwnode, + "orientation", + GPIOD_IN, NULL); + if (IS_ERR(ucsi->port_orientation[port])) + return dev_err_probe(dev, PTR_ERR(ucsi->port_orientation[port]), + "unable to acquire orientation gpio\n"); + + if (!ucsi->port_orientation[port]) + continue; + + ucsi->port_switch[port] = fwnode_typec_switch_get(fwnode); + if (IS_ERR(ucsi->port_switch[port])) + return dev_err_probe(dev, PTR_ERR(ucsi->port_switch[port]), + "failed to acquire orientation-switch\n"); + } + ucsi->client = devm_pmic_glink_register_client(dev, PMIC_GLINK_OWNER_USBC, pmic_glink_ucsi_callback, From patchwork Thu Jun 1 14:07:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 688472 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59551C7EE23 for ; Thu, 1 Jun 2023 14:07:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233827AbjFAOHa (ORCPT ); Thu, 1 Jun 2023 10:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233718AbjFAOHZ (ORCPT ); Thu, 1 Jun 2023 10:07:25 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C610F1BE for ; Thu, 1 Jun 2023 07:07:12 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f6d3f83d0cso9409765e9.2 for ; Thu, 01 Jun 2023 07:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685628431; x=1688220431; 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=gE1qhAhlgSaB66o5SMOQH1/DZyGEHuOAUxg0SjDKmKE=; b=ncTR/LFkICuOKf8JzE8mwzQkAw0gFcGx6bwSWNyTyZvT565r2K0g6cmROydYZR1K3/ GPs/14R01hYQ9sy+XqgeRbT5aL6y5bM6otfkzqmJ3/WnB/FxCxkmZuLMYFRHfBHwK1Wc 6vLIy0ZvkkX3gHPRlQ4iPaFFJSu06WUv9acFcgOFc7Ii+Ggq+BEP5LxhV0xMdNl8bWj3 TagohST1mxSOmm+NJmUR7s1fGw1Rj7zmwH8BrSAx/NPd1X7yYCA1V7QcasLAGgR5aAA0 NyJsiWKXFKCS2XrTcLM3gOK5WO4jAPe0YlkNHN4SJuRWz0jx/bLDwOl9pbwu69YqD+HA ofYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685628431; x=1688220431; 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=gE1qhAhlgSaB66o5SMOQH1/DZyGEHuOAUxg0SjDKmKE=; b=evEOApiYDXwHYdseGk+YDRRb3uxAfWROJzsN8W35xfVgMSlr48AfcvdDVgIkdLwYtr cg5k2ZtRv63Wkvxhw1d+n8MnNsByH6VsWIpPMex5iKnMtZ3Vr+ml1UyyFIjZpUg8S4yv 7VDyjxGPuZY+VCYPC+pWtRQtrpUSyTrD2BJk8zNpzzgsIE4sHrew63YJnWSPSMqUBxPb He9bpBBa2JYcz+knTjxdssHyvzOZcmOrzVAs0wi7Su3661KbZPbjH6LkCYEnJlJfeF4v R2HTC0eDda/uE6GSmheoHMYOUCheLLVEpe1QUsppLaDuY9DYcTlVmx4yF02V/dng0HNX 9CjA== X-Gm-Message-State: AC+VfDzzfwrP/vjuPPfy2HGMe9XHjqpxKr8Qr+9oV14iPL7A0ddO70Ze WVy5N1RMMEBTDEmkrmzxldLn+g== X-Google-Smtp-Source: ACHHUZ5AuOmZ+NfEXgtt168NGlt099DukYcSfpfAo7yOeBDZ/yn/lvo1Al/toGQmnwxHJRX/J3JkDQ== X-Received: by 2002:adf:e60a:0:b0:30a:f19b:ff98 with SMTP id p10-20020adfe60a000000b0030af19bff98mr2306105wrm.9.1685628430917; Thu, 01 Jun 2023 07:07:10 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id k11-20020adfe3cb000000b003078a3f3a24sm10504166wrm.114.2023.06.01.07.07.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 07:07:10 -0700 (PDT) From: Neil Armstrong Date: Thu, 01 Jun 2023 16:07:04 +0200 Subject: [PATCH RFC 4/7] qcom: pmic_glink: enable altmode for SM8550 MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v1-4-d4d97b4d8bab@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heikki Krogerus , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1172; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=z0GFmf8RXrtifMxHJ2/MNRFqa/pTMGwvA09+Qr9ms/o=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkeKYI8CawFYNKGPW6pQYZQjQsD0rKsB8i9x5OFsrg J7Wlc8iJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZHimCAAKCRB33NvayMhJ0eddEA Cu0UbnpZfBtdkq7Zuce07nIBDaroOukoUwo6zh0LsznsNjgsYFXmrKEsC3PotUrLZj+txrA5lC2g4Y 8cSTvBajiO9kMt5RHE0us+DnxbqnWWjoI+qKfzgX1KAqf544woylwpabVmJJJWUXs0rmXj5ufkaW/z KPDJylBPIp4HaeGfWfFL/tcEXMzUKZg+WMUKbw5h/6D7oymcPRm+Q28cDGtZw9ois73sw3C8j7ozmK k9xfI5TzxkjA27PwM8GIe0cKczhqvB1jE6wHW4x/m5mK/ingOZIxx+R2hFesKoWnDB/fPck1tfyMCG v0GyMvVNxveLRbTGpFEDu9xOFBxJTfx1od9KDwCqSY5deHR5RdZy+SMEAAV/GhmbMopD9NnXKn/LLo NiPSLH5j6aXExTXNvl8k+15+mQDDydTzEs+mw44URYwvcdcQD3TdYizCC7zC1cGFB9rZyWAaEugaqx 4bgqa8zWEwq+5No6s8/bjJa54NkNHJ3WGutyXxe8qhmAwnuDtZ/5PiYqXxbYtrRmSyp4I8mKL64Uur BROF+/+d4CkXTRsqErpxT327MwVyyximsd9sB9a3ZE8dhCGyc7tlHrVymb1E/YXjSMymOF9Lpcmnyn TBNAvWe8U0UzG+ihrPp5V+IuQMnP2vFgiqbX4Fl2Yq+hoHMoYd3M9ubGZy4A== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Altmode is also supported for SM8550, allow it. Signed-off-by: Neil Armstrong --- drivers/soc/qcom/pmic_glink.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c index c87056769ebd..8af06bdc6f5a 100644 --- a/drivers/soc/qcom/pmic_glink.c +++ b/drivers/soc/qcom/pmic_glink.c @@ -342,13 +342,9 @@ static const unsigned long pmic_glink_sm8450_client_mask = BIT(PMIC_GLINK_CLIENT BIT(PMIC_GLINK_CLIENT_ALTMODE) | BIT(PMIC_GLINK_CLIENT_UCSI); -/* Do not handle altmode for now on those platforms */ -static const unsigned long pmic_glink_sm8550_client_mask = BIT(PMIC_GLINK_CLIENT_BATT) | - BIT(PMIC_GLINK_CLIENT_UCSI); - static const struct of_device_id pmic_glink_of_match[] = { { .compatible = "qcom,sm8450-pmic-glink", .data = &pmic_glink_sm8450_client_mask }, - { .compatible = "qcom,sm8550-pmic-glink", .data = &pmic_glink_sm8550_client_mask }, + { .compatible = "qcom,sm8550-pmic-glink", .data = &pmic_glink_sm8450_client_mask }, { .compatible = "qcom,pmic-glink" }, {} }; From patchwork Thu Jun 1 14:07:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 687904 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ED82C7EE2E for ; Thu, 1 Jun 2023 14:07:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233719AbjFAOHb (ORCPT ); Thu, 1 Jun 2023 10:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233729AbjFAOHZ (ORCPT ); Thu, 1 Jun 2023 10:07:25 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D013E41 for ; Thu, 1 Jun 2023 07:07:13 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-30ad99fa586so892304f8f.2 for ; Thu, 01 Jun 2023 07:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685628432; x=1688220432; 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=dnxtQ4HTUnx3uNE22CEc4Kze7zRk+aIPTi5NqE0B9iQ=; b=QFUE2P2uPwuUgeO9EPIYuRP4n+DgTvh2Re4LHmFCaeZXxEXzSeiLDeMMJ6zMZSInbH oo3jHjdDozTkLhc/lzZkW9AUlHakq7/mPpsMm3svTJ305xnW1t3dCJVUaHDBVRjvqjgw RWUdunxfSgEiZ23pYoVX3wb7gDHgO1WgqXa+mUNDLC9vf2pXiExBppnFOdRNDqJo58G7 HUO7g8t5Z+zi1tmrjh5LUx6GjSJMv7VO2zOsJ0jti+gKkqarSdHfXcEvl50DkTThTeyX VninEasywFBslNABPQyVOgpno38oYsYkTcUqvbSExHETZidqF3n08gkzMFgrXt8+qGrd OUYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685628432; x=1688220432; 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=dnxtQ4HTUnx3uNE22CEc4Kze7zRk+aIPTi5NqE0B9iQ=; b=L2NDvgAUFCXkAQqtIDS0Zq4+YeF87b17o2yXEXkN+Dxr8COWYBkif9rDZUYfRzaqzu gD2zRvipCEFrF3oV9O+qQftJopJ1lL6ktGYc5vH0A0kPE3x5RrRCsvW7BKAidrLmR1D3 Ihi/dxJ59ED1/F27ynoBXiYDPMoW5X1JmM8hv+e1qRXavhdsKqAwa5IEgNcnlC6ooOHa BlByGhenL+H0uxTMCD586eRqymeBX7UEc04PZiSagx2MfA9LxEmUY0R8eYXhJWZ7RkKX IUo7il1uDyFEWww0Rn9cykOizJA8k37y7EGx1iL9bHTHfWcppnh7R44SzfBmyKZBW0Kq zq8g== X-Gm-Message-State: AC+VfDzw1xFDUaCA+mAVZ7d+WS2ScKplhAeiVIs1pDZF+X1+Z6LRfwBC ucFqs8OAVYSHtuq989AHS/gOFw== X-Google-Smtp-Source: ACHHUZ4N1LtbVcSSlgrwWiiN8ib1kk8aku1l17gEfJPD2KLnBUHb/IIze6yUyRA0cPHVitObpGphhw== X-Received: by 2002:a5d:4812:0:b0:309:4165:f733 with SMTP id l18-20020a5d4812000000b003094165f733mr2026267wrq.17.1685628431970; Thu, 01 Jun 2023 07:07:11 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id k11-20020adfe3cb000000b003078a3f3a24sm10504166wrm.114.2023.06.01.07.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 07:07:11 -0700 (PDT) From: Neil Armstrong Date: Thu, 01 Jun 2023 16:07:05 +0200 Subject: [PATCH RFC 5/7] arm64: dts: qcom: sm8550: add ports subnodes in usb/dp qmpphy node MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v1-5-d4d97b4d8bab@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heikki Krogerus , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1028; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=g7Vc0o9RsiUJlV/GgGAIcm7zZrgyQ+1KWc0K9qA4qyc=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkeKYJ3rhVAR6IdtJRTpnTUXJdYCy836TCXZnwDloY +fao992JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZHimCQAKCRB33NvayMhJ0emOEA Cb+ttzWk6oQjYgpfBF1+TtSnm+vrky8Jw8k0g/Ds9Ref7+ddLyu2L+Hw8EqnZOv5Fig3CzqkW30nGZ aIRo+g8UelTO1+T8mZmqtylF1dIcdTFRL3Yzzbk/GVOkneUNQ3pF/QaZphJafP38t4735PGvJIluRq gPnfQvzeGK+YVwRZ9CWUjYwJgozzXdzzt4kRn7eOHm3MhgiDTe4X1gOVr7WXMUIsm73p/yizdvUaev FA0AlhZXr2goebj3gpPhRnJzQbUlC2LxB1EDuK1svLHa3I5ERDwW4sRQ6eq0X9ZOJTjUdPXCbEAuq+ Igi6tdw0mswRLgFKhTvfm/vI6/6z0TE1JArFb/kezkapMnmKv66iLkWtszH2wysWjckKUrUJFiNUBG mFTG6rD/73CQvDUWqnPVvB71t+Q1FqV6IylMuipDHDVZGTaXrpMnYQUlBPE4nPL5xhLS68rNJPhI8/ ei7Tv/oOGRSIIsYO46vt9ziu0OxSG3qXIsPdTGsqrKJLNiSMeFIdK4/gDCZUR5tv8+OTRE05YFyfep 5Q/0j1DiKPBeWiOqxmoUV0S0HKjQ4gGpNwVxt+7h67bX7vk5HgoS4y8RHX8wtsNmqzr+T78HbcNNbY 9QTk0fUI+QwzEvEbF1iu3OXD6N0IaH+cLRseNX9bCHSneq0HSGxmzxqS1kgg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add the USB3+DP Combo QMP PHY port subnodes in the SM8550 SoC DTSI to avoid duplication in the devices DTs. Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sm8550.dtsi | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index b41b3981b3ce..ca2280041f83 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -2838,6 +2838,32 @@ usb_dp_qmpphy: phy@88e8000 { #phy-cells = <1>; status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_dp_qmpphy_out: endpoint { + }; + }; + + port@1 { + reg = <1>; + + usb_dp_qmpphy_usb_ss_in: endpoint { + }; + }; + + port@2 { + reg = <2>; + + usb_dp_qmpphy_dp_in: endpoint { + }; + }; + }; }; usb_1: usb@a6f8800 { From patchwork Thu Jun 1 14:07:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 688471 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 970FDC7EE31 for ; Thu, 1 Jun 2023 14:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233685AbjFAOHb (ORCPT ); Thu, 1 Jun 2023 10:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233767AbjFAOH0 (ORCPT ); Thu, 1 Jun 2023 10:07:26 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD948E49 for ; Thu, 1 Jun 2023 07:07:14 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f6e68cc738so9004865e9.1 for ; Thu, 01 Jun 2023 07:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685628433; x=1688220433; 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=na7sIcXS3nGZEOht6isKqTn7W/wE9MxlLjsQUlpCZgA=; b=CPBtHCMoTZhbq9wMjV975yNQlnVcUlP2dVsPEGnNlLV5Xd7NLy4KQBlkU75Rxnrcwg 9DZNzR++HavQmR4FqfwzlNRNU2V9yLEQ2Wg9pcRCH0cdKOicLdHDHEhPccrVHTCgyij5 i/k5UFcTQkhLMCEKgu74L6Vz6Tkbv2BguOrBO33LVhtgdHM9z9s6CU/hAvvJLkKzsR1p SO/1VCeRPnWSLrsmYFmFsrO/Ge+LHC1yO7l/o3ybOLnqsPad/3DtevxVTzFdkUAmR+Y/ Gjt1nZYcy9+Yy0pnFxl0Hhgx9JJmjpz9pG6WandoN1PybneFJ1eAXdFIWb36IWhT18H1 9nlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685628433; x=1688220433; 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=na7sIcXS3nGZEOht6isKqTn7W/wE9MxlLjsQUlpCZgA=; b=QsgT8hwb0wAwwuUcf+5LRUhJR9CF28pDUSN24f0IeIMHMm2J+MQa/RV+kvfIYYBIOO YdONydYQgA83D3Kg6FloUDuw9aABVgFeV/ebjmF6h6bv/ZuB/yzUPmNEwDCPzvsiJ1KQ 4dl+iWIU66yvVX5WxdC4ZzfzyTpihgX0F5N1vUClKxofY+Q4+Yo0J4zrQsw+CFCXB5Xl 5BvGMLL4qjT3BgCVzXZLtlPNTa81FFNvkJ8rxdeKuT8z8fzBPgdvTbLp70uQ7zXDmmYX YXAfuHwscMSpXWD6qSk0A0odY9CDwDIt5ntlzOMaCewavzLbIXsJTnOFc6aSfnfQpxpy dArw== X-Gm-Message-State: AC+VfDwKF1sM7jzGYLfcU4fHp9/cf0Xxr8aVBqb6C/frSNtn5nU92rCL de8rgSAXQ1Hb+dj6HRlzoa5+gg== X-Google-Smtp-Source: ACHHUZ56f0cPgytfUVKrMfbUOuRCHh+jqBtk/pf7kIrjXa/6JLvVr3S7zoLVHsDYPzEGQcRFsKLFEw== X-Received: by 2002:a1c:7703:0:b0:3f6:580:b082 with SMTP id t3-20020a1c7703000000b003f60580b082mr2331758wmi.0.1685628432922; Thu, 01 Jun 2023 07:07:12 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id k11-20020adfe3cb000000b003078a3f3a24sm10504166wrm.114.2023.06.01.07.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 07:07:12 -0700 (PDT) From: Neil Armstrong Date: Thu, 01 Jun 2023 16:07:06 +0200 Subject: [PATCH RFC 6/7] arm64: dts: qcom: sm8550-mtp: add pmic glink port/endpoints MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v1-6-d4d97b4d8bab@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heikki Krogerus , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2301; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=O5luTbpHIG3K4YFndZxQ5nNrwrQj52dmp08Q1lBGmYM=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkeKYJ8taxHNLBLxzirg9NPrk8xDBHhSncxuBGkVYF E0U7jCOJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZHimCQAKCRB33NvayMhJ0TDtD/ 4jHNLRLojVuxmK/Azr0qE4LlFkX3VElsDTQtMPH3p6lTILUa+ZPJPCgVO1h5fYt2uC03E2diJ/vX7c dVgfqivj/MrDbRHjLdk5xTpCIfDJr56UExmAbKHMlk7wnj+u9k8i2wHOfePVrRWgrXbvQWtaoaAdMK QMRnhAsMaXnibp/gJ74YMsTDFINi+Mh5kPqXbglyfp2bmDbbCt9Kh0YvuSbhQXnasWlziza1ittKmw O3Ptv0VTymaZ5zDEteve6ce73+6UdYXua4FJ5JHTPBOL2llXEk0dh+QlQu2hTyfQcsGSjxwUHaoh1A 5avf4J8+fNxR7xGDcU0Nq4/rIVrRcTpPNH9RUUK4xFsq1TgG1DXaZbUyFq9EiZLUzz3YzfUGTjZB4l q7ZgMvpMuDK3v+XaoZkt+kxcjdBr5WXp/TzIHBA5fRA3/JLvyCXHi1Mrb0hJ58uqjsT+1bd782TciO grtjeMhqi4EUaCXJQjUROo9R3LbY7AH0ZEO95xNYL4ZUe1dyCeEHybDmsL33Hjhkq1XrTM46buFmyE N+QyF1hlYaO47HE6H8SpCwx6gDRakE0xCTTNeUhRLNPpFmyMkDdazfjlZNmh7Kpt9QH8AP7olQVLo/ W4aoqMs8nvlDTEXKb38IE7e34Jke4bvCXnf5qBkKoPpm5SLxx7QDHC1pQVDQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add nodes to support Type-C USB/DP functionality. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 67 ++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts index 579f65f52370..8d4741404f2d 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts @@ -80,7 +80,15 @@ port@1 { reg = <1>; pmic_glink_ss_in: endpoint { - remote-endpoint = <&usb_1_dwc3_ss>; + remote-endpoint = <&usb_dp_qmpphy_out>; + }; + }; + + port@2 { + reg = <2>; + + pmic_glink_sbu: endpoint { + remote-endpoint = <&fsa4480_sbu_mux>; }; }; }; @@ -419,6 +427,38 @@ vreg_l3g_1p2: ldo3 { }; }; +&i2c_master_hub_0 { + status = "okay"; +}; + +&i2c_hub_2 { + status = "okay"; + + fsa4480@42 { + compatible = "fcs,fsa4480"; + reg = <0x42>; + + vcc-supply = <&vreg_bob1>; + + mode-switch; + orientation-switch; + svid = /bits/ 16 <0xff01>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + fsa4480_sbu_mux: endpoint { + remote-endpoint = <&pmic_glink_sbu>; + }; + }; + }; + }; +}; + &mdss { status = "okay"; }; @@ -459,6 +499,15 @@ &mdss_dsi0_phy { status = "okay"; }; +&mdss_dp0 { + status = "okay"; +}; + +&mdss_dp0_out { + data-lanes = <0 1>; + remote-endpoint = <&usb_dp_qmpphy_dp_in>; +}; + &pcie_1_phy_aux_clk { clock-frequency = <1000>; }; @@ -652,7 +701,7 @@ &usb_1_dwc3_hs { }; &usb_1_dwc3_ss { - remote-endpoint = <&pmic_glink_ss_in>; + remote-endpoint = <&usb_dp_qmpphy_usb_ss_in>; }; &usb_1_hsphy { @@ -668,9 +717,23 @@ &usb_dp_qmpphy { vdda-phy-supply = <&vreg_l3e_1p2>; vdda-pll-supply = <&vreg_l3f_0p91>; + orientation-switch; + status = "okay"; }; +&usb_dp_qmpphy_dp_in { + remote-endpoint = <&mdss_dp0_out>; +}; + +&usb_dp_qmpphy_out { + remote-endpoint = <&pmic_glink_ss_in>; +}; + +&usb_dp_qmpphy_usb_ss_in { + remote-endpoint = <&usb_1_dwc3_ss>; +}; + &xo_board { clock-frequency = <76800000>; }; From patchwork Thu Jun 1 14:07:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 687903 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95FF7C7EE2A for ; Thu, 1 Jun 2023 14:07:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233902AbjFAOHe (ORCPT ); Thu, 1 Jun 2023 10:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233798AbjFAOH1 (ORCPT ); Thu, 1 Jun 2023 10:07:27 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37EB7E53 for ; Thu, 1 Jun 2023 07:07:15 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-30c2bd52f82so943190f8f.3 for ; Thu, 01 Jun 2023 07:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685628434; x=1688220434; 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=4orPicnt68KcAk51goo/EZdt5c9EB1sU8JStjJm7IEc=; b=ExQKvzEoBSwlAyG1Wemz5LrDsU4TsLGKzctvRbL0HH+OV8JgNX9UeJOFrfAnk0CbZm fcECF86KhXQNoTLTTSomLr6QnRtIU/Rz7cwlfCtoHOFqm6ckfZv0RDlegMSNryt8Nd3j O9pAeSJj/edIgYY2zA3VouMznMd6D+6paw1WWPrbrR0X9ruq+I4OEmjdiHg6FhIyH6xP XxXH/E+Q9n3K4V6LNkhgceHemkuNPi5qk7ZDhEA8/NnCeD39RBgHhl7elEDlm7DBRoBG CEYuPgesulwwy3A1Gs3rX7by4QZjohE2Gh6O/1bVJTCcOJjTURFsfyTlQqWEeLQSUH61 zH5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685628434; x=1688220434; 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=4orPicnt68KcAk51goo/EZdt5c9EB1sU8JStjJm7IEc=; b=fvXxmtzV48v+z5sFYePOQpKUPgcWBN9pWKiZALxUWE4NU77rmmBPjWWQQBzg/8o3f4 m5SOBNgZKHnh2w2QzrdV8K96X0cCeqponiUhI4czwFSaCqhH8qaKHaVWw5kTinlVqg4n rNHe+hLt3aQU/wITCnRolz5nvugz8zgZmbQWY/BXj8MoflMnxlWFUJlsg9JA77MkoYDx fADyBh6PBklY1E/1ZRJ30K90en1vg/LjIopgCt2tmrFoHr3fRXxxAbvRMD9mP7H/r1zk nnVAyhSvWSQxCJU8SLMrfVhhOXOQmHCC6I0iX7BliU+AIN/5Hr7vm5+EotIEDIyJ0AF6 O7sg== X-Gm-Message-State: AC+VfDykKdMjpkCoONyf4f+TDA9ov6whviIvugSl1M2zVnmWJIHLgZFL 4YFv/7jGNcicV30KHn6ZOpxq9A== X-Google-Smtp-Source: ACHHUZ7rsW88N6lOxdJEgvlQNko6WAiNoPfRl9CKXdC3X0aZFPLtHge3mhbdR9rSridmzH5YyHBkIg== X-Received: by 2002:a5d:6889:0:b0:306:3204:3633 with SMTP id h9-20020a5d6889000000b0030632043633mr1967387wru.22.1685628433808; Thu, 01 Jun 2023 07:07:13 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id k11-20020adfe3cb000000b003078a3f3a24sm10504166wrm.114.2023.06.01.07.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 07:07:13 -0700 (PDT) From: Neil Armstrong Date: Thu, 01 Jun 2023 16:07:07 +0200 Subject: [PATCH RFC 7/7] arm64: dts: qcom: sm8550-qrd: add pmic glink port/endpoints MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v1-7-d4d97b4d8bab@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heikki Krogerus , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3104; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=2o8Mr95zHAAYTm7V2lzbLu+s4H+9UDeicqA1V3dHXNo=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkeKYJmAFvc6BjEkKgpghb9tYE0YV5C2eXm9oGCQp7 R/7e+iaJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZHimCQAKCRB33NvayMhJ0WooD/ 9/xGvuH88qDBLtFtze9Ine8Ag3ZbydiMNbl2M8Bg8RIl10V68FmzQyCfpMOt33COaeYLHzqcegp/mA MJjJ9yX7GFTUbdUWgARFKbeRbDIAKuFnrNcQIt9Kdddfs0CJxwB5K6yo8PYnlInbwsz71P289GFCKn gKOoj5I0EJKyxtXfacHYzclDPSaHBc0YumgcuTc1cVsHQ2C+GGewSSAyUAb4h92Al9dNEJAgD6DKi1 K2gC/jhyP4CrXeJnXfDlNE1iLMX5NZ7T6PjchqaeD6vcJv7bgt6IfY01jfXfWYV3IuJamTbdzH5OSz SidVT6thXS9IO5ui6BbNahXnJMnzAybJX8Ip14/WdzLKFWWCcujF3hp2TQ5ztxHq72nfrnqMuJ2ZOo IZRoZyzBXtXiPlfSPXo6eRTGml2TpeM/bUmtf/yqW4msaKikzuex2/2YBtHgzRCO7Cx9+bu7jFq9tH XzjTB3xoYrv9rWAT3UHCHjIgG0H1wb/tDhZvImtmDQ14Yn/rmskFbMQohuu0dHgCqUtl0R3Bg7QOYB osQyUKDdCZ71810TLxgPjca93sxca3T9vRqzPNg4eJnrHbd/v6DmfdVOEaMTkHbixeBt7hUIY+YLDA VmjY4Z/mpTr8vn4B49cj2p1g+iR8eF2L7Vt2zSKA1/PZROrIh6xjxkgouNbQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add nodes to support Type-C USB/DP functionality. On this platform, a Type-C redriver is added to the SuperSpeed graph. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 99 ++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts index 8669d29144bb..edb31efa563a 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts @@ -64,6 +64,7 @@ connector@0 { reg = <0>; power-role = "dual"; data-role = "dual"; + orientation-gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>; ports { #address-cells = <1>; @@ -81,7 +82,15 @@ port@1 { reg = <1>; pmic_glink_ss_in: endpoint { - remote-endpoint = <&usb_1_dwc3_ss>; + remote-endpoint = <&redriver_ss_out>; + }; + }; + + port@2 { + reg = <2>; + + pmic_glink_sbu: endpoint { + remote-endpoint = <&fsa4480_sbu_mux>; }; }; }; @@ -420,6 +429,69 @@ vreg_l3g_1p2: ldo3 { }; }; +&i2c_master_hub_0 { + status = "okay"; +}; + +&i2c_hub_2 { + status = "okay"; + + typec-mux@1c { + compatible = "onnn,nb7vpq904m"; + reg = <0x1c>; + + vcc-supply = <&vreg_l15b_1p8>; + + mode-switch; + orientation-switch; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + redriver_ss_out: endpoint { + remote-endpoint = <&pmic_glink_ss_in>; + }; + }; + + port@1 { + reg = <1>; + + redriver_ss_in: endpoint { + data-lanes = <2 3 0 1>; + remote-endpoint = <&usb_dp_qmpphy_out>; + }; + }; + }; + }; + + fsa4480@42 { + compatible = "fcs,fsa4480"; + reg = <0x42>; + + vcc-supply = <&vreg_bob1>; + + mode-switch; + orientation-switch; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + fsa4480_sbu_mux: endpoint { + remote-endpoint = <&pmic_glink_sbu>; + }; + }; + }; + }; +}; + &gcc { clocks = <&bi_tcxo_div2>, <&sleep_clk>, <&pcie0_phy>, @@ -471,6 +543,15 @@ &mdss_dsi0_phy { status = "okay"; }; +&mdss_dp0 { + status = "okay"; +}; + +&mdss_dp0_out { + data-lanes = <0 1>; + remote-endpoint = <&usb_dp_qmpphy_dp_in>; +}; + &pcie_1_phy_aux_clk { status = "disabled"; }; @@ -650,7 +731,7 @@ &usb_1_dwc3_hs { }; &usb_1_dwc3_ss { - remote-endpoint = <&pmic_glink_ss_in>; + remote-endpoint = <&usb_dp_qmpphy_usb_ss_in>; }; &usb_1_hsphy { @@ -666,9 +747,23 @@ &usb_dp_qmpphy { vdda-phy-supply = <&vreg_l3e_1p2>; vdda-pll-supply = <&vreg_l3f_0p88>; + orientation-switch; + status = "okay"; }; +&usb_dp_qmpphy_dp_in { + remote-endpoint = <&mdss_dp0_out>; +}; + +&usb_dp_qmpphy_out { + remote-endpoint = <&redriver_ss_in>; +}; + +&usb_dp_qmpphy_usb_ss_in { + remote-endpoint = <&usb_1_dwc3_ss>; +}; + &xo_board { clock-frequency = <76800000>; };