From patchwork Wed Jun 7 08:04:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 690491 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 8F0A4C7EE43 for ; Wed, 7 Jun 2023 08:05:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238853AbjFGIFL (ORCPT ); Wed, 7 Jun 2023 04:05:11 -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 S233661AbjFGIFJ (ORCPT ); Wed, 7 Jun 2023 04:05:09 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AEAA10EA for ; Wed, 7 Jun 2023 01:05:07 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-977e0fbd742so440119466b.2 for ; Wed, 07 Jun 2023 01:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686125106; x=1688717106; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=WwfN3KvY/c/aNVK3t3sR/GB3uBGYQkPJHDX8ssQfX7g=; b=mwhq7l9opsippHmvHeI4AT0f+OQRdkAv9JAs5sYimXNqKUq7yN54DYqtP9q8bw7hJ0 1XaTRaquflQrBAStahZKedkLsIjfZ5clvTRLWb0MTjYRJoNumLhqv7CczRlZhhbg/DWK 0C9unRmm1AcPxPfcO3mnEJSLNKXGlW+ZhMf2tc/XzahkMCYkv3cU0eu/j55/pphKlNqc 3goSIOJmxWcfCxuQw8Us1LRL95vjmRXgI1RiyZXi4etgXgvzXOq9aBVzJhF0ao0ymjeb wnarkE2bPTUAtrQoslklTrEi2nL5xbOoHBjG2Tn1Zz+5AiqewZoHp+pJz6hxmk7f9CbV QRlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686125106; x=1688717106; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WwfN3KvY/c/aNVK3t3sR/GB3uBGYQkPJHDX8ssQfX7g=; b=ZK5DreT0XujnkHN7DLgqPq1VQttq6T0yGSl4xdtSTtr2fDBBagfvkIpY/thor3Xvet qdM5KiKqjiCFx7IG1UoXbiW56BvdQodcv8YOaz046srWaw82hWmYYX2f9rj25NfUxtOU wS76QhkF5vi4yAj/MXRs0oI98lkdhn0g4TYU/1LfbrRDAk9QljEINtWTJLfF4C8Ck6Ko XjrXDIo4HZAF58+LJddcF4oXZy8E0W76IwvDg+ZMGyLp0dyHQOYVrw1BufoKCqX2rzWG 0qC4bBPI5v5hkwtGe/cRVA99lwMbvUICi6n2FXL/wtoqvjxN9IV781RgmQ5U0gp6wY3k OamQ== X-Gm-Message-State: AC+VfDyGKjABMjll2dh2bCBwgyEu2cYuYLmK/jU5L9gblz0GXzQ55KHc dtohSy9vRZmSvFe0mCldY4//TQ== X-Google-Smtp-Source: ACHHUZ5zAyQU3UGt9/z0tOmguRfc8YaUDylkDkACEDTHC39HKi295p/X1Peesuk0WkSdW1pp1Phx8g== X-Received: by 2002:a17:907:dab:b0:977:95f4:5cca with SMTP id go43-20020a1709070dab00b0097795f45ccamr5573295ejc.54.1686125106046; Wed, 07 Jun 2023 01:05:06 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:05:05 -0700 (PDT) From: Neil Armstrong Subject: [PATCH v2 0/8] arm64: qcom: add Type-C Altmode support Date: Wed, 07 Jun 2023 10:04:59 +0200 Message-Id: <20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIACs6gGQC/42OQQ6CMBBFr2K6dkxBqujKexgWbRlhEmibaSESw t0tnMDle4v//ioiMmEUz9MqGGeK5F2G8nwStteuQ6A2syhleZU3WUDygSzEsVZKwhRiYtQjpCU gWMBamap93ItKSZEnjI4IhrWzfR5x0zBkGRg/9D2a7yZzTzF5Xo4Lc7HbP2tzARLavZejtdHmN ZDT7C+eO9Fs2/YDT57e3d4AAAA= 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=2538; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=Mkj0wPYCZQIKUW31m33WD3TMAwvTacRLlnxcKmg9vbE=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBkgDotruFhguAz80Uz+X6MCWkdyDTUicoGT2U8QFkR YK2ysquJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZIA6LQAKCRB33NvayMhJ0fRdD/ 42Yzy2x+tqdX+C8XnZMdKct16FlO/H951CU/hRgHROZinM0xfIGTfQhROO1mV42PXL9SWqoVsXLv6I 5dJxZZaUYyk02hFBwNKyBw6/PwAf16Hq7bx9++VjVj40MoK+Fi5WrpQC7aDd8dE9kkSmV88I20Wutt uIKJbTQUrg39hupL3E0Hj6xxUfPQcM7nyRdDw0DjzlGzX+mE+GjlxDsuV4xu/UfwbDJDm8SSypDzLv EuWzVR5YLtNDW3UNgJN+Wj9zhO2SVu6VbUZFamcjn6pr0+kjPvDcoOnqzrHQPsuoE/SmwIevTCtaBI iDywVg3boTJI+HUYs7w7eU57bbdvACbyZPfd1PMrl1MkVACcuaXmPmojno3/4L//g5PFpWJahjOsRk btNQCF+Ojbtok2S4ipYeQU1tNJSuYT0BRJTea5hZxS56DNqQuPoSB0QVoCmQWGvP+pYZHQaEs1JlB/ 8ILuLwKHRstgYTNyBXjZzN6snoQLvHt+SEbcc1n3Su40o9AL109ucCAsHd/1YQKGCQAQ62FBEEQvcI fovSY6zdIFCGPDy64UVX9MHSXevTKTMGl8rAGngzci/SHG/dCFJQgmuvwM5sCzBkFEvqJ0iK+nqnZE hu8ckLNJhGeOP2Jwp38aMaBNnQxgp72uGBjgiCraEP6pENgSLRsFJaifINQQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This adds the missing bits to support the USB-C Altmode support on SM8550. These are the following changes since the previous SM8450 SoC: - No more GLINK altmode events for USB only changes, only DP - Type-C orientation is available on a PMIC signal connected to a GPIO line - When altmode is disconnected, an 0xff mode event is sent. In order to handle those changes, a new orientation-gpios property is added to the usb-c connector bindings. The 0xff altomode is translated as a SAFE type-c mux mode. And in order to handle such info, we tie this to the UCSI connector events to propagate the orientation to Type-C switches. Redriver driver & bindings dependency at [1]. [1] https://lore.kernel.org/all/20230601-topic-sm8x50-upstream-redriver-v2-0-dda89b22b1c0@linaro.org/ Signed-off-by: Neil Armstrong --- Changes in v2: - Updated redriver node to use retimer-switch on QRD - Fixed redriver data-lane according to v2 bindings - Added review/ack tags - Added new change to handle retimer-switch in pmic-glink altmode driver - Link to v1: https://lore.kernel.org/r/20230601-topic-sm8550-upstream-type-c-v1-0-d4d97b4d8bab@linaro.org --- Neil Armstrong (8): dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation soc: qcom: pmic_glink_altmode: handle safe mode when disconnect usb: ucsi: glink: use the connector orientation GPIO to provide switch events qcom: pmic_glink_altmode: add retimer-switch support qcom: pmic_glink: enable altmode for SM8550 arm64: dts: qcom: sm8550: add ports subnodes in usb/dp qmpphy node arm64: dts: qcom: sm8550-mtp: add pmic glink port/endpoints arm64: dts: qcom: sm8550-qrd: add pmic glink port/endpoints .../bindings/connector/usb-connector.yaml | 5 ++ arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 67 ++++++++++++++- arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 99 +++++++++++++++++++++- arch/arm64/boot/dts/qcom/sm8550.dtsi | 26 ++++++ drivers/soc/qcom/pmic_glink.c | 6 +- drivers/soc/qcom/pmic_glink_altmode.c | 61 ++++++++++++- drivers/usb/typec/ucsi/ucsi_glink.c | 52 +++++++++++- 7 files changed, 305 insertions(+), 11 deletions(-) --- base-commit: 54bfdd3bfe0f13da0bcf6e720d0ec0020a89b4dc change-id: 20230601-topic-sm8550-upstream-type-c-e85b4d971450 Best regards,