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: 690490 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: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: 690489 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: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: 690488 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: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: 690487 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>; };