linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support
@ 2023-06-13  7:55 Neil Armstrong
  2023-06-13  7:55 ` [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation Neil Armstrong
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  7:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb,
	Neil Armstrong, Krzysztof Kozlowski

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 <neil.armstrong@linaro.org>
---
Changes in v3:
- Fix fsa node names in both QRD amd MTP nodes
- Add missing orientation-gpios in MTP dt
- Remove invalid svid property
- Link to v2: https://lore.kernel.org/r/20230601-topic-sm8550-upstream-type-c-v2-0-3bbdf37575c3@linaro.org

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: e8bab25f2afdf2f74359f6c743b21fafc9cdb03e
change-id: 20230601-topic-sm8550-upstream-type-c-e85b4d971450

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


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

* [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation
  2023-06-13  7:55 [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support Neil Armstrong
@ 2023-06-13  7:55 ` Neil Armstrong
  2023-06-13  8:13   ` Krzysztof Kozlowski
  2023-06-13  8:18   ` Rob Herring
  2023-06-13  7:55 ` [PATCH v3 2/8] soc: qcom: pmic_glink_altmode: handle safe mode when disconnect Neil Armstrong
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  7:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb,
	Neil Armstrong, Krzysztof Kozlowski

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 <krzysztof.kozlowski@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 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:

-- 
2.34.1


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

* [PATCH v3 2/8] soc: qcom: pmic_glink_altmode: handle safe mode when disconnect
  2023-06-13  7:55 [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support Neil Armstrong
  2023-06-13  7:55 ` [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation Neil Armstrong
@ 2023-06-13  7:55 ` Neil Armstrong
  2023-06-26  9:18   ` Heikki Krogerus
  2023-06-13  7:55 ` [PATCH v3 3/8] usb: ucsi: glink: use the connector orientation GPIO to provide switch events Neil Armstrong
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  7:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb,
	Neil Armstrong

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 <neil.armstrong@linaro.org>
---
 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

-- 
2.34.1


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

* [PATCH v3 3/8] usb: ucsi: glink: use the connector orientation GPIO to provide switch events
  2023-06-13  7:55 [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support Neil Armstrong
  2023-06-13  7:55 ` [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation Neil Armstrong
  2023-06-13  7:55 ` [PATCH v3 2/8] soc: qcom: pmic_glink_altmode: handle safe mode when disconnect Neil Armstrong
@ 2023-06-13  7:55 ` Neil Armstrong
  2023-06-13  7:55 ` [PATCH v3 4/8] qcom: pmic_glink_altmode: add retimer-switch support Neil Armstrong
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  7:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb,
	Neil Armstrong

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 <heikki.krogerus@linux.intel.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 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 <linux/mutex.h>
 #include <linux/property.h>
 #include <linux/soc/qcom/pdr.h>
+#include <linux/usb/typec_mux.h>
+#include <linux/gpio/consumer.h>
 #include <linux/soc/qcom/pmic_glink.h>
 #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,

-- 
2.34.1


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

* [PATCH v3 4/8] qcom: pmic_glink_altmode: add retimer-switch support
  2023-06-13  7:55 [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support Neil Armstrong
                   ` (2 preceding siblings ...)
  2023-06-13  7:55 ` [PATCH v3 3/8] usb: ucsi: glink: use the connector orientation GPIO to provide switch events Neil Armstrong
@ 2023-06-13  7:55 ` Neil Armstrong
  2023-06-26  9:19   ` Heikki Krogerus
  2023-06-13  7:55 ` [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550 Neil Armstrong
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  7:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb,
	Neil Armstrong

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 <neil.armstrong@linaro.org>
---
 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 <linux/usb/typec_altmode.h>
 #include <linux/usb/typec_dp.h>
 #include <linux/usb/typec_mux.h>
+#include <linux/usb/typec_retimer.h>
 
 #include <linux/soc/qcom/pmic_glink.h>
 
@@ -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),

-- 
2.34.1


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

* [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550
  2023-06-13  7:55 [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support Neil Armstrong
                   ` (3 preceding siblings ...)
  2023-06-13  7:55 ` [PATCH v3 4/8] qcom: pmic_glink_altmode: add retimer-switch support Neil Armstrong
@ 2023-06-13  7:55 ` Neil Armstrong
  2023-06-13 11:23   ` Konrad Dybcio
  2023-06-13 11:54   ` Krzysztof Kozlowski
  2023-06-13  7:55 ` [PATCH v3 6/8] arm64: dts: qcom: sm8550: add ports subnodes in usb/dp qmpphy node Neil Armstrong
                   ` (2 subsequent siblings)
  7 siblings, 2 replies; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  7:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb,
	Neil Armstrong

Altmode is also supported for SM8550, allow it.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 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" },
 	{}
 };

-- 
2.34.1


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

* [PATCH v3 6/8] arm64: dts: qcom: sm8550: add ports subnodes in usb/dp qmpphy node
  2023-06-13  7:55 [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support Neil Armstrong
                   ` (4 preceding siblings ...)
  2023-06-13  7:55 ` [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550 Neil Armstrong
@ 2023-06-13  7:55 ` Neil Armstrong
  2023-06-13  7:56 ` [PATCH v3 7/8] arm64: dts: qcom: sm8550-mtp: add pmic glink port/endpoints Neil Armstrong
  2023-06-13  7:56 ` [PATCH v3 8/8] arm64: dts: qcom: sm8550-qrd: " Neil Armstrong
  7 siblings, 0 replies; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  7:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb,
	Neil Armstrong

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 <konrad.dybcio@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 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 {

-- 
2.34.1


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

* [PATCH v3 7/8] arm64: dts: qcom: sm8550-mtp: add pmic glink port/endpoints
  2023-06-13  7:55 [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support Neil Armstrong
                   ` (5 preceding siblings ...)
  2023-06-13  7:55 ` [PATCH v3 6/8] arm64: dts: qcom: sm8550: add ports subnodes in usb/dp qmpphy node Neil Armstrong
@ 2023-06-13  7:56 ` Neil Armstrong
  2023-06-13  7:56 ` [PATCH v3 8/8] arm64: dts: qcom: sm8550-qrd: " Neil Armstrong
  7 siblings, 0 replies; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  7:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb,
	Neil Armstrong

Add nodes to support Type-C USB/DP functionality.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 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..92aa67256e8a 100644
--- a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
+++ b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
@@ -63,6 +63,7 @@ connector@0 {
 			reg = <0>;
 			power-role = "dual";
 			data-role = "dual";
+			orientation-gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>;
 
 			ports {
 				#address-cells = <1>;
@@ -80,7 +81,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 +428,37 @@ vreg_l3g_1p2: ldo3 {
 	};
 };
 
+&i2c_master_hub_0 {
+	status = "okay";
+};
+
+&i2c_hub_2 {
+	status = "okay";
+
+	typec-mux@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>;
+				};
+			};
+		};
+	};
+};
+
 &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>;
 };

-- 
2.34.1


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

* [PATCH v3 8/8] arm64: dts: qcom: sm8550-qrd: add pmic glink port/endpoints
  2023-06-13  7:55 [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support Neil Armstrong
                   ` (6 preceding siblings ...)
  2023-06-13  7:56 ` [PATCH v3 7/8] arm64: dts: qcom: sm8550-mtp: add pmic glink port/endpoints Neil Armstrong
@ 2023-06-13  7:56 ` Neil Armstrong
  7 siblings, 0 replies; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  7:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb,
	Neil Armstrong

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 <neil.armstrong@linaro.org>
---
 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..792351c44b46 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-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;
+
+		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>;
 };

-- 
2.34.1


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

* Re: [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation
  2023-06-13  7:55 ` [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation Neil Armstrong
@ 2023-06-13  8:13   ` Krzysztof Kozlowski
  2023-06-13  8:54     ` Neil Armstrong
  2023-06-13  8:18   ` Rob Herring
  1 sibling, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-13  8:13 UTC (permalink / raw)
  To: Neil Armstrong, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb

On 13/06/2023 09:55, Neil Armstrong wrote:
> 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 <krzysztof.kozlowski@linaro.org>

Rob had here objections as these are bindings for the connector, not
PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
have such pin exposed. If you open the schematics, the GPIO is actually
coming out from PMIC and is nowhere around the connector. Please drop my
Ack.

This however could be a pin of the PMIC because it clearly is on the
schematics.



Best regards,
Krzysztof


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

* Re: [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation
  2023-06-13  7:55 ` [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation Neil Armstrong
  2023-06-13  8:13   ` Krzysztof Kozlowski
@ 2023-06-13  8:18   ` Rob Herring
  1 sibling, 0 replies; 22+ messages in thread
From: Rob Herring @ 2023-06-13  8:18 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: linux-usb, Rob Herring, Krzysztof Kozlowski, Greg Kroah-Hartman,
	devicetree, linux-arm-msm, Heikki Krogerus, Conor Dooley,
	linux-kernel, Krzysztof Kozlowski, Bjorn Andersson,
	Konrad Dybcio, Andy Gross


On Tue, 13 Jun 2023 09:55:54 +0200, Neil Armstrong wrote:
> 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 <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  Documentation/devicetree/bindings/connector/usb-connector.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml: $defs:qcom-pmic-mpp-state:properties:qcom,paired: [{'description': 'Indicates that the pin should be operating in paired mode.'}] is not of type 'object', 'boolean'
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230601-topic-sm8550-upstream-type-c-v3-1-22c9973012b6@linaro.org

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


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

* Re: [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation
  2023-06-13  8:13   ` Krzysztof Kozlowski
@ 2023-06-13  8:54     ` Neil Armstrong
  2023-06-13  9:02       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13  8:54 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Heikki Krogerus, Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb

On 13/06/2023 10:13, Krzysztof Kozlowski wrote:
> On 13/06/2023 09:55, Neil Armstrong wrote:
>> 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 <krzysztof.kozlowski@linaro.org>
> 
> Rob had here objections as these are bindings for the connector, not
> PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
> have such pin exposed. If you open the schematics, the GPIO is actually
> coming out from PMIC and is nowhere around the connector. Please drop my
> Ack.
> 
> This however could be a pin of the PMIC because it clearly is on the
> schematics.

Yes it comes from the PMIC, but this part of the PMIC is handled by
the PMIC_GLINK firmware service, so the logical place would be into
the pmic_glink node with a gpio array in order to handle multi-ports.

Thanks,
Neil

> 
> 
> 
> Best regards,
> Krzysztof
> 


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

* Re: [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation
  2023-06-13  8:54     ` Neil Armstrong
@ 2023-06-13  9:02       ` Krzysztof Kozlowski
  2023-06-13  9:24         ` neil.armstrong
  0 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-13  9:02 UTC (permalink / raw)
  To: neil.armstrong, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb

On 13/06/2023 10:54, Neil Armstrong wrote:
> On 13/06/2023 10:13, Krzysztof Kozlowski wrote:
>> On 13/06/2023 09:55, Neil Armstrong wrote:
>>> 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 <krzysztof.kozlowski@linaro.org>
>>
>> Rob had here objections as these are bindings for the connector, not
>> PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
>> have such pin exposed. If you open the schematics, the GPIO is actually
>> coming out from PMIC and is nowhere around the connector. Please drop my
>> Ack.
>>
>> This however could be a pin of the PMIC because it clearly is on the
>> schematics.
> 
> Yes it comes from the PMIC, but this part of the PMIC is handled by
> the PMIC_GLINK firmware service, so the logical place would be into
> the pmic_glink node with a gpio array in order to handle multi-ports.

I think all PMICs have only one CC_OUT pin, so this would be now
maxItems: 1, but there will be no problem in growing this later.

Best regards,
Krzysztof


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

* Re: [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation
  2023-06-13  9:02       ` Krzysztof Kozlowski
@ 2023-06-13  9:24         ` neil.armstrong
  2023-06-13 11:51           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 22+ messages in thread
From: neil.armstrong @ 2023-06-13  9:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Heikki Krogerus, Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb

On 13/06/2023 11:02, Krzysztof Kozlowski wrote:
> On 13/06/2023 10:54, Neil Armstrong wrote:
>> On 13/06/2023 10:13, Krzysztof Kozlowski wrote:
>>> On 13/06/2023 09:55, Neil Armstrong wrote:
>>>> 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 <krzysztof.kozlowski@linaro.org>
>>>
>>> Rob had here objections as these are bindings for the connector, not
>>> PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
>>> have such pin exposed. If you open the schematics, the GPIO is actually
>>> coming out from PMIC and is nowhere around the connector. Please drop my
>>> Ack.
>>>
>>> This however could be a pin of the PMIC because it clearly is on the
>>> schematics.
>>
>> Yes it comes from the PMIC, but this part of the PMIC is handled by
>> the PMIC_GLINK firmware service, so the logical place would be into
>> the pmic_glink node with a gpio array in order to handle multi-ports.
> 
> I think all PMICs have only one CC_OUT pin, so this would be now
> maxItems: 1, but there will be no problem in growing this later.

Yep, I'll only allow for sm8550-pmic-glink and set maxItems: 1 for now
since it's the first occurence.

Neil

> 
> Best regards,
> Krzysztof
> 


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

* Re: [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550
  2023-06-13  7:55 ` [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550 Neil Armstrong
@ 2023-06-13 11:23   ` Konrad Dybcio
  2023-06-13 11:54   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 22+ messages in thread
From: Konrad Dybcio @ 2023-06-13 11:23 UTC (permalink / raw)
  To: Neil Armstrong, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andy Gross, Bjorn Andersson, Heikki Krogerus, Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb



On 13.06.2023 09:55, Neil Armstrong wrote:
> Altmode is also supported for SM8550, allow it.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  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" },
>  	{}
>  };
> 

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

* Re: [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation
  2023-06-13  9:24         ` neil.armstrong
@ 2023-06-13 11:51           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-13 11:51 UTC (permalink / raw)
  To: neil.armstrong, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb

On 13/06/2023 11:24, neil.armstrong@linaro.org wrote:
> On 13/06/2023 11:02, Krzysztof Kozlowski wrote:
>> On 13/06/2023 10:54, Neil Armstrong wrote:
>>> On 13/06/2023 10:13, Krzysztof Kozlowski wrote:
>>>> On 13/06/2023 09:55, Neil Armstrong wrote:
>>>>> 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 <krzysztof.kozlowski@linaro.org>
>>>>
>>>> Rob had here objections as these are bindings for the connector, not
>>>> PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
>>>> have such pin exposed. If you open the schematics, the GPIO is actually
>>>> coming out from PMIC and is nowhere around the connector. Please drop my
>>>> Ack.
>>>>
>>>> This however could be a pin of the PMIC because it clearly is on the
>>>> schematics.
>>>
>>> Yes it comes from the PMIC, but this part of the PMIC is handled by
>>> the PMIC_GLINK firmware service, so the logical place would be into
>>> the pmic_glink node with a gpio array in order to handle multi-ports.
>>
>> I think all PMICs have only one CC_OUT pin, so this would be now
>> maxItems: 1, but there will be no problem in growing this later.
> 
> Yep, I'll only allow for sm8550-pmic-glink and set maxItems: 1 for now
> since it's the first occurence.

You can add to pm8350 as well - it's already used in HDK8450.

Best regards,
Krzysztof


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

* Re: [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550
  2023-06-13  7:55 ` [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550 Neil Armstrong
  2023-06-13 11:23   ` Konrad Dybcio
@ 2023-06-13 11:54   ` Krzysztof Kozlowski
  2023-06-13 13:43     ` Neil Armstrong
  1 sibling, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-13 11:54 UTC (permalink / raw)
  To: Neil Armstrong, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb

On 13/06/2023 09:55, Neil Armstrong wrote:
> Altmode is also supported for SM8550, allow it.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  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 },

Orientation and maybe all of the USB-related properties do not look like
sm8450 specific, but PM8350B. That's where CC_OUT pin is. I don't think
we represented this correctly, but rather copy-pasted downstream solution...

Best regards,
Krzysztof


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

* Re: [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550
  2023-06-13 11:54   ` Krzysztof Kozlowski
@ 2023-06-13 13:43     ` Neil Armstrong
  2023-06-13 13:58       ` Konrad Dybcio
  0 siblings, 1 reply; 22+ messages in thread
From: Neil Armstrong @ 2023-06-13 13:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Heikki Krogerus, Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb

On 13/06/2023 13:54, Krzysztof Kozlowski wrote:
> On 13/06/2023 09:55, Neil Armstrong wrote:
>> Altmode is also supported for SM8550, allow it.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>>   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 },
> 
> Orientation and maybe all of the USB-related properties do not look like
> sm8450 specific, but PM8350B. That's where CC_OUT pin is. I don't think
> we represented this correctly, but rather copy-pasted downstream solution...

We do not interact directly with PM8350B or PM8550B but with pmic_glink who
does the work work for use, and this is platform specific.

Neil

> 
> Best regards,
> Krzysztof
> 


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

* Re: [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550
  2023-06-13 13:43     ` Neil Armstrong
@ 2023-06-13 13:58       ` Konrad Dybcio
  2023-06-13 18:37         ` Krzysztof Kozlowski
  0 siblings, 1 reply; 22+ messages in thread
From: Konrad Dybcio @ 2023-06-13 13:58 UTC (permalink / raw)
  To: neil.armstrong, Krzysztof Kozlowski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Heikki Krogerus, Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb



On 13.06.2023 15:43, Neil Armstrong wrote:
> On 13/06/2023 13:54, Krzysztof Kozlowski wrote:
>> On 13/06/2023 09:55, Neil Armstrong wrote:
>>> Altmode is also supported for SM8550, allow it.
>>>
>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>> ---
>>>   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 },
>>
>> Orientation and maybe all of the USB-related properties do not look like
>> sm8450 specific, but PM8350B. That's where CC_OUT pin is. I don't think
>> we represented this correctly, but rather copy-pasted downstream solution...
> 
> We do not interact directly with PM8350B or PM8550B but with pmic_glink who
> does the work work for use, and this is platform specific.
Yep, pmic_glink is totally a firmware construct and not all platforms with
pm8350b or so implement it.

Konrad
> 
> Neil
> 
>>
>> Best regards,
>> Krzysztof
>>
> 

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

* Re: [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550
  2023-06-13 13:58       ` Konrad Dybcio
@ 2023-06-13 18:37         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-13 18:37 UTC (permalink / raw)
  To: Konrad Dybcio, neil.armstrong, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andy Gross, Bjorn Andersson, Heikki Krogerus,
	Greg Kroah-Hartman
  Cc: Rob Herring, devicetree, linux-kernel, linux-arm-msm, linux-usb

On 13/06/2023 15:58, Konrad Dybcio wrote:
> 
> 
> On 13.06.2023 15:43, Neil Armstrong wrote:
>> On 13/06/2023 13:54, Krzysztof Kozlowski wrote:
>>> On 13/06/2023 09:55, Neil Armstrong wrote:
>>>> Altmode is also supported for SM8550, allow it.
>>>>
>>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>>> ---
>>>>   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 },
>>>
>>> Orientation and maybe all of the USB-related properties do not look like
>>> sm8450 specific, but PM8350B. That's where CC_OUT pin is. I don't think
>>> we represented this correctly, but rather copy-pasted downstream solution...
>>
>> We do not interact directly with PM8350B or PM8550B but with pmic_glink who
>> does the work work for use, and this is platform specific.
> Yep, pmic_glink is totally a firmware construct and not all platforms with
> pm8350b or so implement it.

The drivers interact like this, but there is no pmic glink on schematics
but PM8350B and PM8550 and DT represents here the hardware, thus the
schematics, not your chosen way of interface. This looks like a copy of
downstream choice which is in most cases just wrong choice.

Best regards,
Krzysztof


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

* Re: [PATCH v3 2/8] soc: qcom: pmic_glink_altmode: handle safe mode when disconnect
  2023-06-13  7:55 ` [PATCH v3 2/8] soc: qcom: pmic_glink_altmode: handle safe mode when disconnect Neil Armstrong
@ 2023-06-26  9:18   ` Heikki Krogerus
  0 siblings, 0 replies; 22+ messages in thread
From: Heikki Krogerus @ 2023-06-26  9:18 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Greg Kroah-Hartman, Rob Herring,
	devicetree, linux-kernel, linux-arm-msm, linux-usb

On Tue, Jun 13, 2023 at 09:55:55AM +0200, Neil Armstrong wrote:
> 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 <neil.armstrong@linaro.org>

FWIW:

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  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
> 
> -- 
> 2.34.1

-- 
heikki

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

* Re: [PATCH v3 4/8] qcom: pmic_glink_altmode: add retimer-switch support
  2023-06-13  7:55 ` [PATCH v3 4/8] qcom: pmic_glink_altmode: add retimer-switch support Neil Armstrong
@ 2023-06-26  9:19   ` Heikki Krogerus
  0 siblings, 0 replies; 22+ messages in thread
From: Heikki Krogerus @ 2023-06-26  9:19 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Greg Kroah-Hartman, Rob Herring,
	devicetree, linux-kernel, linux-arm-msm, linux-usb

On Tue, Jun 13, 2023 at 09:55:57AM +0200, Neil Armstrong wrote:
> 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 <neil.armstrong@linaro.org>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  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 <linux/usb/typec_altmode.h>
>  #include <linux/usb/typec_dp.h>
>  #include <linux/usb/typec_mux.h>
> +#include <linux/usb/typec_retimer.h>
>  
>  #include <linux/soc/qcom/pmic_glink.h>
>  
> @@ -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),
> 
> -- 
> 2.34.1

-- 
heikki

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

end of thread, other threads:[~2023-06-26  9:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-13  7:55 [PATCH v3 0/8] arm64: qcom: add Type-C Altmode support Neil Armstrong
2023-06-13  7:55 ` [PATCH v3 1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation Neil Armstrong
2023-06-13  8:13   ` Krzysztof Kozlowski
2023-06-13  8:54     ` Neil Armstrong
2023-06-13  9:02       ` Krzysztof Kozlowski
2023-06-13  9:24         ` neil.armstrong
2023-06-13 11:51           ` Krzysztof Kozlowski
2023-06-13  8:18   ` Rob Herring
2023-06-13  7:55 ` [PATCH v3 2/8] soc: qcom: pmic_glink_altmode: handle safe mode when disconnect Neil Armstrong
2023-06-26  9:18   ` Heikki Krogerus
2023-06-13  7:55 ` [PATCH v3 3/8] usb: ucsi: glink: use the connector orientation GPIO to provide switch events Neil Armstrong
2023-06-13  7:55 ` [PATCH v3 4/8] qcom: pmic_glink_altmode: add retimer-switch support Neil Armstrong
2023-06-26  9:19   ` Heikki Krogerus
2023-06-13  7:55 ` [PATCH v3 5/8] qcom: pmic_glink: enable altmode for SM8550 Neil Armstrong
2023-06-13 11:23   ` Konrad Dybcio
2023-06-13 11:54   ` Krzysztof Kozlowski
2023-06-13 13:43     ` Neil Armstrong
2023-06-13 13:58       ` Konrad Dybcio
2023-06-13 18:37         ` Krzysztof Kozlowski
2023-06-13  7:55 ` [PATCH v3 6/8] arm64: dts: qcom: sm8550: add ports subnodes in usb/dp qmpphy node Neil Armstrong
2023-06-13  7:56 ` [PATCH v3 7/8] arm64: dts: qcom: sm8550-mtp: add pmic glink port/endpoints Neil Armstrong
2023-06-13  7:56 ` [PATCH v3 8/8] arm64: dts: qcom: sm8550-qrd: " Neil Armstrong

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).