From patchwork Tue Jun 13 07:55:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 692541 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 839F5C88CB8 for ; Tue, 13 Jun 2023 07:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240720AbjFMH4d (ORCPT ); Tue, 13 Jun 2023 03:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239045AbjFMH4U (ORCPT ); Tue, 13 Jun 2023 03:56:20 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25C7310EB for ; Tue, 13 Jun 2023 00:56:09 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f8cc042ea9so2407745e9.2 for ; Tue, 13 Jun 2023 00:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686642967; x=1689234967; 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=hFkrWIS5bTgKzqSbTWsL+LQ4FdpiC/6RkXvEbzD8M9A=; b=FOPC8kiSlLh+y857Db+MTFNEIH5gexzBwZIgbkhs1QQMN3ZmI84hdzx3vTTs5TI8/C pUx9mLGrR2YfIgwSO0XAb0HU1IQjYIrKu1xol3ALq3pvQHTB9GeW4AFKcV7DGhYWODTi jZ/W/qky3fVfZNfPYw/F5NB2BExwGzTY1ag06PmgI/ABvB0tTobuDNUL2Gglff/WPeTU inL9zHZWMoyt5NL9jtj6wlIUZakgKPGb4UEBZInKZ0k4QFrEXKceoXUPaZcKz8RR3Gi/ ykG+OH+GtrfTOPmVZlLoQTsZkjB/Xfx5iBVP04nafPGBXxkE9YP3gdqrtyEpIPwPQ6Rd lmoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686642967; x=1689234967; 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=hFkrWIS5bTgKzqSbTWsL+LQ4FdpiC/6RkXvEbzD8M9A=; b=ABvT238CxMbwOu9giArJ/s9AHJl+G6OOdowznrwI84JqLi+ABNiXTcfy4qiVMfpJMs 3Jay5uxPx3LlrBWyvjxGmkbVBsl7JRn6MMyJkPsHyVA0SIjBl2ZGx67pWpwYDAx4IGvh EoiBihGpEEquA7EoJ03Swirf8JlDTWoYPmH9WCQH7f88N4/8GItbGZ1pATlg/oZYyK5v b4Acf0n33yGC3jOeKAzDy1WcBwjcS7E1TYJNiJb9Yip7RJcMrMg4fpMtiCOfbdq2E3Kx JTsKFXL4YoPcBADe1rmMYdVik0E5eLJRfLzGeP663a45AONDol7S2nfcuqN17WyKfA+6 6hLQ== X-Gm-Message-State: AC+VfDzBxN/LJuMz/ZPsv9rsyLQq+RseX2iBg+274MOoJFJ1zApkbsTX W+7Opz8RUkINy6blt6YPXDRU5Q== X-Google-Smtp-Source: ACHHUZ4xLB1h2fdCc2fi9RMGZfwhSTAntDX/guJbaSrJZRWdPFElZNFVDVCahRfFLVS+ga/mQLrYhA== X-Received: by 2002:a7b:ce16:0:b0:3f8:10b2:c758 with SMTP id m22-20020a7bce16000000b003f810b2c758mr5572235wmc.29.1686642967548; Tue, 13 Jun 2023 00:56:07 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id k20-20020a05600c0b5400b003f4266965fbsm13662316wmr.5.2023.06.13.00.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:56:07 -0700 (PDT) From: Neil Armstrong Date: Tue, 13 Jun 2023 09:55:54 +0200 Subject: [PATCH v3 1/8] 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-v3-1-22c9973012b6@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@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 , Krzysztof Kozlowski X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1291; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=2BYsv45cOvI4rMBwObrYr2vtUKgDMNXxdkhZSI9+W3I=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkiCERslqlmYTKcm2zhP2O1KPaO3rkmaS+7+l1QDi9 ViKJcIGJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIghEQAKCRB33NvayMhJ0TiMD/ 9m8G/R4Ga9H/Umr4xI0N4kBRmaT0Unmh/JjogJsUKEDByYxTDiikQ6TPyFsamfSEvmQHuzUFid6QMu 1Lk2vF8DiDgNhARk542FV2JJy7y2cTHHf/Ced9Nv6RGVcdUC1FLGegwx4p/ddld9M/PS1Fbv5BX1L9 RWCupTQbejZxWq6OHQoE7tJma6G8pUWGmb/O4Fi6rWZq/LrPEaMLJnR/d8MQQ6CSbqHiuEQvUf7QfN ryNCo66udfcZ2g3sp09FyNuOtCLvmMGvY3p0NurC2NZzPsnu31/SGbVdu3hnBZy6cqHwxS+XpcvI3V J9yxDL2ePF6+ST3BrGti6pS/MxWoWF5PgL/TBVhnKMMeliw7zHevLh3N4b4OOzILZtR7gHnd41UFDd N/Byk2IrdN6sWP+cayQzcKFeDFZ9sTlMkdfYAdWUlTVVTeBC+PERMZHQot9Mu1FhaLeLyuN10DAwpe 5nkJrAtQwKZUCgRbtKgID/vsv224Y5QBkju0tGNsoq0bVo9DMrnzf6wVsbACL/gGcgYsE94Gl5K3ex lS/AhxFBzI/6XV5rOvmpnKrdv4P4HVT6NkEY2netY27bfFAI4wQR443TTYWjZqtM6PmfeIe2Se/17g epCZ+IHTKK/tvi0l7K69Y66J+zjzHVE7abTeq1GpeBSHRTmCWAfbarAj/bbw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-usb@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. Acked-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong --- 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 Tue Jun 13 07:55:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 693231 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 58B25C7EE29 for ; Tue, 13 Jun 2023 07:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240766AbjFMH4i (ORCPT ); Tue, 13 Jun 2023 03:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239724AbjFMH4X (ORCPT ); Tue, 13 Jun 2023 03:56:23 -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 0FC4510F9 for ; Tue, 13 Jun 2023 00:56:10 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f8cec6641bso2358635e9.1 for ; Tue, 13 Jun 2023 00:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686642969; x=1689234969; 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=yI0KfpvMYAVhst/VjwZPYlKi3apIdLLfB9OLYcP+rjSND5KVbBz4quir9YCcnwMqTS 9e3C4bp2fABv7ttsTxURH2bDSTlCH98Y/4HnF1ny0RrAvWE34h8/qaYTV0dUkOVhYERS v0Jw7ijYc4VxaEuRvhx0TCdBEM4fvxEBkQCdv9wyuDVZkVB2As3IhWyXbzuOyw8GGpUO lyyM4pTRvUTfJfo7jhmjGeuqfkF/2b+wb8Zva0yuMhOmCwic4KISGW+PMiql3aycTu3r MHgHqYHtYNyyPWFiDp/xydOyg6oZEIdcqAMja0ya2WWuvDamOtrWFpW6h2lyj+C/q84J Xkpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686642969; x=1689234969; 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=N/3zm0H42g5z6wO3VH4DC/YempWL3oZHSSDTIDGq2xBCuPB5ymliUmwwKKo/iA/YQH rLSEsjYAV+yw890Vo8+PIy8zFsZYjiA5hU/adrG5jZgyyTgMT3b3hDk4vfTarap07VkV T+MRlL0TSv/L2LRi8X4ouO6/ysT21p2ExJz+OXR/ZcGI4tsZEPLEUTlfaLi7YZIBBkgZ uhSGlehWn+HzN1LkgGlqYxpIlwT6r78VDI9mbov6Fv0g83WADRcKzthe9zQm/gH2Q3+N EaH0kng0wBmFDLsLHiSQvlyJyq1nvcFfKJzPwZFYzRLDMMAa7amM8e2GXFH2onGXc6FY Omhg== X-Gm-Message-State: AC+VfDxsHrbmuTj1CM4MbulkbSPUzUrOv8g3vPBj8IRFaxJcMf6amfU+ glWG2Z3aPrFleLwHW/8899CLhQ== X-Google-Smtp-Source: ACHHUZ7hGwHrv75NCopv0xUxhoqhqggmmbNZBRaZT9SLhZPRTdJXuMNZaTsak64W654oe0hzb6VqOw== X-Received: by 2002:a7b:cb8f:0:b0:3f7:26f8:4cd0 with SMTP id m15-20020a7bcb8f000000b003f726f84cd0mr8579223wmi.16.1686642968523; Tue, 13 Jun 2023 00:56:08 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id k20-20020a05600c0b5400b003f4266965fbsm13662316wmr.5.2023.06.13.00.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:56:08 -0700 (PDT) From: Neil Armstrong Date: Tue, 13 Jun 2023 09:55:55 +0200 Subject: [PATCH v3 2/8] soc: qcom: pmic_glink_altmode: handle safe mode when disconnect MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v3-2-22c9973012b6@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@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/ZANAwAKAXfc29rIyEnRAcsmYgBkiCER/WuXCeh7DJtSTsu0fX5PE6QTlxLQo7r9b4PY kJhHAr6JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIghEQAKCRB33NvayMhJ0SYGEA CLpqfOBhCmrMTFxfuJS7/Xi7967jZl8n/1eErD9LPr0JRZCHVYjx4NFLnBoUj5NN4S8hREQnsWM98W uG6Iwj726lfhlivMwB9XN82HX1Y8frylJmT1iwTT12Qj+Ec47Z1eq435Zpmgfm7v61mUzjssw0Sxvq ZKxoml57Ko16TZE+0LTMw094uK5qYG5wIjnggnkXPjIKx9uLcBS6GIkLI3GpGsMpzGkWpVlilOMN3R YZIEpaVTCL8HSGwZQVpxqsIoMfzviDgFrW1XHsnT30SiU/BJyv31k6tyjdbk9aE0mBZVCgJuN154xT yNcqbj5yjK3E30mu1KKLKMyJhJ7HXVoPD3JRdyqDbPJZkKOIyNQ4d5yh+RRZ73WThTtmNVyZJv/A9Z cRUHiN2m+YwpaWazxAAOAc2wi8msOLhcecvEAuydS7VyPfSrF0B5Lsmxdv/xbBFsiEqD36YD+htPe+ l0T5nOUAYbUn6HIK/O2vqs9Zx4hESJ8B1wEhZPQui1Yn7oSbNnJImr/ULKCbSQbhGUftUkVom778jC rqG2Zi1qTTQbb61qVr9EwqD2YJdyRwkFYBy3t79qo0GANSizxRQkmgZiMu7/T8YpiRixGqdlQ69hWW 1plfmsnOwM9V600MUl6tp6GCbfxXFXGyd8/8ZrADsFM2muNZ8eNgBUdlmQiw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Acked-by: Heikki Krogerus --- 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 Tue Jun 13 07:55:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 693228 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 86DBCC77B7A for ; Tue, 13 Jun 2023 07:57:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239385AbjFMH5D (ORCPT ); Tue, 13 Jun 2023 03:57:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240274AbjFMH4X (ORCPT ); Tue, 13 Jun 2023 03:56:23 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52CD9170C for ; Tue, 13 Jun 2023 00:56:11 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f642a24568so6292083e87.2 for ; Tue, 13 Jun 2023 00:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686642969; x=1689234969; 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=MtzYn96ig+lorMysgzvmIhs2jjpLBGL4+9ZV/9hvBQI=; b=k8TIUsB/iXI0lC5SdboEOO2KB3he+vQ7GEmCF8FiuPxg1nBZWhgQ3xzMKPDzsVTBZy u+9l2bmxoScub9n8Fz4RRxHqTCzMrCDtmQxiVRlTIYpEx8+z8Rcmg1x0EB0u/+IHaaOv dL/dIcJF4RRhMNFz8xsMYWH2KdTWHpfF8ObjYeW6/mnfGmZhistErnqxGWhhM/8sCSHA JU34YEb0SNnshzhqLaUsoUkxTUuNKnlrI+z6WFwkE0H9hiGPJCTcPt/KsXEOXTqNNWEL BHanTz3qm1VN+nc70Jf0gO1d6Bjb7hjs9Ed8shtEw8UAfeqgrFbSu7g6LIh+V6iNr+tm mdNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686642969; x=1689234969; 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=MtzYn96ig+lorMysgzvmIhs2jjpLBGL4+9ZV/9hvBQI=; b=Lv5vOIGWPNH5SKZ/BiWeQulacCmtAz9RBGefR2NWxbNBucpakFiBj+eocoKFWLHuDC kZm240yFMnuWlIUk3IYNXWIVmnmoPM1/MAS3QWWSC0FTp8TABWCkioyqs9Nu/5QzC+qC ZyKDA4l6domE63LcTOG1N8mLJOZXJIWzimUab9DfQRadMNl7dnQV5yemRLouIo/4om8l 6ihIwb/ObGpksJEx+k4Kgkj0ybzMwo/s19eBtSjSheohW65eZTy2T9HDhGFwoDJbVgRH +S1h9T+9qb7helacjjAYqryKXyQGDQ6h1E4ilHJXV/y1GQpIMYzYmhjYmQ4VLTiwI2wz hbyA== X-Gm-Message-State: AC+VfDy4h+RLJGH3BNMBGMdQoLcXnRRk9f9KYHyGW3FnAc5rvlXTmv91 SCuXZTIzX6taVkt7lVAdaNbf93/GT1rS9MU3eKCGzw== X-Google-Smtp-Source: ACHHUZ66ta5ooumpF/Z1eXdJbdZ/nGCsK+Bzeb5GVy76Dl8WBDN/8bFOIIwNbYj0YhWaHMg9bM94Zw== X-Received: by 2002:a19:4f44:0:b0:4f3:802c:7725 with SMTP id a4-20020a194f44000000b004f3802c7725mr4646102lfk.30.1686642969626; Tue, 13 Jun 2023 00:56:09 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id k20-20020a05600c0b5400b003f4266965fbsm13662316wmr.5.2023.06.13.00.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:56:09 -0700 (PDT) From: Neil Armstrong Date: Tue, 13 Jun 2023 09:55:56 +0200 Subject: [PATCH v3 3/8] usb: ucsi: glink: use the connector orientation GPIO to provide switch events MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v3-3-22c9973012b6@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@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=3632; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=dJsk94W4hJQWsF7UZ7NHEWxATRmNKuU8IakNNu3DGzw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkiCES35zFxYcGDLdJLU638f1Y+Lvby72mcOP4IAUS 45gwBFSJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIghEgAKCRB33NvayMhJ0UbkD/ wItZqCtSB/V4zzpWsPDA22v9WYMqYrVjwANTDvfUZkRGupbL/CbqOCFiq8usU0LX5h+BnAF5pLPygU qyB+VEQwgO2xhq8pqA3SOcaZsFV6GJ0UqAvQ9w3IEy0odji7lod2PJIYy4K+fLZHXh4cSi7j/l7jz+ VqxvQue6Sd1JjDFYGVhKh71Xh6ppUVQwN6MCOhwtiZe3OgL6h1i01wuL/CTJk8jl1Uc/7/aOrNGXW2 Kjesx+0N9oKB985iLcQ/fdBJTtoj1/xYbzRiCClzlERLUBaDWMZrEmRvstI+HWS+ssOBRMHQb6ME4b Ie6rvgolbNtDDDn7VEvw0dAEwtocN5GFy2O1cVpjEmO4US/73A1i96S5qZY7FvrqXIQywJYI+nF2Lc 90c83t94Vn7OaHiQ20davjBfSQ9jU8jqpXQS4dvbdVB0WKT0NTpoHrKQC5rFQ3fAswAOv0NsJgLQOl SeniWLvYTAOiMEn3PemCRAkrnywN1Di0Z7cFStw2UDinWFF+5gY+vqRuSNLupp49sy5s7Ki4SkZPWI iihX6YbSCgIWjfhQneITzi9hziBCPYHt3+PnIt2kI9WCMjR0+IwaP2K2JHsdGDOc4dn5CkwJLuS6c0 gfFozIKv/yfDdjz2o5V1InYAmJKMWLmBFwdvCqRQjFkf/lyXCBQksNsAEZCA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-usb@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. Acked-by: Heikki Krogerus Signed-off-by: Neil Armstrong --- 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 Tue Jun 13 07:55:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 692540 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 2C602C88CB7 for ; Tue, 13 Jun 2023 07:56:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240708AbjFMH4k (ORCPT ); Tue, 13 Jun 2023 03:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238596AbjFMH4X (ORCPT ); Tue, 13 Jun 2023 03:56:23 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65AF11718 for ; Tue, 13 Jun 2023 00:56:12 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f6dfc4dffaso38612775e9.0 for ; Tue, 13 Jun 2023 00:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686642971; x=1689234971; 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=8W4DDI67tlbAaFkIpRMuH4m4GXyLOYQLIt7UXn6qsRg=; b=IZ+56ICQhYAEP3JTkTvPnGa7/R8yALyGiTC1BJAjbOxSDdcZFB49umC5gMOFd4Fxud dl3LsNaIIswLxLPdCHLXOPg0Rn4juifFwrFXM2WS1jfAkwbSIfh1a56dKxZzFwATK2UR ft3E1w8Bmwf+0N99ANn3HMOiuNA8b2VECeKTnRQtQ87FCnwMhPF2DR6UpMzOfTX9p4xo DQEE6+LW/gF4s/8rNGM1OvQsbrGnIGqplipHyBIMKX/iMQxwdOPrpbvXDgWFxeOhT9Bb +FpCYz709Iy7z/NINjV71BfSfoAmYBDRoNEYdr0M5szSk+8It2Q1usxveOXTK6Xxxu57 sQcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686642971; x=1689234971; 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=8W4DDI67tlbAaFkIpRMuH4m4GXyLOYQLIt7UXn6qsRg=; b=jK1kRUJbkNakeYJhfjUOjYHUYHboCwbh1P5BBWAZmrJ5Jn25dBOwatgFNxFR4Y6eR2 BWnqOYjxDcdQYJJ3f+QYNoN4V60BzgwSx+8JgoiKOXRQje4TI7H0uMfruNYD5uXmgy88 INy4fd2IfvkDj1iVuJ4XbAFI0WPwfo2GEuJ+7Jpp82Y4X7Ohm1/jrtwu+TKFivYYm1fD yUYlQN+B+r9Th0UW5jQOaFlCtyIfRtFqqBVHpKhLxLp0Q/0b7crZcbscPSNAxpq27CQr Qy84HN0ztg2RaqoMHzZsrJ6Q/Jf8FV0NyC9FZzKovXUYodnk8xOZR7uBSnjcA2afRWbT Q6oQ== X-Gm-Message-State: AC+VfDyEePaXBBJKY25g0O92HV+PfkBivooSG7fqNl65Ys/3OdfNAI5X MPg5jTawWSbAjiFYVdC0sUV9Og== X-Google-Smtp-Source: ACHHUZ4jjQQ6fkfq5aHsPGYujSfRUBHzEFHJGX5LgUATnUm5UPaqMaBsAE1bQR+87OJcUGqlOOtPGw== X-Received: by 2002:a1c:7203:0:b0:3f6:580:b082 with SMTP id n3-20020a1c7203000000b003f60580b082mr7225804wmc.0.1686642970618; Tue, 13 Jun 2023 00:56:10 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id k20-20020a05600c0b5400b003f4266965fbsm13662316wmr.5.2023.06.13.00.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:56:10 -0700 (PDT) From: Neil Armstrong Date: Tue, 13 Jun 2023 09:55:57 +0200 Subject: [PATCH v3 4/8] qcom: pmic_glink_altmode: add retimer-switch support MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v3-4-22c9973012b6@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@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=3944; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=fCvaaaAL0Gx7Xnks6/BexPRt3VhZDwY4J3jOffW33Do=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkiCESpq85KSFlDFjrIEDli6bXlDoTgLhC6wiEt1lZ 1tY4NqKJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIghEgAKCRB33NvayMhJ0S5EEA CEjEOZQKJ4lBBRM1BcRNQYpWofQtcXxe+o09Exwq8JrghqkpAacYu4hKxJHoMQ1VOarYySYHchfmRw sxc6/gxiG4s06vkj3oVJn/yr/Ka1v5Lndj29GmsGb+NsRsU6AY9V3yr6Igepq21IcTlSVuwXWWen22 qGTG1CWZFwgA0z5oGhNRy+HmCFww/uDWFYqLGCR9IjhIsOtQCScEVQAhAXclv/x6eWsw1CLp+mrVpY JV1dEOIn71kGbmt21a5PVHECj1Tj2ie6G2xUzOuasI805MKlTHlVNcVxPYlI4qx0fNQnMzQPOwUYY1 QkCt2RcTXaspVWRVoEFC911P0+7JgoZEU7Ozcxj8C/xhqqhO6EvsYBqWkpzNP8H7jF/VcPLShTHoKg kjzkBU34qjvaser05a1+eRMq0Ovqme45MPhT34A9E7iWJ38sHgPGTEgHykxQ1nZii/Bv409syFi0sT +Q3CriIWoKxe+kB0o6j4ROCp0iWkSC52ZvouLfOuzpUZ4TT8hypGudFt9ZPrncB6qzzpJGcJHIp+lc AFl7/LFHEHh54NQVmh3KH1teoWwXxKanZVAAkJG/q2abVJoFL7IM9qyCve3EpDU58dWPFIzgV0YipK 8dJDT0bre1GiRTvX9bAamkRGDUoOtiv42Q4TK7K/ophojXHI5z5rlqAfAGWw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some boards have a retimer/redriver between the SuperSpeed PHY and the USB-C connector to compensates signal integrity losses mainly due to PCB & transmission cables. Add support for an optional retimer-switch in the USB-C connector graph. Signed-off-by: Neil Armstrong --- drivers/soc/qcom/pmic_glink_altmode.c | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c index 007d308e2f15..41d732f5b647 100644 --- a/drivers/soc/qcom/pmic_glink_altmode.c +++ b/drivers/soc/qcom/pmic_glink_altmode.c @@ -15,6 +15,7 @@ #include #include #include +#include #include @@ -68,6 +69,8 @@ struct pmic_glink_altmode_port { struct typec_switch *typec_switch; struct typec_mux *typec_mux; struct typec_mux_state state; + struct typec_retimer *typec_retimer; + struct typec_retimer_state retimer_state; struct typec_altmode dp_alt; struct work_struct work; @@ -157,6 +160,14 @@ static void pmic_glink_altmode_enable_dp(struct pmic_glink_altmode *altmode, ret = typec_mux_set(port->typec_mux, &port->state); if (ret) dev_err(altmode->dev, "failed to switch mux to DP\n"); + + port->retimer_state.alt = &port->dp_alt; + port->retimer_state.data = &dp_data; + port->retimer_state.mode = TYPEC_MODAL_STATE(mode); + + ret = typec_retimer_set(port->typec_retimer, &port->retimer_state); + if (ret) + dev_err(altmode->dev, "failed to setup retimer to DP\n"); } static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode, @@ -171,6 +182,14 @@ static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode, ret = typec_mux_set(port->typec_mux, &port->state); if (ret) dev_err(altmode->dev, "failed to switch mux to USB\n"); + + port->retimer_state.alt = NULL; + port->retimer_state.data = NULL; + port->retimer_state.mode = TYPEC_STATE_USB; + + ret = typec_retimer_set(port->typec_retimer, &port->retimer_state); + if (ret) + dev_err(altmode->dev, "failed to setup retimer to USB\n"); } static void pmic_glink_altmode_safe(struct pmic_glink_altmode *altmode, @@ -185,6 +204,14 @@ static void pmic_glink_altmode_safe(struct pmic_glink_altmode *altmode, ret = typec_mux_set(port->typec_mux, &port->state); if (ret) dev_err(altmode->dev, "failed to switch mux to safe mode\n"); + + port->retimer_state.alt = NULL; + port->retimer_state.data = NULL; + port->retimer_state.mode = TYPEC_STATE_SAFE; + + ret = typec_retimer_set(port->typec_retimer, &port->retimer_state); + if (ret) + dev_err(altmode->dev, "failed to setup retimer to USB\n"); } static void pmic_glink_altmode_worker(struct work_struct *work) @@ -347,6 +374,11 @@ static const struct drm_bridge_funcs pmic_glink_altmode_bridge_funcs = { .attach = pmic_glink_altmode_attach, }; +static void pmic_glink_altmode_put_retimer(void *data) +{ + typec_retimer_put(data); +} + static void pmic_glink_altmode_put_mux(void *data) { typec_mux_put(data); @@ -453,6 +485,17 @@ static int pmic_glink_altmode_probe(struct auxiliary_device *adev, if (ret) return ret; + alt_port->typec_retimer = fwnode_typec_retimer_get(fwnode); + if (IS_ERR(alt_port->typec_retimer)) + return dev_err_probe(dev, PTR_ERR(alt_port->typec_retimer), + "failed to acquire retimer-switch for port: %d\n", + port); + + ret = devm_add_action_or_reset(dev, pmic_glink_altmode_put_retimer, + alt_port->typec_retimer); + if (ret) + return ret; + alt_port->typec_switch = fwnode_typec_switch_get(fwnode); if (IS_ERR(alt_port->typec_switch)) return dev_err_probe(dev, PTR_ERR(alt_port->typec_switch), From patchwork Tue Jun 13 07:55:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 693230 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 D6582C88CB2 for ; Tue, 13 Jun 2023 07:56:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240728AbjFMH4n (ORCPT ); Tue, 13 Jun 2023 03:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238800AbjFMH41 (ORCPT ); Tue, 13 Jun 2023 03:56:27 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22F9B1734 for ; Tue, 13 Jun 2023 00:56:13 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f8c9cb3144so2058395e9.0 for ; Tue, 13 Jun 2023 00:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686642971; x=1689234971; 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=IBihxhzUl+Wzlchdtbk/YX8/Djkg0SN8vTA61tlXgM43NTan5vdWM6rBOwPMt/86qr pnDGFxAV/kijfhJlM8KUt5CWCHTMle5MmF0ooS84AFO0Sp0wJJxScC1fAGDnJ0GSNYWH 7alpdgJAFpWL3YFd0qT/2Rwby9bKp0v4XaGbTHHKL18wIbpTROMmzH2jQJlKksamTdxs ULaKP+G7VMjsanFLfSy0c9j+RrXcjhnVxByi3a8WO3DJWks00HwZkCp7/HI971NRlYNY Boj03bvk9MgFFrVuCW7ZMWj3C2up4KEjHF8JoxmqanfgHNEpq8OwsOv8mu4xqr0UmxKY cKqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686642971; x=1689234971; 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=JUPnJVOmWpmD7xutCVz/Mqbt1IOYyToPjsMR3w8z9+Y2inBPrOGJt8Ix75xrAPqpOD qVs6JKuSwsMY4F+I9y3mgm+S7XgHXS2ZRfqRNu+oL/vxxPm4oo/qdfvYMvTIczhbmrL1 QqZbviyeukj+U2XmbgjjCO3MiYAdqJTDFLCNQhJrmXXDLIaQJ/CjE59weYACF8QPBsXY xtf7JxVLJnmLbraz080X7UvxkB8aF7uPnQ9xOl2dtGTCdjQl2P4bt1pk6bRRy7D9kaZH IXk5lMJHMeGzD6ALNrGFX75dlT9DDn05qr97FyzpNexSuH9fOiv32R212WddefbfkEuA HXVQ== X-Gm-Message-State: AC+VfDzUFShQ72GUeYJLZc7zl6Ao2+lEKUqqW6xCwZoGs97mBWAPfL2I vf8Q2/ZPCySNY3Kv/85DLmx9/g== X-Google-Smtp-Source: ACHHUZ7Gn/4aab+Kq0c/9gdPR/foXj9XfXRTTnFMDYIfkT5nKf+V5NU4fE7anxvyUP+L93ob0wQS0w== X-Received: by 2002:a05:600c:2254:b0:3f7:e535:ff3b with SMTP id a20-20020a05600c225400b003f7e535ff3bmr7122722wmm.3.1686642971579; Tue, 13 Jun 2023 00:56:11 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id k20-20020a05600c0b5400b003f4266965fbsm13662316wmr.5.2023.06.13.00.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:56:11 -0700 (PDT) From: Neil Armstrong Date: Tue, 13 Jun 2023 09:55:58 +0200 Subject: [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550 MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v3-5-22c9973012b6@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@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/ZANAwAKAXfc29rIyEnRAcsmYgBkiCESNcYESvXERsdPg9XIGioD3rijvTdXZKoiGAew lVvp3OKJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIghEgAKCRB33NvayMhJ0ZgcEA CTa1du9PRCxCbB1LO6DDJ073peCkSaz6UzEJMCw+CFgOZ1s4C3+pLtKhliSYm9WBmsoMj3K2u/bZbh pQCS6Xx3Tgz+E1g2AM+YKGhp82O8yOkncNXRbM7s1foHhz8gi86rFIOUuPKN+rQ8xTFy7igqnBHsbQ BC9FeGabDpheDdrnijtAtZq867PiB1Hb47xvV5TFRKh6UI/fcs9wdq+cvIj4x8vG5ELekmgBStECKN m9q7nelf2kRQRf09vfjt7r8gVUvdkvx6/fMyWDNK847FXLSPSz6rBSqg4kW5xrow19zwtfxPBms/2d kACED7cIgEY73UsU3ihn6lII19j3w+ZhYzbDKpMr3jEQBkSRNtRY63z2HTZSQJzaLzQV40QRjDqEAw LqVJadDz4/5WAjPYZaZWPnR6iy0wO+NeUROKgk7dIjTRhfb1hjghsXfxq7m3BlnnKP/CuNUuIfRmc4 qmtCp8UEPNCWNyk9atckQGD0aTybqQ6JFZJN5p8qlHXSHhAM+5IryDNmrEsF3LRHSmPNN533oZm5Hu m6rPydIyIkR4h0C4tt0bJq9BFERQ0UMNCYdS3DHZZuO6qbwZqqmkRjf8j73hqiDeJ9452gMeXqtZ41 1vm0W55iHRvTX7eDTdei0dE6yv46sQpTVwUi1OZdyyEUosEleicIPrFh764Q== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Tue Jun 13 07:55:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 692538 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 61F68C7EE29 for ; Tue, 13 Jun 2023 07:56:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240762AbjFMH4v (ORCPT ); Tue, 13 Jun 2023 03:56:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240674AbjFMH41 (ORCPT ); Tue, 13 Jun 2023 03:56:27 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 343F01984 for ; Tue, 13 Jun 2023 00:56:14 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f620583bc2so6227938e87.1 for ; Tue, 13 Jun 2023 00:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686642972; x=1689234972; 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=NM0R8urzzNx7/U/EWs+VO9ol8E23jRS6ix/l2ppndlw=; b=SlH89Ms3G7hSLHFkwGdt77qYrSjogDjbe+IJFRrp8nT1MvEMDwjT1d1J4o/f2UstUN L91NL/6QHJ9H384gpw/IIlCkbHsVRxj8wLPyI0mz2LKc/FBAJg6ETngTrVxMMB1AKwo8 vi4923KNemBwHH0+BuRF/RJU4Y0iFf3rKb//qow7TvdCNcm6yay32et/JD4BTAPbCLBH 6meptI/XFYFFCvLs/VpU7ndxn47QEOwVJLijUK0/SlrB5/LJgB8j+ZreJm0cHamL0Vg9 ob5lyJ0zxQJvrh5C0h5drXXaDG6uRwmm+m0NSe3nfvfeeSQch5iumzc4Xho0OiMcZIoS KMrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686642972; x=1689234972; 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=NM0R8urzzNx7/U/EWs+VO9ol8E23jRS6ix/l2ppndlw=; b=Ya6Vplj3Mb0NDiObiEmG0I529FGhp+LfpfADJLr6t25Ag+dpNSiXx2CmMQ86DW/utO VV21oJfkDl6hU3FcZg+N8GUYQshFQ2AQDmL05taXDsUJG46FGHE16xW2Q+tDzIkuha76 Zkavv96BHF2Wd+kmrJKGuwsqVmQBV7zsr3YWKcUl7POSP3YQuM6IKLcZ9f1jY4HK+NcT RHFbGBML5kj4L4ieGqMOnzAEPwLKSfJ74BSnVxn11dVf7+27IGZ6mYk0JcymIkal1GM8 Jg36VHTgWVUDFtI28rGzjwe98sSMMyKg01calnu7znUdAFD732ZuhUzhl8vyoMBpPuBp KSnw== X-Gm-Message-State: AC+VfDx+QNQU9lApJKnTtidJBVFU9qTTcoRih96enMerEHo7khgS+24i Yi72s5AUdOGbzQ2s+WsTAahanQ== X-Google-Smtp-Source: ACHHUZ6T9ubeCNB6BGzQcRCOIoZ6uuJfQJsYip/IXp+C95yMz7G0m18/422gRgNfEgBYrm4CJ1G1kw== X-Received: by 2002:a19:2d42:0:b0:4ef:6ed9:7af2 with SMTP id t2-20020a192d42000000b004ef6ed97af2mr4837396lft.8.1686642972540; Tue, 13 Jun 2023 00:56:12 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id k20-20020a05600c0b5400b003f4266965fbsm13662316wmr.5.2023.06.13.00.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:56:12 -0700 (PDT) From: Neil Armstrong Date: Tue, 13 Jun 2023 09:55:59 +0200 Subject: [PATCH v3 6/8] arm64: dts: qcom: sm8550: add ports subnodes in usb/dp qmpphy node MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v3-6-22c9973012b6@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@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=1083; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=BkC0Jwx2QyfHEOewEqYxvy0hZhtFX6P/om7OzNUurFk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkiCETuMqKB2RUb0Y2pltGdjxWNg2jyB5BQM0+3rAu mM8HeP2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIghEwAKCRB33NvayMhJ0WL/D/ 9LGZXM6cR5I5ToU3SULnlqhxkd+7nEXrcLdyXy9HGFsM8mIf2hYVOZflVgzHaRu9EyCRl/r7AO9GgT C7TwX6D9uw4UjJDOsafgNuze3+GRVy//AikkXlKC5+JdQWBglBWScUtNH5SuHv0q2TZHJB2Bl4aLf9 jbI1CmsQIHO6C7nTjnq/f0smEqulNJKGh0TLov7zwmFO+QSFy1mfJlMjyOsnGBCWN5psoaHWVc0+eA UVSMexN1NVvtAcnueTWHrAO3wZAg9lIr1I3tAnuyyEsBzZzpXq9aPzExSIOEnhhIq7Rfn7BPLLWFXO PXG1IbaodZMO8pKdMY60Yczz+0589l3au3PRdSJiorBcSa2QG+aTHPeCm8EPalDgDTzRTHaYFqtk8c EaM32b9bTb9w4SqKrgY8sQpL0exUtGp280M+Vfv4eS/v8hEIH3PTp7ez68euu6+rU25TSoO72Tnk5U j4aczumJNHPzUBbMwVFAUngrBjFeiwrZamEtzllhoPer8xlU+utwa1IVrHQBO94okPBxAAwicgR3IJ his2vYpmo39nGvBCnjMA+tuaxXn4YWuGy2FseWGO0rb/aeNmnl2SGIvSqeyyubsQixXyn9gS2euGl2 RyJxAQTTVsmYxAWmLDwzeJgTphYOq0bg9n2ADTuMp5fgtWAe6bJizqmBSLpg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add the USB3+DP Combo QMP PHY port subnodes in the SM8550 SoC DTSI to avoid duplication in the devices DTs. Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong --- 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 Tue Jun 13 07:56:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 692539 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 2FA96C88CB8 for ; Tue, 13 Jun 2023 07:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240705AbjFMH4p (ORCPT ); Tue, 13 Jun 2023 03:56:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240703AbjFMH41 (ORCPT ); Tue, 13 Jun 2023 03:56:27 -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 1DA98199E for ; Tue, 13 Jun 2023 00:56:15 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f8d176396bso1190515e9.2 for ; Tue, 13 Jun 2023 00:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686642973; x=1689234973; 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=U3XbuYCib/X4piuGwyE4Cdqt8oPGIJ6fhqd+2zqYeRQ=; b=fk/ZltC7U0W3foxItlO+DIDLJNgGYkOhIh+zLuogk8HoBq7BpCdOAKCRH5ndkGNsS6 kfs7p9OijCKazrmqU9tpsIDd2rOu3Nl8UyHPtTDC+s57yFgnkNZGSGIRwPoeu+cs1WjB 9E4X4Uiz9jD6NkRIrsfli2SaDxtdzGIyLxPonnA+q3XguM1Mwmmd/tzzhCWKFoaIU1iC xwFqI/OvgnCoBB4G0T5GSe0ggown9kZ3IoKQpo1Hw6577hxJrc2IFfK3QSPflKIaf29X MELWk1gqHf1WyHX5ykeLBX0sNT6hG3ehJ5sm8yQBw/ZUNx1YAl5NlESM7Tu9tV6EfIVP uBlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686642973; x=1689234973; 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=U3XbuYCib/X4piuGwyE4Cdqt8oPGIJ6fhqd+2zqYeRQ=; b=NCXvaS0U/uS0USEP/f+2UZoLiswjbRQwn/PxPbT+4YcWmuiGBusgpULsU8P/XALu3W s/PEbhcza2eTV5IB8kIU2Q+lf3xyOFe7jw9UdGUlYZkoHRiRyZo0ItT7httZK9h7VfIB HcQKoyGCxZ6fwD9oyGiO/z/QWfHJjFopCIYv2eRhuA3I54S1c5JqVJpRdZFnERtDmKmw vpkpYZWp2opesQHYj1S7Vz2ymkpnc5VFPHGiIXw5esWxrkmUBPyiqK8KrRSShcglLMTV B88cYMlsvk6cxeGP52j7Nzj6xFyCoIwO7/Yo5NMdMWwkrQqnPXmQf33w3DL+DgbqBbcT ei7Q== X-Gm-Message-State: AC+VfDzqykswNa/cNQ4yeRoEfSh3OY0iIHZ5LAWX7g/nqvWKkqdc3ilE 4sQmpsLsPTMvpbmLNtwqicfJUA== X-Google-Smtp-Source: ACHHUZ4HkDwgxyrK3mJoSPXlhQbqNyr819oeoW5bm5h60Fdq75gHs1xg7ht1L2FRtARSDSobtWE3xg== X-Received: by 2002:a7b:ce8d:0:b0:3f7:aad8:4e05 with SMTP id q13-20020a7bce8d000000b003f7aad84e05mr7443306wmj.11.1686642973497; Tue, 13 Jun 2023 00:56:13 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id k20-20020a05600c0b5400b003f4266965fbsm13662316wmr.5.2023.06.13.00.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:56:13 -0700 (PDT) From: Neil Armstrong Date: Tue, 13 Jun 2023 09:56:00 +0200 Subject: [PATCH v3 7/8] arm64: dts: qcom: sm8550-mtp: add pmic glink port/endpoints MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v3-7-22c9973012b6@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@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=2470; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=H/7AXCbzplYCwLrFcvSAM2V4UuqlwzmuTO2Cadjb+zM=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkiCETrGSrWudjRMaiPtx1RTpIt4aoYvnBN/qCrXB4 IKzjyFmJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIghEwAKCRB33NvayMhJ0SMSD/ 9Is7bqsIx4Uk0evm8E5Hl3iK2qy7bULhMzAJpLB/TWMrc1DIEkJa3vRJjd/IpSqqRMgf7OSywB+QQg cmUX/wiIS7+YBXdp1yrWfjOk4vEunq52vr8hZXDOvIb3QJoIwvMolfQCXxgTZma5rwC+RPsxuSMHgk 3nwZkKyvMaJpw94RhH0bRYZjh1vbuPLmkWSSpSvsYm3aB2++yQK6iL+UPk4QJo6cZLM0LmxeNqzlFR UGcRlpEgwfEOuBxB/8ZyWygg/+0VIGXcFquAum7112Dy6pNlMZd+QwDHx1BOxs3fZ+Wb9tEtOAkvis j41y3QQTrbiokJHRzmn/4YRn+TJmVSjQivv0EiAhcJVRMU9Mnbi2Zkgksc19wvetOBHxmgmHXfPi7e xRozZLovMMBrN1PqXhdBb0HCAvpL1h/wkoWa3VSBGCPW4ZpAiE2LL+o2Y9WCrr+RiuSahWQEh1ccu7 UlDp4vmffteNr6d7DsxNmknd10D9wsjHM5C4XlDlIJkcB+JVI0RhU35Xzc+xZd2zrFXP6RBtFGeREi JI9RAkHylpuzEQcmeirKciBLI1wvggvKZ9s7EdMuLlXBBRBN99JbqsgN6qeWJPVmIwEtPtFcMfyfXy NfABjFEPczisixi7le7BiFPNy8Uy2BfEj4E+RA55B7QsP9NB5OgIwOgLRxxA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-usb@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..92aa67256e8a 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts @@ -63,6 +63,7 @@ connector@0 { reg = <0>; power-role = "dual"; data-role = "dual"; + orientation-gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>; ports { #address-cells = <1>; @@ -80,7 +81,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 +428,37 @@ vreg_l3g_1p2: ldo3 { }; }; +&i2c_master_hub_0 { + status = "okay"; +}; + +&i2c_hub_2 { + status = "okay"; + + typec-mux@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>; + }; + }; + }; + }; +}; + &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 Tue Jun 13 07:56: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: 693229 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 4DCDBC7EE29 for ; Tue, 13 Jun 2023 07:56:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240748AbjFMH4r (ORCPT ); Tue, 13 Jun 2023 03:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240724AbjFMH4d (ORCPT ); Tue, 13 Jun 2023 03:56:33 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B659C19B5 for ; Tue, 13 Jun 2023 00:56:16 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f644dffd71so6385793e87.1 for ; Tue, 13 Jun 2023 00:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686642975; x=1689234975; 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=z4K7kTQtIrV7AYfghnPwr2i8OE9ZNp1mkYN+KZLG/2w=; b=H8sFXW/omLrIB54UrajgwFhbp5yT17lWzycM2YgbHyOIwSWQV+eYk3JJ8jqEpI5YPu k6w3xAnUzhw7zgWYr3y/SVNf5tJx+HgpCE8OflWa+/RXHNk6QeW6JpoF5oWI+AeoDDtG Z+O4LASpaN/puMf0lKwexhrW8xGRmP2IcBaa8LD1BeniSHNMurUivdEcc9UK2PKpeULt WwJ0UjLXmbjzKoXAz7e5p7je/QKqbsPNwoblIo34gcNEbJtIfcJgoKhckV6S9a27P+cR 8q+txzA/bWHeJUrjTDM27pc/4ArVJgknBcFfaR4ZK8O9sMftF1pIs2N4Dq/0HhmjskCs 3MtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686642975; x=1689234975; 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=z4K7kTQtIrV7AYfghnPwr2i8OE9ZNp1mkYN+KZLG/2w=; b=I/C6kFWu1Dqw7Z0MSpd2TtdmgCPaVH+UcL5BSfVGMOKzegldn8CnsiHLlLTDe7PGUW N7wlewY8/04q+ELCyfWOv4V4DQitSNmKeIhxh68sKtZfgWWi6gowGZoweCK6NOk1mqAU ZtSydbIUr21edJS0jvoruC/gBvte5BtMQWtCLYQV6DSXICc7iIUi92gFQ94Je0jLXuTP IJTWitHREBAl+rLLO1WXQJDU8VmEyc9up0wMQ9s20/nUdJn/JGAJY5M57VLh43YP8GtC obfa7BQTMjEuaZCeZ5Pnyd3KM67iYndBJOrI+P2ZVGba/G+UztBVZsEGP1BFlotmKR5f JMhQ== X-Gm-Message-State: AC+VfDz6VfTkYs3Bu/ttX7GFotsYcy2C9cVtUfkJwg2p+jBqbGY56xo7 JGgA28PAeCCUBznK79Te1Nl/pQ== X-Google-Smtp-Source: ACHHUZ7JcmHHsjJMULJFqqIndYRZ9QQrs/gP6T/OMYRCt3kuS5Fxn1f1cn/WtVWKqyPZVEirEtVcnA== X-Received: by 2002:a05:6512:458:b0:4f3:a0f5:92e5 with SMTP id y24-20020a056512045800b004f3a0f592e5mr5575630lfk.31.1686642974793; Tue, 13 Jun 2023 00:56:14 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id k20-20020a05600c0b5400b003f4266965fbsm13662316wmr.5.2023.06.13.00.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:56:14 -0700 (PDT) From: Neil Armstrong Date: Tue, 13 Jun 2023 09:56:01 +0200 Subject: [PATCH v3 8/8] arm64: dts: qcom: sm8550-qrd: add pmic glink port/endpoints MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v3-8-22c9973012b6@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@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=3113; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=Dpn5WYby65WZz8xrANOxqTxyRCrlf2lM9h7YQb2/kkk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkiCEUdxo6zuTG5Nc48HP5ltUAmD9dDvDZC4r6LqFH u/p5+H+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIghFAAKCRB33NvayMhJ0QFkEA CY/gWxK3m56EazyLvgsQsPf9vJK7NduAyaudylzkInM6AHffKJuSVegL+q+oQlUr3jvLHuS1N3hLwT Pb03yFcGDKdlDE3+vaSYEx9sjeVtAlODhx5LY6Q5eXkr6HR4dTkmWp7OXATdC8akWU7o/hXiHKkM2K OVeVPSoLO5FC3uvhHZmCnq4zA4z3vb/xo1wiQoRrcsXw777wyoC7OFWQEc0ypW1LolVfx1IHbKBNvk Bj0OK3JusXGORirS4So8NEbQbWHm3Q1toN8D6AjoEhLw0K39tPDnqTxAjkEKfH83IObaYWcpZ9I+wt NyvLIO1CMnSbys31/LnSIOe7gbLmvAJNuEbJXlSMCTA2xAZc/mEq5oeGY1bflYWmG1T4xBZGQG4Ky3 WqARJdgObo8JbOMhQ0lO/2SjLsBQJ2llmtOhA62Soxw9s8EoWiM6bOC5g7ZR8tfszG0nUTnHlhWbrC aBxTqy0ESFvZ5MrkHaxli/oKF+1XeWsLziJGQIq4AvPXMASAJzawNlFzNE9qDE5y+lp5RIq9i57DdG HHcP1TkxSAqOZ1UrdbHSlICBvS4lNqQRLObbx0uuDOfpsxt6fnqmNLGfVGRWVHbrVtUgn5Cn1DgNPs ADA3uSH8CzRBdtGqoFgDV3+mlegmfYVL6uP6QdTBAKjGaMuTbG1wbpWfdZ6A== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-usb@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..792351c44b46 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-retimer@1c { + compatible = "onnn,nb7vpq904m"; + reg = <0x1c>; + + vcc-supply = <&vreg_l15b_1p8>; + + retimer-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 = <3 2 1 0>; + remote-endpoint = <&usb_dp_qmpphy_out>; + }; + }; + }; + }; + + typec-mux@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>; };