From patchwork Mon Jun 19 08:07:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 694198 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 B7566EB64DD for ; Mon, 19 Jun 2023 08:07:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229982AbjFSIHy (ORCPT ); Mon, 19 Jun 2023 04:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230192AbjFSIHa (ORCPT ); Mon, 19 Jun 2023 04:07:30 -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 84B10188 for ; Mon, 19 Jun 2023 01:07:21 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f8fb0e7709so27817545e9.2 for ; Mon, 19 Jun 2023 01:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687162040; x=1689754040; 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=ufhYg53l4+1jEFiUvB9iYxTEDauMoIP6CKQPjGg4g+TpW5GB4u22fwBviDgR6VtM5x ODl1A18KE7PT5qqV+QgsNa7rXktkfBNfgWaDeCo/7fCcbIzFLyLmnIif2SZTaOuT4YcP G+PvHzbz7JD1urGNUzWFbqaX4ANKmnnvXLqOdZnL6tS6DBuoDuSP1tzthf9HuUMwAtSd rgwmef4QRDlnJ3aY0Evi34UYWLNAA4/KMKpXM+PpCjTDHruwIgYQLK6nVDsDUB1lFiP6 oJ5yi82NchgIpRMCvV+lyA4ZfPYX/6EGtLN3zCzu5lS0KWIoZgkKZms1noGzrAGC6Y1K AjCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687162040; x=1689754040; 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=OlXcGklkEGsF1TEv5z/Lo+C0aWolmUsjyEg7o+03G88b5inuDdgRHNnyJTlh4CGlLx 4nze5gQ5NR0hv3kpxbbRKVSH+Q2L+WJNR4agn9+jNxIo9Bj18pvsQmQTNl6NaA5Zc14p e5EBLbq+k/Z/q0o+/dXfzMm/uvXR1uRr/Kd7sgIpaYoSMGFJtVnae5Y5D6J1jLpT0G9C 3MUR+mvLV42wBCqZzRAZ53yFMe4cDK2yWtv2Ti20iYnYTbdjGuhiFffp6M56311wON5V KoGkqVCNcSuTpQUPCn+a78E6SBqdDSpe+KwRD9c2CWPnL9RCS3ID6PpUWmeMetGy7BNZ y1aA== X-Gm-Message-State: AC+VfDxGKao6xqUgNEDMjsRFYsuZDY4jtMwI/HyxzHHNK0VcEx6w7IUU xQardYvA4rOx51j2Aru61Wnzxw== X-Google-Smtp-Source: ACHHUZ7v3gdLIlHqxN78NWrUZHoYR3P8EebnZies9tQeWq+unj2l6NzxOU3Pl+BDZKb+S6B50wFf8g== X-Received: by 2002:a05:600c:2104:b0:3f9:988:b77d with SMTP id u4-20020a05600c210400b003f90988b77dmr3553869wml.38.1687162039927; Mon, 19 Jun 2023 01:07:19 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id m19-20020a7bca53000000b003f801c12c58sm9791158wml.43.2023.06.19.01.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 01:07:19 -0700 (PDT) From: Neil Armstrong Date: Mon, 19 Jun 2023 10:07:14 +0200 Subject: [PATCH v5 2/6] qcom: pmic_glink_altmode: add retimer-switch support MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v5-2-9221cd300903@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v5-0-9221cd300903@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v5-0-9221cd300903@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@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/ZANAwAKAXfc29rIyEnRAcsmYgBkkAyzjUBYmMjJQwjikzcX1W3z664ANJQ64ggrTUII MRuhZkqJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZJAMswAKCRB33NvayMhJ0ScSD/ 90p4RlhRc3DwL3ZtUBrRVFRmTyQjZqoeR9p1JxYIJushCZf3vBG8M2UGk9Ff1it6rwzhhmmF3+DdLT i4X0m+IYIkRaOU4Lk7ZPxEpoVnyum/AGWfSPuVGhlHu2NeEsJHcUroRrrWxzjLqNpTQwaE18ZdZoQC SH80vwUuOmwJlA4ThmQnr+NtV2Vn41Dk0lK2uwM43pdwBq0x2l4edSZCy1VBBcFS+uc3dob2oFPZ1v ufsmAeHHU/CFkFlIHUrsRCTQ7NOPluOP9nl2S97SUK+Wur3rNIpKAh7CG6Cc95tn1Gwm24iqnWx8NY 3GTh9/lELM5iG0Bexrq19/jEgUm9Y69syMGuU8YfK6w3pS9W8TAdi7Du3XGWukZgO4lFYmNC0Om6nM 62ynqs8mVfaKJy3b4EgtDTtsUkS15nrcqsCMJKyEyZNNAzKiKj19nSRAMjTevrVfQIuNgxUYulDav8 VhSVEfCd5aSM207P4Jtis9ZYKm3ClWti5UgXB0RNJ6ZDROIzJkUGSZpJFpn1ynYAonz3+o2BuQkSOZ SepPWUBhFtDpWLRsUxRuaO4aoItd1KsDVY+2Q1Qxe/Dso1EvnKg8fz6sf3o1hfVgkZN9tQb4bJXwLy LQXWPwxzMKs95USVC2QMxwL27Nsj6PEElq72C/GfTlcwWYk18wA7I7t3cL0Q== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 Mon Jun 19 08:07:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 694197 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 42ADBC001DC for ; Mon, 19 Jun 2023 08:07:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229920AbjFSIH4 (ORCPT ); Mon, 19 Jun 2023 04:07:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjFSIHa (ORCPT ); Mon, 19 Jun 2023 04:07:30 -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 486CFD3 for ; Mon, 19 Jun 2023 01:07:22 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f90b8ace97so18256075e9.2 for ; Mon, 19 Jun 2023 01:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687162040; x=1689754040; 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=r/+hrX0GgdYpPYOfBSffAgZkKDGGRgDNR2QD2HNyWl4=; b=nCjeSP/703vwmDe80yw1glK0f+b80yiMw/BTYdLJpu+I/GWcg6J4s/DI2EjDpwGapH loEaN3f7INJyrBLR8GduTPDOmUbMIFMKdY2zqD+gymnvA/ed7sPg81i59xJE02aHMj6x Sa4nADwTk+YQf4OHit43GI+CH7OIJm66tZeKSDv7G+9cn1RNjRme9N6Sc5kMAV3Hqmur 9VElvgizgQlUoB+78pjYamDj4cMPVmM4nXEpvnbRlxWjBpRDhzwKEbmxk2oRe+XIaZWN N1Lck2IeiXBVgdkeQlq3Pi3cCqQM9Re09KzY39SMVGgYD+/hF2Lf/ZvR1ai9OqLRGWA8 D5Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687162040; x=1689754040; 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=r/+hrX0GgdYpPYOfBSffAgZkKDGGRgDNR2QD2HNyWl4=; b=BeW/EOIZ9Q7f006jdYdBvEvGhjjAwyP0Zc3ibtzAMO5ScT9LFeJB3IbPwR+XlNXRze wSAmVPafWmkhDEoXyYUQ0AHUJdjirMGP8MeDvjMOR5IfRX6k3r+85jhuoo7Tw83ceTNQ OYE+eq05CVVsVeusJL1p/ptAjUqIl+kU3D0KLvO/riQEE/dz/YmtCd4WNZN6UpnaBqPU 0E8nzIDtXh0HaqFYfOOTX8+JkpYXNrOmpSttk8q1NWPS83G+lj4i4bGL1Efsm682lulY 7GBzBOTYGZHG1a8b7AZuUN1Rnka9Yj3IfNbWd2jVQnno7LzTjI0pCIQ+HZ2w2aRV65A0 TReA== X-Gm-Message-State: AC+VfDxQSkrKiYCncgDsDv4ouFjKfp+IcBTeW4XS2gpR6wODPGo0oOPK DRD52xgV3QoUhqd0ZbZ1IlYHDQ== X-Google-Smtp-Source: ACHHUZ6MGMSk7kSXhM2qfjrVYAtS19FO8ezadaLX5DgcnjzxuLyT0H6kT7n7NKTLZf6N6PC6eE/KYg== X-Received: by 2002:a05:600c:21c4:b0:3f9:b12b:1596 with SMTP id x4-20020a05600c21c400b003f9b12b1596mr1412256wmj.19.1687162040760; Mon, 19 Jun 2023 01:07:20 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id m19-20020a7bca53000000b003f801c12c58sm9791158wml.43.2023.06.19.01.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 01:07:20 -0700 (PDT) From: Neil Armstrong Date: Mon, 19 Jun 2023 10:07:15 +0200 Subject: [PATCH v5 3/6] qcom: pmic_glink: enable altmode for SM8550 MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v5-3-9221cd300903@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v5-0-9221cd300903@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v5-0-9221cd300903@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1227; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=kJ8k1s4YhbZeghfNqa2GuV3vcB5ikSdP7IhrDDYjGGI=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkkAyzydKg6gsMsLtHSbgGjR+C7u4iF05goQRd/Jzx QhtdG3qJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZJAMswAKCRB33NvayMhJ0d3dEA ChOwiXYTap6dr8Ut5wRdHm79uAP4pqQBSHeL9pLB+bn6ar8+uKklL7FkDYH72bHxniJflLSvgGHky2 rMBpIIrSo+kunMXtrcwObgsO+sxsW2ATkh2780MCHlTSJ8cEduD0Nr/24rUBzq5IyPi4mRGaMpz+t0 TSZ8lMy5nLwwsVOfEvgEyaiw+UwwjZx0zs+B+GDw77qMbG4+bSmQKnRhpqD+obGul/S39qHW7kJQr1 dw3nTcAUSKhty2Y8iszohIkq0M2nP7bGJrnWpAKcXjkd+0EVaM+Wn21KTVGTb6GjrYyr4djLM7wpQJ xjbsxacq6JEajfN44h1IyzBe4tIsvlV83sD+CI5Hcw4NtFov3wdKFcr6rjw9dP4D2gXb0y89BoNLGT sZ+dmEhBq9jSNc6U14d0wr5cOKRMMiSi3V+fwM0sp8CJj9q250otz8F5bPDNcTiIWKhnm3Lr7GYNU+ GHp8KcXWhGIAPcx6vw2r3D9E9JPae1HKmya3w62rV6f7q2Cuvmmbl3dwn1zZb6kSVjwn+WGE+IKIC0 cUtbs68bMyMF9xn0WaSPrmv3PMcQPIc086sZKfa5vkW+m3/kOth8esjfN5leHgIknfe2DDx0BgOHpy tk5uRemk5JKadGnmw40Le7bYg6X2OKFPAdhOQ5B0DxyT6DM8VlILS0uOH/Ew== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Altmode is also supported for SM8550, allow it. Reviewed-by: Konrad Dybcio 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 Mon Jun 19 08:07:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 694196 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 11198EB64DA for ; Mon, 19 Jun 2023 08:08:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230218AbjFSIIC (ORCPT ); Mon, 19 Jun 2023 04:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbjFSIHe (ORCPT ); Mon, 19 Jun 2023 04:07:34 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0727EDB for ; Mon, 19 Jun 2023 01:07:25 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b47354c658so14622181fa.1 for ; Mon, 19 Jun 2023 01:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687162043; x=1689754043; 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=EexqmhtANLi6ES9tRfPf7+kAJ9pZLmkSwbWekIJckOU=; b=dyftOPPlVlvJsh/FgH+Ftvc+V1/toEOgrCBPBWBO0TfvZlQx1N86fQ9hZvN6N6ft7u sdGeJWl4Iqg9Ws36vvbZCLMPqbUkZ7UBweyUq3NRDsaobKpHbBlae++Gr5qc18bgkUAB 6LT/n22JQLdpzJA6HdjXwWQvZnM4eQMFLrNX6gAtHmvYAp6I5eMT4BVi3axOFIaL4p+c MqQ3bJBKL9r99G0l3LDu0ORtuejw8eTsbcIrjvyyk0YFws/2r3+tIqAcuY2rgH1pp6pI g12NR6WuS3izP9myy/WEvWPjX+41B7Vr/Kz2rax8Iy9Kt9lq9JVk8Uyxyn1dFwhBrGJs RJGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687162043; x=1689754043; 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=EexqmhtANLi6ES9tRfPf7+kAJ9pZLmkSwbWekIJckOU=; b=O0KsUxuq3WC+EC7LpGApHwoM4upLib2vVjD6OwBRa/M+xYvwz/Uj+O8rK7h/v0fjKC kz4ANkkhal3+UGml67iJD9MOgwiLck/p3soxPWIKlvoCHjJRCfHOyGBT8ATA+uEMJROr 64SmPp30tcz9JQT0roj+cNGQ3N9NnBk9IwL9lIUljZJkNx4XJiKMd4K8JDVo3DAh3Iys phNZOw7gadDLy3y9Wp6GKZy/7SojuD0mZzUEhqCwcTTq1D1NGnrRLp+xFhBIIpV7u+Gy mJG16OIN4Mkdpm2mhE8m9ivJwRMeBPXevNCyYN7AMqffkISsroK/4/vzdo5Pdtx75YUe ZtEA== X-Gm-Message-State: AC+VfDz8Po1PS+aR0RjxjLmHffEOnb157c+NSP5ej5Y3VbDRqhZy+dNc dFcTtJZQtAKMgbo7CzT1cVUdtg== X-Google-Smtp-Source: ACHHUZ4NIsxkJM05hOTVJejZpX5Dqa9TKmwenHxJviLEWdZo5xU+XXtzRMzcT0x/mK4SSbOYUkvZgA== X-Received: by 2002:a2e:3508:0:b0:2b4:5b9c:a019 with SMTP id z8-20020a2e3508000000b002b45b9ca019mr4444167ljz.8.1687162043379; Mon, 19 Jun 2023 01:07:23 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id m19-20020a7bca53000000b003f801c12c58sm9791158wml.43.2023.06.19.01.07.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 01:07:22 -0700 (PDT) From: Neil Armstrong Date: Mon, 19 Jun 2023 10:07:18 +0200 Subject: [PATCH v5 6/6] arm64: dts: qcom: sm8550-qrd: add pmic glink port/endpoints MIME-Version: 1.0 Message-Id: <20230601-topic-sm8550-upstream-type-c-v5-6-9221cd300903@linaro.org> References: <20230601-topic-sm8550-upstream-type-c-v5-0-9221cd300903@linaro.org> In-Reply-To: <20230601-topic-sm8550-upstream-type-c-v5-0-9221cd300903@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2815; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=nZ+RqvCicPSHIWr4vNG/sq0pcfvomc8+0/2iPG1Su3c=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkkAy0a7fAGhPw4PfnjIOjpXYpqrzb+eP23WHL2CyY YQzz+X6JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZJAMtAAKCRB33NvayMhJ0b/mD/ 43suWirVfqNPZ1vPQt2U7ZHxdqAcAA8ZEyOEb9sY69a6sqj+CkWHzrGSRLovDDymO6BsxxD3W8vTS2 Yt8ly8YOkeZRNfejxU5xkLUTfsxRMPhy1pGLxH24w68y6a3WwwG8BtTnUnUbU5F1lRwpuHLDGrUv6b AKDDAFsP2AvXJyrY6yrZxbMtY14VpWzGB/CN1Lzap9qNfGycVTyg4GMDSOiNTN/nxH0xzLtXBq8JI+ G2hjMd+DZ96mEW1ppW6pqzqLPDiKIujpZPo03GEQRDAVnrXkIc/fAd2CyXPTXomDu7eEYO7YAU8pyX CBB0zdns0hhoyukeZ/q2cJt/JGoaR1UX5GLHRCfm+qCeLvwHBlb+/xvutnNi5mBIIKNUOiD6HUajgc W8FaRxjXpD4IRmiHMf9THsL/YL5yZbSCmXRues007aVbZ0fa2hbVIDUoH4zNNiDyYxL9PSfJR4YSDV 74/CO3yZ+R8K71VT0yAMo45AwnL+cR6/H/WsuA/sLniHyY4i6/M5gJz+HvfpyxcYSFOEkMeWE4r08k 8ZLmjkaYL3Bo7FDy14blgS2HmYYt2up1N22ePYyyBuuZRLFH8gPKkpvhfqlDud8Oia8JJ6FjbYEHuQ tFmKa5QERvjScJ0d7sCrwAVaXp8e6jNCv7KVahywXtWgN+m40n/lNEQH6Lmw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 | 91 ++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts index ec4feee6837d..efcc2559b3e1 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts @@ -97,7 +97,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>; }; }; }; @@ -517,6 +525,62 @@ 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; + + port { + fsa4480_sbu_mux: endpoint { + remote-endpoint = <&pmic_glink_sbu>; + }; + }; + }; +}; + &gcc { clocks = <&bi_tcxo_div2>, <&sleep_clk>, <&pcie0_phy>, @@ -586,6 +650,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"; }; @@ -842,7 +915,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 { @@ -858,9 +931,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>; };