From patchwork Wed Jun 7 08:05: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: 13270137 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 09819C7EE23 for ; Wed, 7 Jun 2023 08:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238677AbjFGIFM (ORCPT ); Wed, 7 Jun 2023 04:05:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235583AbjFGIFK (ORCPT ); Wed, 7 Jun 2023 04:05:10 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3895196 for ; Wed, 7 Jun 2023 01:05:08 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f7e7fc9fe6so22827835e9.3 for ; Wed, 07 Jun 2023 01:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686125107; x=1688717107; 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=txoDvQrQk60WWDZ/So4hJmmttkncWh8gwvo1vGDyHsRSKl3ozjyKMt0dMTjvBjbzP3 eSm/NWp2vjM0ZfgIsHDJDPVEJx9y7AgcEqgEWvxNq6xwXK/Bo/95ZQo2NSwOuUXdko35 He377+OiJ5GvHzcQdY2qcrH//WQhso8psiO3D8daOnvgvEEdwtEFhrGgssBPnGwJTBGw MzwFb4bfa7xaWKF4QadjVCgAfH9GJ67GemaKnbGWoM3wT8R3pRjoIikTuuUPy/baC5/B tcXdy9qRshjdQgpBgUgjC5iLVbkhIBZinrGYaOqfU2u9/zCPwWdb1ndwn1lDWE6Q6O25 Hxvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686125107; x=1688717107; 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=Z0AvhIh6EJVWDcjxCQm5EQM4NZtQI3BU0gc3yjyPUYLoFoyJl83ixlyEvmtv3lEHVk M4ROzZsHljCZGEnyZrB1I5UjA5/EihKFqV28dX6CEdh7KLAaFE4cC3b5bCh66ZNGfnsp p8xoF1AQAzv9GTfe4PIMSiQ0+/sHW/2iKrX35XUV8I8sdu6Whu7bkhEabzG72hQrS6B1 GFV2NWLDs8Gr4qRXC02TtP0jSUBhEuaaY+/ILOomeawm7FB7KqKKa5e3tYSTZEb8tGbb WmMsXbz2D158bgdfJH6z+bH1sERA/7e9Bb7aQONXlgYxMqzMZqWfJRclY3SGnJ6+l9Bu xKiA== X-Gm-Message-State: AC+VfDznw6zCoRIg0cS3NGYveOT3lta2ZphVMWuW0UAwaJBFDVfzgWPB /MaZDqaHy8r/7DAea41Nei4lVA== X-Google-Smtp-Source: ACHHUZ4h9m4HjuaqWHyKHfeFAE3GH8rc/9UYyxOTzQ2nukqHYFkxFrlgNQNTkat0NmP/4LQ56n+N2A== X-Received: by 2002:a05:600c:28d2:b0:3f7:e5a0:c5f1 with SMTP id h18-20020a05600c28d200b003f7e5a0c5f1mr3670504wmd.32.1686125107129; Wed, 07 Jun 2023 01:05:07 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id h8-20020adfe988000000b0030ae5a0516csm14706269wrm.17.2023.06.07.01.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:05:06 -0700 (PDT) From: Neil Armstrong Date: Wed, 07 Jun 2023 10:05:00 +0200 Subject: [PATCH v2 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-v2-1-3bbdf37575c3@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@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/ZANAwAKAXfc29rIyEnRAcsmYgBkgDotXhpav615rwfa8P5vA62KMEvrgA4SntRbTQQR iSGByJaJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIA6LQAKCRB33NvayMhJ0cHND/ 9ugqVUtFHO8q/px+feNwoCjGiM/oRYzf8WzDcaDFR+opIFGh03+ikQE+S9yt8r+w9HGfUn66ES9BHN Qj5IzR8K3c0JpdzXgFTy/jtnJybqzTb0cCPaloVG0ZXYo+gHFUESHei+udoM71T9YGSrAe4jl3S4eh /HM6XPsRfSD3Q52N/pT6mbXONr3rduAQbksXdg1AlqJ+jY0zAhuymFKoXfONYOnNLlBdn6PinNcTWf TnOi2ISLemQjNAvNJTKYAm7snfPuhwhwPDbyqvCj35P1eW011rLVuLe2kutJPyKm/YtyZZZ5dZ4hAo 13svtHsa/RC/t5YypFs/A4ZueWixMA6gJYm+SbnvnSiQ+xNfzZa1KFEqVh/U+1ZCdpBkVKSfQfoyvG Z7kknJyEnunTH+Jv/16+HrLmnhsGCiBmfazbwwO34kY4IqfzyGpgI2PvzjeyPrMoCEImUrF6w/X6/E H4M5vC1fTt4rBM7guBH+X9RvFLIsMPpjmcglnoo4RA3vGYaeVkoV9lxXxncyzxsg4to9B07bKD1Jku uydt43m9e6ul+OyGcLhGqOvfb1cucsHR6z340/eHfnsasdZ4n8dmiTYI+2cki0iLMzUGugeBaxTU53 qcep4FvmjW0e+AGz9wNFWsGKkh9aLsNI5xIs9YhuvN4EumLDgLGDIJ3QmhFA== 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 Wed Jun 7 08:05: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: 13270138 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 51A69C7EE23 for ; Wed, 7 Jun 2023 08:05:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239130AbjFGIFT (ORCPT ); Wed, 7 Jun 2023 04:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238938AbjFGIFM (ORCPT ); Wed, 7 Jun 2023 04:05:12 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A5851721 for ; Wed, 7 Jun 2023 01:05:10 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f6e4554453so59173665e9.3 for ; Wed, 07 Jun 2023 01:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686125108; x=1688717108; 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=rO4a4eQacHXmdPfqEebC0qkTl499ktfCJExKpnraMJtzHZrTczSLH7kEktU1CoWt9E uXZ2Mky+ZiX86G44MFct/BfY9FG+KfM/VQ8G2If0/SqvGe/Zr0nX8kEkiNwMIiNKtdPD lzGz8fEW32j4DmN+54wP8smzkv3EuvyMH7VpvpE8kv2iF25GmfStvgtbhuoDs+Sp1LPL /NkIPpUBoHfO5IDo+k5Wdjq0irnHqyKrK4wJJU6HOSe69QsBIlMWoM3gt/JNQLpUDjqp UzXgX6kbV20glnIEvtyrJVU/bV9wCeKFAqw/Iode0jRPHK5jo0VxWoDLYyBnZ3BrrLTb J1Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686125108; x=1688717108; 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=L3Tl0fH2NieQ5N9VzpgIx/CW08z2ueBWaBzmE3xE/bGUflt7XUtsyosHWIJ07yGdpb rYwfVpEQv7lkGxS99Y1WoXFLZlb7/i0VfQUcdcadhrcr7icmXtEwbemgtlmvIedQwZ9N Zehan2Wsg0bJCsRWqsoUF6ost/D6K+dhlzjBSFmFGXQoA3LaIg2NN5Pl8j47ycmRI/Bb uGQSZFPJjns2BuCUl9etr0y5BZDMKwnixB+/5G+ZTe7O6sXNsutGIyg3vG0M/54bA1gB VO3Hm9LlLbxb3zIGM09nkJ9pSw7XX23kQCXmnvCKZCqbbS2pvAyTllHAnEPCuUM2cu4B Om1g== X-Gm-Message-State: AC+VfDy2nQ3V0TJRug2oUu192PYqgZ6ZXWr47S3/tfdFN8NvrAv/fpuY xhqtGvX289fBPxCgiHU0aW6Dfg== X-Google-Smtp-Source: ACHHUZ45/UYK6qnnIZbnI6LE7j6p8RIX7YbwyUI6sr2F3nvT0E969FUlC49PGEFOVua5HBvnfg3xXg== X-Received: by 2002:a7b:c7d4:0:b0:3f6:3497:aaaf with SMTP id z20-20020a7bc7d4000000b003f63497aaafmr3855885wmk.9.1686125108070; Wed, 07 Jun 2023 01:05:08 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id h8-20020adfe988000000b0030ae5a0516csm14706269wrm.17.2023.06.07.01.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:05:07 -0700 (PDT) From: Neil Armstrong Date: Wed, 07 Jun 2023 10:05:01 +0200 Subject: [PATCH v2 2/8] soc: qcom: pmic_glink_altmode: handle safe mode when disconnect MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v2-2-3bbdf37575c3@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@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/ZANAwAKAXfc29rIyEnRAcsmYgBkgDotqlKqtbACOW+S1lPuWrn5q9cLM+OJluGtXozw ct9ZtHeJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIA6LQAKCRB33NvayMhJ0eivD/ 94fU8O8NILIct6qWLn5P5817afdb7h7CWrM71JMZ2UnlCI2KPR7HYrrJKsOr1i4ly4vk5BhASJX/gG bbzgmujMYOBp9Pi9tG8tt5AB5Cxbcwgc6CmeidzM0hR58zxn99Wf7Uda2ir11giLkNmDVX8ErcHptT MU4Dim33+ZlpP1AiEgeZtVagsrFiwHPe5Nvr7W3NddVs8QG1Nvj0aTjrv2hhZcrwBu/JZd78lfRqgX EloPfIKBwsd/Gm7XDKOAxFEkM8scIzTBl7KYihYLYUQicK3jzI0RKl5w75SjuEoFQnNKmhhFCn9s78 tmFRYFR1pGruo4lU8cInJRZSrWl7rSNIDOM8Qgu8ojjCBx8aMn+aJ/zQCtCA1ab33fu/VjZ51QJYMm IFV8jbzjlYOpqrnQS3fK7YsEKC7EPZukanWxyRo+/3ZClzp0mvPcR0pRTph72QFAm4/xk/lfjLtOrb hCvTp2HJS4GDXg3+g7zHwd+AUCRvhilaLpb8F3D9HkOyx1ETU+ome4LThHjtBdjFFg4TlucjJz+s1e M2z1NSMI2HFC6tQxGoUW71mwYBB2ubCTFCCBrItD2zKdW6AvfaCVK04787NmJIio9hnkcH/0o4CqeS t8rSX09YEm4IOFHHoAJ3CETt1ifKosDjM3EgChDnIbYEOl9AyEeuNJmu9Mcw== 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 --- 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 Wed Jun 7 08:05: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: 13270139 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 EB4D5C7EE23 for ; Wed, 7 Jun 2023 08:05:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239198AbjFGIFY (ORCPT ); Wed, 7 Jun 2023 04:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239013AbjFGIFN (ORCPT ); Wed, 7 Jun 2023 04:05:13 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D1C710F8 for ; Wed, 7 Jun 2023 01:05:11 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-307d58b3efbso5864973f8f.0 for ; Wed, 07 Jun 2023 01:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686125110; x=1688717110; 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=uNYTQtE0Za4Fy+tKFPNhJ5JJ7XmY3nhTJ0LHaaoKZajPOjUK/aXGdu+bOtrlW2uJhF nNC10FIKbMoaBQ2KfdE4o3xxxysUJ+l2MepabkB8b8KXeS/NGgk8zZ5SG6lQnWzeKZPA XU4U3CldeyTxvAjn/Qd1BJXQ3GXP/L78T2BVIP2JVEaDmmB+wFv0/I9TRB8JDvX937Jl 1R5VfPRioTjeQvjJDF83ZPwW5JTUctlbEYa7+33MTaAkH7n6nTMZsKTAOgpRpf7UEkw0 b3aV1Y1j/p2FPqkOl6k36PrKGM7UPpzlS/3IclDSLRxp+Bb6unTkHlxCjnLz6AFDanAV pvWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686125110; x=1688717110; 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=Q7+vBDmqkpzhq0FW3UksCJvJ35d/VM5D0ogU+x2cmBRMRIXG2U3oA0gDktcJhLOeDY CXcDu039ZObPsD64xfBlPrDpwXRgLopufjtcTVVJcnItiEe5N50W6eWqWj+1FOxzn4+q 6UzblDRzgAVk3PPuIeimk4nAkHyNsV7T2vwGHiaYZfBZTonVvhn0/Eo4YnoBDKQAOb6W pkVdsbUe7T8CR5M+HoGlclRU8UZ87MhSnobcu50MzzvEszgPCfEvH1Qi1YLfjq3LhyTx 4ExzHBAwYKyLOlM7S63LLz5c0m2h0YEh6Nyq2BFbp6kjpbcPYQbkqkagW5Iy15Nooxnl Cfhw== X-Gm-Message-State: AC+VfDxWJ4L7lTTrQpW1IR+nWJu62YOWSqA4dYTSlWupoyGbsaFiertv KKPqnra7SNascMJq1q80cATT4A== X-Google-Smtp-Source: ACHHUZ4FuRhoHzUiKf+yOibOeZljiDY9bUJxusfzOPQix1/WrJYnTWsWIjkHZ/PZsWdwMuC17ndy7Q== X-Received: by 2002:a05:6000:550:b0:30e:3c81:ca1c with SMTP id b16-20020a056000055000b0030e3c81ca1cmr3432223wrf.29.1686125109803; Wed, 07 Jun 2023 01:05:09 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id h8-20020adfe988000000b0030ae5a0516csm14706269wrm.17.2023.06.07.01.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:05:09 -0700 (PDT) From: Neil Armstrong Date: Wed, 07 Jun 2023 10:05:02 +0200 Subject: [PATCH v2 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-v2-3-3bbdf37575c3@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@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/ZANAwAKAXfc29rIyEnRAcsmYgBkgDou7uKydBdy68HGNJVUOuX2u93V9pItw/FCCqCb S3p9hguJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIA6LgAKCRB33NvayMhJ0e3SEA CCKMPH4CVrYSjY5mzcsv9iYk6a/p4pT35wnTqwE4FxqM0mL+Ce2XQ70S7Ez0g09/x9QASPNdJwNhLp ksqByU/Tr+JT9NWRMEShlMz3b8ojNOUG2Qq20rhIMXYzNMoIE2Utu/lHbvcdnTjzP+d8UQGOyx3GLv SuQ171ozUEGtD+1vNjVkwHUFkFnMh1hKn6peJjkQRG42rGwXaVC/TTvaGJwndI1kGeOkXiMc6LLIEG wl1jZ9+hMoJ7vGg8MgGYAJf/zF+pfPUGQd+PI14vbuTA3dfoKu19pX02bZ5j47P81khssnJqo8aWcq Ek+Xy3VYLkb6ALlzvBrfaTzItKXu/P+tARUe1Qmo5AJlGedOkDCl6ebJHOYYFSWhjTG3samL0TGemj X8NUIwXkV5dG66DKq5FVQb6vvNoV83afeOBvWTShRHqTpQ8bKGevB+lJMKbKj4cE4IkQr3P0dgx3kO bOskE6XWSTkDOBqhslAe5Jn3Aql1g3RkHeSrFBonCfZX/SXofmb5W2IhR7W3LpI3lmZBuOsU4u3zRp t5O6kfZHdrKQCKENfZ4GKLRUYKwkYOOhU6W7sVulA4ZXXr0XDIgw2VKF/FQU917AzwR3I/iElaLon0 Tf4QEU1ZEsr35JGok73G4Q/m+7Vv1Px8PNMUyAM33elYM5wZ5GIuWSrjtFiA== 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 Wed Jun 7 08:05: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: 13270140 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 F05BDC83003 for ; Wed, 7 Jun 2023 08:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239213AbjFGIFZ (ORCPT ); Wed, 7 Jun 2023 04:05:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238834AbjFGIFO (ORCPT ); Wed, 7 Jun 2023 04:05:14 -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 740B7E79 for ; Wed, 7 Jun 2023 01:05:12 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f736e0c9a8so29276185e9.2 for ; Wed, 07 Jun 2023 01:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686125111; x=1688717111; 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=dHsk4gk7Y2eq8T6jiA8wIxwu3/IUyCzuTMbGyXUhNug2p/F3Aj5JbTkZNf9Zg7Mihl PkofCQ+kLB6tvLf1oUVwEs5mXIh7v486uJFu4uC3zEYbSWsIAN7RNIEid4oNvBgpqjea MVvE3vmws+cBAqTqjZ6Nipx3/2rW230pFCEvbklhUMsZApp6HswAiP06lKPdxyDCNO/8 66/3SKDgGtnf0/t44e9kamzS2EtmRZGbK5z0V5gN6bF/QHxdtGRADJgHcfXop+NJlQyP Qj/N7nRVckl4qhBnlsUHHC3jCuPLWsWM93mUuv06vCupkCbzP1jJgw507xY6JKYzvXeU hIRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686125111; x=1688717111; 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=h4dDaPetzVwWX03gHjSrdttpA3kd7LXKhwokZKMR2SYrv8GukdN6e9Cj0V8p7VsS2W a6c5NiSUXQTsqzin40pVz/EVS1NQEM8EyDzdm3epcTEjxzi6eZein1i5CKx+dM5iuZNX fYyriOfZENhAUwKSsFDrL4PFJy5GsXIll+xsF0oWwrWdpcZZ1c7Vu0mNzz2JkYHE0wZZ TyY9ACeKvBJBQMo22VzVO4M31TQPpL8/6WSU/plisXFiQkchaKPSTAIMwM7CJyG5Bn1i UPAeSxLVpyHk5HVwLgxjzn5VyWpYFu9GBSdeiTnoglsP7+hE8tcYcxdQQqbDQa/BFZqk Mtfw== X-Gm-Message-State: AC+VfDy4Dx5b9hxalI5uDykEhyQr0Bzkq2f2f/T1G8UIhNtTYnsRR6PE +Lq+lK09ylGjS9jW+gR2/P6Rhg== X-Google-Smtp-Source: ACHHUZ5l73ErYal5dkq1AWpzDpLCPdosyXXcUgfbUVJoCWodlzWlnrStMzim50b0XHrnusTHb3mreQ== X-Received: by 2002:a1c:7717:0:b0:3f7:eadb:9413 with SMTP id t23-20020a1c7717000000b003f7eadb9413mr3327427wmi.33.1686125110895; Wed, 07 Jun 2023 01:05:10 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id h8-20020adfe988000000b0030ae5a0516csm14706269wrm.17.2023.06.07.01.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:05:10 -0700 (PDT) From: Neil Armstrong Date: Wed, 07 Jun 2023 10:05:03 +0200 Subject: [PATCH v2 4/8] qcom: pmic_glink_altmode: add retimer-switch support MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v2-4-3bbdf37575c3@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@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/ZANAwAKAXfc29rIyEnRAcsmYgBkgDoujbS4ZNRfx7YmYkKVJwLBYleJfyoNH8eLHHaS VcFjjkuJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIA6LgAKCRB33NvayMhJ0Uj3D/ 4gXh6t8IYHXkRBp/aFfuGRwYCbO1dx/Cn4lPojQgJ3PXWGBdinI7H/BPZtj+vIUsfELrUp+7lH2nxv kcOkKpb5BYdnGp7PgEpXSIETeehm7+BDxtgzRwcwz/lb5lW/15DwvNeyFWzy8FFOpX5xz3XdyCM0Ux WLa6DVWrsPZl8cV38jlLj/wTf1az0e7yLg/2caJQZrAlJ3YJkKErsckTmdpFFg/c81zcQTUOzBlYNM BPqZmpzVRphot91ic1Pbx+7x+QKZnnGpD2/Gmvaaan9tf/XMziN1LUVFz9QJCjArOulz2/esNwjg1b lFPpCoq5U2DFCdP2i4R3gJkYNhh/nArwY1cwSS8qBo/grDbildq5u6m2xNCQaeKK7V125sNFmHZREs C+sea8DoPYAdKLBn1ko31NC7cuiHaFAzhdglkjrM/xp5Wqd0dNiLUNsa3vR1EWKy3ha/rjE3jHy2Wx kqlX4kyQz2qhLz6NP/BWKYz51GwTEWYMzE5UYCm7epyCHlEdguyL9Pn3G3+Zhp8jR6AKMfz3k8LxeD md3J8PMTAV47AclxUPmfI/zVLfiKgRQHuPewNX5oqSavmkGLCwEpSPgC9yjccaw25mmvSKk2ooVmPd t0MIFBVkdqLQjqOjoIvFcXDTYJpkGOWFdjzw8hqSzcLSvfoMWFV85n97oaMQ== 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 Wed Jun 7 08:05: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: 13270141 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 C20F4C7EE43 for ; Wed, 7 Jun 2023 08:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239430AbjFGIFl (ORCPT ); Wed, 7 Jun 2023 04:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239074AbjFGIFR (ORCPT ); Wed, 7 Jun 2023 04:05:17 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CE441712 for ; Wed, 7 Jun 2023 01:05:13 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f6e68cc738so58620265e9.1 for ; Wed, 07 Jun 2023 01:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686125112; x=1688717112; 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=HAjIbiURhSM2F1wihpcaKnBZ1ATOwtT48EJKnfpROc4BAteX3tegdMuSB+ovEivfSb tRIUXb6bw6TlloRdHldXceIi0Km97MEB8GI8tAxnWAwFovQv+bM1w5V9JTFt2hkxIBl0 jr0renaM9mkS9gBEGuGduyBrUFoVtjkyhcNvll9ZdmCXkZfbuEBTOEoz1tmdi2Iri6U3 Ej1UcVq+bA+dAZzMMk1b9XlAmoQiNGmapaks0RMEg/g9gFn7yRW01FLNpGHgGD+9YaOW ICgsgziCyeVw6vJWWoBfoZ1+kJKgRnKOizI3JzGnpb6zck+Van6Vvr3bCTgDrjzlFv+P qiJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686125112; x=1688717112; 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=Ytr91G5LxBjRBkOyL09SPJBSh1jURjCf1BkMb1m2HEx0iyFzSjoytfm+d90niaWzQO vU6iqPPMo/soxxx7diJ2dEYX9dvThRPCBnCsKAMrfSyjQskgEf36UCICUHF77gux+5a6 Q30mtLoF6yr5O6jXJCIcj62jPC5WDhHtHWBJccSkVrutjPqpBHbB/L3gPhwfJ0ra7e9O efMFac0WjY6vP3JAC5YBZtwTiYhlipUowfmtS+n0odi/FIaPotG7ErIpQtHGfkGDkxY/ ZsSqPHORKu57ZIosJR+uvmRCQHNAUCtQhGLqxITMs7AtpQbjoEOA1R+NXNUu7EtKE/wa S1uw== X-Gm-Message-State: AC+VfDxacm2jbrsbqhVfu4ywN016vZDR1pHnOvNoqsESWwIZaRy//aUS eHToI+OKCkyrFRBI8drXyyHXpA== X-Google-Smtp-Source: ACHHUZ46A9CM8Ldjm2dzNVyfQDTcYDYZzOV5FSPMMSJbHo+CtXsC8s1ALkAgGKT+fE0d7T/eLtsmcg== X-Received: by 2002:a5d:4d46:0:b0:30e:5283:ec85 with SMTP id a6-20020a5d4d46000000b0030e5283ec85mr2792581wru.33.1686125111884; Wed, 07 Jun 2023 01:05:11 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id h8-20020adfe988000000b0030ae5a0516csm14706269wrm.17.2023.06.07.01.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:05:11 -0700 (PDT) From: Neil Armstrong Date: Wed, 07 Jun 2023 10:05:04 +0200 Subject: [PATCH v2 5/8] qcom: pmic_glink: enable altmode for SM8550 MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v2-5-3bbdf37575c3@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@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/ZANAwAKAXfc29rIyEnRAcsmYgBkgDov64o9cYJqLKmocRK9oMU8YzpISf9fvbDGZqpc lHI71KeJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIA6LwAKCRB33NvayMhJ0VIeEA ChyuhCk5Z4gXDrAm6P7ShqvfFh3tuKAez0xzlhDOimixdQNd1XoL9HCUt3SEyQqZtIEy+n7KNl4R63 SsKZZkttbC0GLWb38OYLNRPVzj4awqh4lAO1h2Mjplz+HsKyxSPR3pN5mt6cIwuhzsvjEW1ATWfH1W dfQPsnKyK7S8C/Pqkr1Bpu7SVyXVKvJgZ75Z0m7Nap+1Tov7OMnHLeqWRiEePZoi994KqEgEZeuHKB qCkuLnsqWtkOOoKxMocx9T1hKqbkXWb02hJRTzUN3Y84D0gCASMoIlQWbzKOzf17kEV6t+FIwpY7N6 /RgXrEJV3amblF8lNKoTiiEQuq8ST7ScLwwkYZiYzuB/qQiDXo1XyawqxFWnRwwCV4cV4iKQZBT8tN 0ESc9V1XQLZz7MHCggse+Puv9jDPjvqws011FRW5vrdmQiLW9V/gySFlASQQVH6Q8Z/dulr/Xz292U 7fDWJleXrul/IMBESM62ZB0rGwdgbk7UNCvugPAnDXi1ClQplDb1Zu4aGicTkqAvpDwYyQijraR2WN /ZjsxAhg+wC/qqrDk2DM5/QCkN+jiOaXFDGaGOK6eaGCHI6J6+CTeevG3VnCCOegl4yU/+jahhcsfq a9EQdo19XGTDyHilKQ4XU3qAmKV4w74qyq7BXsYb1Fazxo0Jm0dUkTKpf/ng== 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 Wed Jun 7 08:05: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: 13270142 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 65775C77B7A for ; Wed, 7 Jun 2023 08:05:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239463AbjFGIFm (ORCPT ); Wed, 7 Jun 2023 04:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239091AbjFGIFR (ORCPT ); Wed, 7 Jun 2023 04:05:17 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70C6B10EA for ; Wed, 7 Jun 2023 01:05:14 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-30aeee7c8a0so228564f8f.1 for ; Wed, 07 Jun 2023 01:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686125113; x=1688717113; 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=iWeMW6Wi9Q+949S/SQPL21npohA06TPT8E2VTVspKj9rbAyOWZZ5no5jWhscUm64x2 gqWkD2uyVGcX7Ff4aJqNNggPdaSqdMfd1/38MxT5BWdFNUppzcT0V/sLQC27X5OdLX/T u4E/q1AmgAObO+FYC2jM5jwCuExcQL/VCwLXf8TEeAvtom7JuTDHt0wm/xqcmF4egXRI /8MUoaIeRKMKLWV0Vuc8X1C/h2KK9Ksg4uMSoCN1TeWdPc0+vX6R1Ojz+3qM/uTLav1Y K8QSD6ygJaHrxiGQ/Z204cfmX7pwQho8M9+5NpwfgoUsKQWDMCplHq2zgstwS9JmBeGy 5GfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686125113; x=1688717113; 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=L6LFpw55vj3G06uUu3K6pQQ7+5k4R4S0ubOH5l7r1RW0USI8BgOEQM83dLn8KrUtYJ SoDMG0jRWjyMgoNesGpGQuLSuY3bmYbWF+SYeACMSWcsrxv6rLbRAIyApPuwQMR184Ub QCrMgupU99fe9/JJ0+ZNc44CQnQ9ntnLiI70CQv8WSdfUl4aexIO2Sc3dpOv7gUZZHH6 Qojxb9zk+waBw2LqfYWcJOM2o6O9veVvsBmpRIjavCdWw1Vh4SRlouzJQPx0nmVVQQGu 60hiaKyOhDLXshzO35DwMXI3Ksb2jpM+ZQ6tPWMsHp50Cbz5FC6ju6N4Ug7f1u8K2m2R C0qw== X-Gm-Message-State: AC+VfDy3nf+lDh3B5npwUNbmaeX5Ict7mYW5m6X5JmE8MEryZgxir2ZW zr/4jSriLYYcVsA+8+KKoXDinw== X-Google-Smtp-Source: ACHHUZ7CPwXdYITfhzf0Q8pbZLFS/Rz6/JNOHiK5RnEp/WNHa2JbqcVR6MGh2cITnjhqTvNsBpsJqw== X-Received: by 2002:a5d:4943:0:b0:30a:e589:68a5 with SMTP id r3-20020a5d4943000000b0030ae58968a5mr3951361wrs.29.1686125112924; Wed, 07 Jun 2023 01:05:12 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id h8-20020adfe988000000b0030ae5a0516csm14706269wrm.17.2023.06.07.01.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:05:12 -0700 (PDT) From: Neil Armstrong Date: Wed, 07 Jun 2023 10:05:05 +0200 Subject: [PATCH v2 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-v2-6-3bbdf37575c3@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@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/ZANAwAKAXfc29rIyEnRAcsmYgBkgDovIz3MyRZcSVOlZAM03jlffaCfwCFmDW+Zreid 8l7qOWyJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIA6LwAKCRB33NvayMhJ0diREA CEqL1XZ2NSNj5yvbhcM04yJt1uFWVMeGSFTfy99qcllphGF2UCFLd+C93fdM8Fnj2Oyl9HQYLayJHU Gg7sJqb3UYzCuWQx0bzHm2gfRIXeOt8i6ya+WJmqOINq9Hjyt9a5I/poBXjqGTI5b/YD11g+W0DrTF 8gvHWoSmv6jznD6D0jBdMkwqlCrww2MhbAzjwoG91f7GPAcePWv5TRW1cnKUjHBuwGE3DwkNwp/wr/ 583TdrUDKHU/EDk7dqyPkSoeDknOPFN3MasxomdzpBCqPr5De4pfumRNvT7ftMLsPzX/wbak3d3iAw wm6HBW7JUnNRqftOROQBSaeRcJl+aseeSvomsWuBZNEjdH/Wc55Ay6tOcN7yc4XK7QVxPd7N1hn4KM 6nKVK3i8z2xlzriWbq/JY+X1yI3i+xau3WGSN1ngO6uNoelnhE9ziysUSdd88Oz/gZS/9CMYgrJ/Ng bhTcUQZsCEaDDaV9bAm3r1MxIMxb5v/z4Sj37LEypOkh8XopD/d1e0qJeKewUMEwqgUSpDwFG/E7s5 n3slmLVZ5BHpNe8XXuisNPQgScBQa9Tr48TEuHK++hGHPsv2N2jZsSYoGXuinDboOgbu/GLIda30x8 faXILuoq3Ok4gOcCSsslweGX/3ywog+9qfHPzWNzIwicXOWwwCA7SQyuCzFQ== 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 Wed Jun 7 08:05: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: 13270143 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 3F3A0C8300C for ; Wed, 7 Jun 2023 08:05:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239480AbjFGIFo (ORCPT ); Wed, 7 Jun 2023 04:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238923AbjFGIFS (ORCPT ); Wed, 7 Jun 2023 04:05:18 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A9EC1982 for ; Wed, 7 Jun 2023 01:05:15 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3090d3e9c92so6923190f8f.2 for ; Wed, 07 Jun 2023 01:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686125114; x=1688717114; 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=ke9A2K8/aNR9CAtmw6mNBUl/DyrBbn0JGsTFDFaWOG5vXRLpAnqvUzkhAS6zPgjNmz laCVFA68YEncnmRr/tMgF3XnZZWsgSOspsLvpta+3EAmyYqbBBJuEINIkxroj0BIvUb0 3QpMhmKccPpojHkGYUlhd1YESI/d22aC+nOfB//QAqDfdIzxXriguULkITpnj8KoLiK4 c++9UjBdPknQfXNFjM++9qFeXv5ZOnqXVpNMVTnZT5eMP5tJQZjUwJ4sSXlRGkaD7xjd x6P1Rs7/kf3myFA/SyNV0fSpAPmU+ltALy9qkC+F2Cnlfsr9SYfsKk+bw1Tu9jiW2Lvl zq5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686125114; x=1688717114; 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=GCIAxggBHAX9v5Yq97UnSg2rrA1xOuNTiJHpQZK1Su9bczkuaOCrXECustKtOpn1o5 xt/ySOrtUxu1wvuJ3XThvRxf9tlSnHbBW+QJFdOA6ArI9ZVkqJ3Ojg6q8d+h8yrZ2Y25 pPwQB/5FhOv+1TvDdXQR3RS2/aYMJrSUQgqXR1FnHp3G2ubAujtA6M9Cx6eIDgnJhHcs WP7R6bmcZIa68OQiJJASE8wusf44AtOxwnR/xSGXJ0AuS3rzsXqxqLTBEVhb+VXI3kx1 V3r6C1GUdQ3sDWj+wqZh2V+QvGJFbQE4L//qKfD++0R7Vo1YmshXrL7fcVwos9TaR567 qErQ== X-Gm-Message-State: AC+VfDwpLEfKC5cNfAdXJPNoLMULI9eEhc7r1HpQ1lwUoQEb/mvqL84c we01XwK4tfT3L5sNXHUExDWT/A== X-Google-Smtp-Source: ACHHUZ4P26uoin2BEUm1XhMS2zjpRrx9Lr41abv9NEOVrPCsdc27vB/kepbD8CoiykADJbRPdYdh9Q== X-Received: by 2002:a5d:468d:0:b0:30e:3ec5:1fb1 with SMTP id u13-20020a5d468d000000b0030e3ec51fb1mr4021406wrq.33.1686125114066; Wed, 07 Jun 2023 01:05:14 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id h8-20020adfe988000000b0030ae5a0516csm14706269wrm.17.2023.06.07.01.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:05:13 -0700 (PDT) From: Neil Armstrong Date: Wed, 07 Jun 2023 10:05:06 +0200 Subject: [PATCH v2 7/8] arm64: dts: qcom: sm8550-mtp: add pmic glink port/endpoints MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v2-7-3bbdf37575c3@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@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/ZANAwAKAXfc29rIyEnRAcsmYgBkgDowkHT+iwD9bAecvWiluZ05dqaXO9MqoUAf1Ivx T0l14iGJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIA6MAAKCRB33NvayMhJ0a6uD/ 9IYa57kTw6H4dI6kbmiLiDBr/ee2Y20sS93blWpSFXrQt0p/h3wsexEHVH7+mRLHvy+mNwue1jmgVx viIN6yTUff77WWf2UmfobautUveIT9W0rHoC/4c/5JSJAKuGcf/kGQLvCyK+wWrKgqiX4lf9m170nZ RCX8+3T1PyQ8NMQ4npxJbgzyTM8pTjiTKhSkwV4AvOuQQVkmGfjqROEeCzblrfBjImDaVlh+CKQ2Av 695w+wA0jDF3ibbPNNerixaIITHbBj+Wnfgf2HZaHlOXC05Oq++kMkjPIZBskbLxVvYCOVE9eCDiDK D3NJEOMXcnb7oHCw12ucilWlRwCe0TWXQS7QyW6gnbl3lVp5UVMarAU0rcj00EhhuerVEj1iqrbS13 AQQRVjggixUg2stcgO68o/VlBv9irejKScW8zIEdqXGEDtcdM8EtnodMn14H4XnyaxXkS8NpFShxlj abIcBFnZkwbJZZSRDdy93c/1TpMaFkiyCz1rO+ZBVzlY9IAhNdwOHl6nh4aYqYOl1z5fOiCgIi2Uk+ 6Xho3IU0qHfRoJKWuFfzqIHAlMJLKd6muYpeNrhICTXwxhoqdjsMpWGRklMG9XOiCnpVORpFr7knAL 0EW3WO27irecXM+cXhkIp9iR+p+CRsbIUAt4e/jxcGmUbbGgO93Bb/awxTow== 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..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 Wed Jun 7 08:05: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: 13270144 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 E50BAC83003 for ; Wed, 7 Jun 2023 08:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239278AbjFGIFr (ORCPT ); Wed, 7 Jun 2023 04:05:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239189AbjFGIFY (ORCPT ); Wed, 7 Jun 2023 04:05:24 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CC291994 for ; Wed, 7 Jun 2023 01:05:16 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-30aeee7c8a0so228594f8f.1 for ; Wed, 07 Jun 2023 01:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686125115; x=1688717115; 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=/BMgX8L8sHxYnJU0Kk9lp9fncnGldl5h6suLJvCxAuE=; b=hvWcKYP0Tfmaz+gqe5fwMNCuILaExhgIUOpkZYhOm07iQQW0n1kHGWXwCj3q08wH4y B0Bezdwt/VGNJ6nB1Wg4y7Nra/HKTSmEfLswvV0Z7KLGYkF8cpsPV5/Q72XPyGvbyX1F m6nrkYip7SN+EoBMeJm8sQJaN8EpqKz5sm0ZzHsFCbKc4S55rLq+W2X0zxPFHvbERSbk zhj+Qjtql5tKXxflV3KqtO0OgOhkS5qFiWnWYiFngJlgaa5Bah9FHHtO1s3ABX7AANN4 Yud6yK626P+gAE5nDef63iER72IF8phHNcMG2eNUnaV8A8SjJxVhkH5VQUDRqZ5hcK7l gnwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686125115; x=1688717115; 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=/BMgX8L8sHxYnJU0Kk9lp9fncnGldl5h6suLJvCxAuE=; b=HdT9QqqXBr6W2TgGASLMMy8J/63iftP4bJeRsNopS+mCZnIEU8xILLgO8eCmSqb6Fw B10mev+RdmpqngEBT/EyQMm5ho0E0tejtID5G9Y72jHD1Z6xViUj0Ce7A6w9czZypyXm Fn4hOkEuk5fNW6/4nI6i3Da8TlOEhl6TI4ort7whiQqChwwqUT83WLhMZcfnNA4rWXHe s2XhIkRyYuvqF5sFO0pyaaFjIeAHagQf2rPDag/jnCgYbi9JZkokhD3iOqr4O8p6CGqO YgqeD22mEOuE/6IANQPzn5+6M64jJMopEj2K+vRGrPQAOHGYFxA5S7c57kpdd4m2C4gs 0zdA== X-Gm-Message-State: AC+VfDxG2tOzS/jKv4Kpy3Y/6CNMTfuSUBszRp/0vlb25gW4uqmK2vNB 7nu+mUP939CuwAOK+tsca1Q3Tw== X-Google-Smtp-Source: ACHHUZ5Z7dbS575fbWq+JNUF336KCNepURQ8yRMNHB/1vctEvycNU+KsdMqSOfAgEPKsC5dChYjphw== X-Received: by 2002:adf:eec6:0:b0:30a:f60a:dc3c with SMTP id a6-20020adfeec6000000b0030af60adc3cmr10217932wrp.24.1686125114986; Wed, 07 Jun 2023 01:05:14 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id h8-20020adfe988000000b0030ae5a0516csm14706269wrm.17.2023.06.07.01.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:05:14 -0700 (PDT) From: Neil Armstrong Date: Wed, 07 Jun 2023 10:05:07 +0200 Subject: [PATCH v2 8/8] arm64: dts: qcom: sm8550-qrd: add pmic glink port/endpoints MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v2-8-3bbdf37575c3@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@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=3107; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=O6DsgJkXkMoj5YSoyFuXtSzweUO2cUZutAkIATGqmXw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkgDowxwNGEFnMKaq3HdaV9vYlz1SQ6C0PZRU0+pnS eZE6XXWJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIA6MAAKCRB33NvayMhJ0cEbD/ 9fbcB3ooYanIZTo3zkxtW/yeF4T0+Y3319LYVuSFA51PnCpzPmIR485/cWJfcjeQOUcRxtvmF6mwHo eRJlWY1NPl1i3HsLbG/sBlva6MVKjt28jHgj4v4zkgrh1yyrPpZ8sm1e4VXDyfKGvqMVjQJR+J1E7q 0OQ2iWFHETHmhorDz/U61zYZpXo3YxOJq4k8KuaD01LGN1MRTPkrqqhO+6HRBKN49UOzWo/b+RTuDN mFWqgiUG7viqhXpyI9ZBu9N+Jl5qU4aBCRY3I0M1DLNDVs+GiQJroq7Iqb1TRDEnJOgg45gXCqVb4h 8dfbDJ0R3XsWr00731yJsVsuYQ/HBnxAenoENK8BCBaq8YyRKoKS/LcW0D2lb+DQFC4JVRQez01c1X 1jdzn9qEjMN2zqdmj6vwHtJPjtPAxxwnQcphkeGTmiOs19eSGN88c5J6m5h+L14qiDKgSx8Vzsspe7 WKWQ/8oUdidDetD7D24JEcil9pDjjzqWjoizhGWprpVRD9z+SAWfYu8jUNqg3gseZpsSWFQE08e9jb vJGzog6AhUxFNLK8XZs1wlP5ZwJWRy16n0Y5mooYjydD6gh8YIkzlh3L+mzyL7DnEr7HIZ9JeuNJU1 ZKdaeMDZyQRfkPQVxl5kmmoXJNpND5bkAoc4dfbJgVNEfzaWUe1KrtOV2q6Q== 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..7126c14836c9 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>; + + 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>; + }; + }; + }; + }; + + 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>; };