linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] arm64: qcom: sm8550: retrieve USB-C port orientation from gpio
@ 2023-10-02 10:20 Neil Armstrong
  2023-10-02 10:20 ` [PATCH v2 1/4] dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation Neil Armstrong
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Neil Armstrong @ 2023-10-02 10:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-usb,
	Neil Armstrong

This patchset is derived from [1], with only the GPIO orientation.

On the SM8550 platform, the PMIC Glink firmware doesn't emit
ALTMODE events for all USB-C port changes like it was done
for older platforms (like SM8450).
This means we only have a valid orientation when an Altmode
compliant device is inserted, but not for all the other devices,
including USB cables, dongles and non-altmode Hubs.

But the actual orientation is shared by the PM8550B by
a signal called CC_OUT which can be read on a gpio of the SM8550
SoC.

Let's add support for this feature by using the UCSI PMIC
Glink driver events to read and dispatch the orientation
to the USB-C connector devices on the DT graph.

While everybody would prefer having a proper PMIC Glink event
for an orientation change, this is not implemented and not
planned for future platforms either.

[1] https://lore.kernel.org/all/20230601-topic-sm8550-upstream-type-c-v3-0-22c9973012b6@linaro.org/

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v2:
- Update bindings property description to describe how multi-port is handled
- Link to v1: https://lore.kernel.org/r/20230804-topic-sm8550-upstream-type-c-orientation-v1-0-36dd3edec7bf@linaro.org

---
Neil Armstrong (4):
      dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation
      usb: ucsi: glink: use the connector orientation GPIO to provide switch events
      arm64: dts: qcom: sm8550-mtp: add orientation gpio
      arm64: dts: qcom: sm8550-qrd: add orientation gpio

 .../bindings/soc/qcom/qcom,pmic-glink.yaml         | 19 ++++++++
 arch/arm64/boot/dts/qcom/sm8550-mtp.dts            |  1 +
 arch/arm64/boot/dts/qcom/sm8550-qrd.dts            |  1 +
 drivers/usb/typec/ucsi/ucsi_glink.c                | 54 +++++++++++++++++++++-
 4 files changed, 74 insertions(+), 1 deletion(-)
---
base-commit: df964ce9ef9fea10cf131bf6bad8658fde7956f6
change-id: 20230804-topic-sm8550-upstream-type-c-orientation-0bbbb360d3f7

Best regards,
-- 
Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-10-12 16:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-02 10:20 [PATCH v2 0/4] arm64: qcom: sm8550: retrieve USB-C port orientation from gpio Neil Armstrong
2023-10-02 10:20 ` [PATCH v2 1/4] dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation Neil Armstrong
2023-10-06 15:40   ` Rob Herring
2023-10-12 16:48     ` Bjorn Andersson
2023-10-02 10:20 ` [PATCH v2 2/4] usb: ucsi: glink: use the connector orientation GPIO to provide switch events Neil Armstrong
2023-10-02 10:27   ` Konrad Dybcio
2023-10-02 17:26   ` Dmitry Baryshkov
2023-10-03  7:13     ` Neil Armstrong
2023-10-03  8:05       ` Dmitry Baryshkov
2023-10-02 10:20 ` [PATCH v2 3/4] arm64: dts: qcom: sm8550-mtp: add orientation gpio Neil Armstrong
2023-10-02 10:27   ` Konrad Dybcio
2023-10-02 10:20 ` [PATCH v2 4/4] arm64: dts: qcom: sm8550-qrd: " Neil Armstrong
2023-10-02 10:28   ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).