* [PATCH v7 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition
2026-09-05 15:29 [PATCH v7 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
@ 2026-09-05 15:29 ` Krishna Kurapati
2026-09-10 15:53 ` Manivannan Sadhasivam
2026-09-05 15:29 ` [PATCH v7 2/5] include: linux: phy: Add phy attribute "type" and associated helpers Krishna Kurapati
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Krishna Kurapati @ 2026-09-05 15:29 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Thinh Nguyen,
Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati, Krzysztof Kozlowski
eUSB2 (Embedded USB2) is a MIPI Alliance standard for chip-to-chip USB2
signaling. Unlike standard USB2, which uses 3.3V signaling, eUSB2 uses
low-voltage differential signaling (~0.4V) and requires a repeater to
interface with external USB2 ports. Because of these differences, eUSB2
PHY initialization sequences, voltage tuning, and register configuration
are distinct from USB2.
Additionally, eUSB2 targets handle wakeup interrupts differently
depending on device speed when operating in host mode. According to the
eUSB2 specification, remote wakeup signaling in host mode is detected
via different data-line assertions based on the connected device speed:
- Low-speed devices: the host repeater drives eD+ to logic '1' upon
detecting a K-state on the USB lines during remote wakeup (eUSB2
spec, Section 5.5.14).
- Full-speed/high-speed devices: the host repeater drives eD- to
logic '1' upon detecting a K-state during remote wakeup (eUSB2 spec,
Sections 5.5.15 and 5.5.18).
Since the eUSB2 PHY's DP and DM lines need to be configured differently
from USB2 PHYs, controllers should be able to query the PHY type and
configure wakeup interrupts accordingly.
Add PHY_TYPE_EUSB2 to distinguish eUSB2 PHYs from standard USB2 PHYs.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
include/dt-bindings/phy/phy.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/dt-bindings/phy/phy.h b/include/dt-bindings/phy/phy.h
index 979b5dfd8353..555a022c8c0b 100644
--- a/include/dt-bindings/phy/phy.h
+++ b/include/dt-bindings/phy/phy.h
@@ -24,6 +24,7 @@
#define PHY_TYPE_CPHY 11
#define PHY_TYPE_USXGMII 12
#define PHY_TYPE_XAUI 13
+#define PHY_TYPE_EUSB2 14
#define PHY_POL_NORMAL 0
#define PHY_POL_INVERT 1
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v7 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition
2026-09-05 15:29 ` [PATCH v7 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition Krishna Kurapati
@ 2026-09-10 15:53 ` Manivannan Sadhasivam
0 siblings, 0 replies; 11+ messages in thread
From: Manivannan Sadhasivam @ 2026-09-10 15:53 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman, linux-phy,
devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krzysztof Kozlowski
On Sat, Sep 05, 2026 at 08:59:05PM +0530, Krishna Kurapati wrote:
> eUSB2 (Embedded USB2) is a MIPI Alliance standard for chip-to-chip USB2
> signaling. Unlike standard USB2, which uses 3.3V signaling, eUSB2 uses
> low-voltage differential signaling (~0.4V) and requires a repeater to
> interface with external USB2 ports. Because of these differences, eUSB2
> PHY initialization sequences, voltage tuning, and register configuration
> are distinct from USB2.
>
> Additionally, eUSB2 targets handle wakeup interrupts differently
> depending on device speed when operating in host mode. According to the
> eUSB2 specification, remote wakeup signaling in host mode is detected
> via different data-line assertions based on the connected device speed:
>
> - Low-speed devices: the host repeater drives eD+ to logic '1' upon
> detecting a K-state on the USB lines during remote wakeup (eUSB2
> spec, Section 5.5.14).
> - Full-speed/high-speed devices: the host repeater drives eD- to
> logic '1' upon detecting a K-state during remote wakeup (eUSB2 spec,
> Sections 5.5.15 and 5.5.18).
>
> Since the eUSB2 PHY's DP and DM lines need to be configured differently
> from USB2 PHYs, controllers should be able to query the PHY type and
> configure wakeup interrupts accordingly.
>
> Add PHY_TYPE_EUSB2 to distinguish eUSB2 PHYs from standard USB2 PHYs.
>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v7 2/5] include: linux: phy: Add phy attribute "type" and associated helpers
2026-09-05 15:29 [PATCH v7 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-09-05 15:29 ` [PATCH v7 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition Krishna Kurapati
@ 2026-09-05 15:29 ` Krishna Kurapati
2026-09-10 15:54 ` Manivannan Sadhasivam
2026-09-05 15:29 ` [PATCH v7 3/5] phy: snps-eusb2: Set phy type to EUSB2 Krishna Kurapati
` (2 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Krishna Kurapati @ 2026-09-05 15:29 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Thinh Nguyen,
Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
In cases like USB High-speed phys which can be either USB2 or EUSB2, it is
required to know the type of phy (rather than the operating mode) because
DP and DM interrupt lines need to be configured differently for each of
them.
Add support to cache the PHY_TYPE and add the following helpers:
- phy_set_type() for the phy drivers (like m31_eusb2 or snps-eusb2) to
declare what type of PHY they are (in this case PHY_TYPE_EUSB2).
- phy_get_type() for the consumers (like USB controllers) to query the
type of phy connected to them.
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
include/linux/phy/phy.h | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index ea47975e288a..038c2b58bbe1 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -21,6 +21,8 @@
#include <linux/phy/phy-lvds.h>
#include <linux/phy/phy-mipi-dphy.h>
+#include <dt-bindings/phy/phy.h>
+
struct phy;
enum phy_mode {
@@ -152,11 +154,13 @@ struct phy_ops {
* @bus_width: Data path width implemented by PHY
* @max_link_rate: Maximum link rate supported by PHY (units to be decided by producer and consumer)
* @mode: PHY mode
+ * @type: PHY type
*/
struct phy_attrs {
u32 bus_width;
u32 max_link_rate;
enum phy_mode mode;
+ int type;
};
/**
@@ -262,6 +266,20 @@ static inline enum phy_mode phy_get_mode(struct phy *phy)
{
return phy->attrs.mode;
}
+
+static inline int phy_get_type(struct phy *phy)
+{
+ if (phy)
+ return phy->attrs.type;
+
+ return PHY_NONE;
+}
+
+static inline void phy_set_type(struct phy *phy, int type)
+{
+ phy->attrs.type = type;
+}
+
int phy_reset(struct phy *phy);
int phy_calibrate(struct phy *phy);
int phy_notify_connect(struct phy *phy, int port);
@@ -393,6 +411,15 @@ static inline enum phy_mode phy_get_mode(struct phy *phy)
return PHY_MODE_INVALID;
}
+static inline int phy_get_type(struct phy *phy)
+{
+ return PHY_NONE;
+}
+
+static inline void phy_set_type(struct phy *phy, int type)
+{
+}
+
static inline int phy_reset(struct phy *phy)
{
if (!phy)
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v7 2/5] include: linux: phy: Add phy attribute "type" and associated helpers
2026-09-05 15:29 ` [PATCH v7 2/5] include: linux: phy: Add phy attribute "type" and associated helpers Krishna Kurapati
@ 2026-09-10 15:54 ` Manivannan Sadhasivam
0 siblings, 0 replies; 11+ messages in thread
From: Manivannan Sadhasivam @ 2026-09-10 15:54 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman, linux-phy,
devicetree, linux-kernel, linux-arm-msm, linux-usb
On Sat, Sep 05, 2026 at 08:59:06PM +0530, Krishna Kurapati wrote:
> In cases like USB High-speed phys which can be either USB2 or EUSB2, it is
> required to know the type of phy (rather than the operating mode) because
> DP and DM interrupt lines need to be configured differently for each of
> them.
>
> Add support to cache the PHY_TYPE and add the following helpers:
>
> - phy_set_type() for the phy drivers (like m31_eusb2 or snps-eusb2) to
> declare what type of PHY they are (in this case PHY_TYPE_EUSB2).
>
> - phy_get_type() for the consumers (like USB controllers) to query the
> type of phy connected to them.
>
> Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v7 3/5] phy: snps-eusb2: Set phy type to EUSB2
2026-09-05 15:29 [PATCH v7 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-09-05 15:29 ` [PATCH v7 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition Krishna Kurapati
2026-09-05 15:29 ` [PATCH v7 2/5] include: linux: phy: Add phy attribute "type" and associated helpers Krishna Kurapati
@ 2026-09-05 15:29 ` Krishna Kurapati
2026-09-10 15:55 ` Manivannan Sadhasivam
2026-09-05 15:29 ` [PATCH v7 4/5] phy: qcom: m31-eusb2: " Krishna Kurapati
2026-09-05 15:29 ` [PATCH v7 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
4 siblings, 1 reply; 11+ messages in thread
From: Krishna Kurapati @ 2026-09-05 15:29 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Thinh Nguyen,
Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
USB controllers like DWC3 are agnostic of the kind of phy (USB2/eUSB2)
connected to it. Set the phy type to EUSB2 to let the controller know
the phy type when queried during its probe.
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
drivers/phy/phy-snps-eusb2.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c
index af4fa17ac6cb..ab405108c727 100644
--- a/drivers/phy/phy-snps-eusb2.c
+++ b/drivers/phy/phy-snps-eusb2.c
@@ -596,6 +596,8 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev)
return PTR_ERR(generic_phy);
}
+ phy_set_type(generic_phy, PHY_TYPE_EUSB2);
+
dev_set_drvdata(dev, phy);
phy_set_drvdata(generic_phy, phy);
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v7 3/5] phy: snps-eusb2: Set phy type to EUSB2
2026-09-05 15:29 ` [PATCH v7 3/5] phy: snps-eusb2: Set phy type to EUSB2 Krishna Kurapati
@ 2026-09-10 15:55 ` Manivannan Sadhasivam
0 siblings, 0 replies; 11+ messages in thread
From: Manivannan Sadhasivam @ 2026-09-10 15:55 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman, linux-phy,
devicetree, linux-kernel, linux-arm-msm, linux-usb
On Sat, Sep 05, 2026 at 08:59:07PM +0530, Krishna Kurapati wrote:
> USB controllers like DWC3 are agnostic of the kind of phy (USB2/eUSB2)
> connected to it. Set the phy type to EUSB2 to let the controller know
> the phy type when queried during its probe.
>
> Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v7 4/5] phy: qcom: m31-eusb2: Set phy type to EUSB2
2026-09-05 15:29 [PATCH v7 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
` (2 preceding siblings ...)
2026-09-05 15:29 ` [PATCH v7 3/5] phy: snps-eusb2: Set phy type to EUSB2 Krishna Kurapati
@ 2026-09-05 15:29 ` Krishna Kurapati
2026-09-10 15:56 ` Manivannan Sadhasivam
2026-09-05 15:29 ` [PATCH v7 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
4 siblings, 1 reply; 11+ messages in thread
From: Krishna Kurapati @ 2026-09-05 15:29 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Thinh Nguyen,
Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
USB controllers like DWC3 are agnostic of the kind of phy (USB2/eUSB2)
connected to it. Set the phy type to EUSB2 to let the controller know
the phy type when queried during its probe.
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
index 275df38256de..72fa71003fd9 100644
--- a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
@@ -277,6 +277,8 @@ static int m31eusb2_phy_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(phy->phy),
"failed to create phy\n");
+ phy_set_type(phy->phy, PHY_TYPE_EUSB2);
+
ret = devm_regulator_bulk_get_const(dev, M31_EUSB_NUM_VREGS,
m31_eusb_phy_vregs, &phy->vregs);
if (ret)
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v7 4/5] phy: qcom: m31-eusb2: Set phy type to EUSB2
2026-09-05 15:29 ` [PATCH v7 4/5] phy: qcom: m31-eusb2: " Krishna Kurapati
@ 2026-09-10 15:56 ` Manivannan Sadhasivam
0 siblings, 0 replies; 11+ messages in thread
From: Manivannan Sadhasivam @ 2026-09-10 15:56 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman, linux-phy,
devicetree, linux-kernel, linux-arm-msm, linux-usb
On Sat, Sep 05, 2026 at 08:59:08PM +0530, Krishna Kurapati wrote:
> USB controllers like DWC3 are agnostic of the kind of phy (USB2/eUSB2)
> connected to it. Set the phy type to EUSB2 to let the controller know
> the phy type when queried during its probe.
>
> Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v7 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets
2026-09-05 15:29 [PATCH v7 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
` (3 preceding siblings ...)
2026-09-05 15:29 ` [PATCH v7 4/5] phy: qcom: m31-eusb2: " Krishna Kurapati
@ 2026-09-05 15:29 ` Krishna Kurapati
2026-09-09 13:00 ` Konrad Dybcio
4 siblings, 1 reply; 11+ messages in thread
From: Krishna Kurapati @ 2026-09-05 15:29 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Thinh Nguyen,
Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
eUSB2 targets handle wakeup interrupts differently depending on device
speed when operating in host mode.
According to the eUSB2 specification, remote wakeup signaling in host
mode is detected via different data-line assertions based on the
connected device speed.
When a low-speed device is connected, the host repeater drives eD+ to
logic '1' upon detecting a K-state on the USB lines during remote wakeup
(eUSB2 specification, Section 5.5.14).
When a full-speed or high-speed device is connected, the host repeater
drives eD- to logic '1' upon detecting a K-state on the USB line during
remote wakeup (eUSB2 specification, Sections 5.5.15 and 5.5.18).
Since the eUSB2 PHY's "DP" and "DM" interrupt lines monitor the eD+ and
eD- line states, query the phy type and configure the wakeup interrupts
accordingly.
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
drivers/usb/dwc3/dwc3-qcom.c | 63 +++++++++++++++++++++++++++++++++-----------
1 file changed, 48 insertions(+), 15 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index ba26e61df915..2d1e66ff72ed 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -86,6 +86,7 @@ struct dwc3_qcom {
struct icc_path *icc_path_apps;
enum usb_role current_role;
+ bool has_eusb2_phy;
};
#define to_dwc3_qcom(d) container_of((d), struct dwc3_qcom, dwc)
@@ -273,15 +274,23 @@ static void dwc3_qcom_disable_wakeup_irq(int irq)
disable_irq_nosync(irq);
}
-static void dwc3_qcom_disable_port_interrupts(struct dwc3_qcom_port *port)
+static void dwc3_qcom_disable_port_interrupts(struct dwc3_qcom *qcom, int port_index)
{
+ struct dwc3_qcom_port *port = &qcom->ports[port_index];
+
dwc3_qcom_disable_wakeup_irq(port->qusb2_phy_irq);
if (port->usb2_speed == USB_SPEED_LOW) {
- dwc3_qcom_disable_wakeup_irq(port->dm_hs_phy_irq);
+ if (qcom->has_eusb2_phy)
+ dwc3_qcom_disable_wakeup_irq(port->dp_hs_phy_irq);
+ else
+ dwc3_qcom_disable_wakeup_irq(port->dm_hs_phy_irq);
} else if ((port->usb2_speed == USB_SPEED_HIGH) ||
(port->usb2_speed == USB_SPEED_FULL)) {
- dwc3_qcom_disable_wakeup_irq(port->dp_hs_phy_irq);
+ if (qcom->has_eusb2_phy)
+ dwc3_qcom_disable_wakeup_irq(port->dm_hs_phy_irq);
+ else
+ dwc3_qcom_disable_wakeup_irq(port->dp_hs_phy_irq);
} else {
dwc3_qcom_disable_wakeup_irq(port->dp_hs_phy_irq);
dwc3_qcom_disable_wakeup_irq(port->dm_hs_phy_irq);
@@ -290,26 +299,38 @@ static void dwc3_qcom_disable_port_interrupts(struct dwc3_qcom_port *port)
dwc3_qcom_disable_wakeup_irq(port->ss_phy_irq);
}
-static void dwc3_qcom_enable_port_interrupts(struct dwc3_qcom_port *port)
+static void dwc3_qcom_enable_port_interrupts(struct dwc3_qcom *qcom, int port_index)
{
+ struct dwc3_qcom_port *port = &qcom->ports[port_index];
+
dwc3_qcom_enable_wakeup_irq(port->qusb2_phy_irq, 0);
/*
* Configure DP/DM line interrupts based on the USB2 device attached to
- * the root hub port. When HS/FS device is connected, configure the DP line
- * as falling edge to detect both disconnect and remote wakeup scenarios. When
- * LS device is connected, configure DM line as falling edge to detect both
- * disconnect and remote wakeup. When no device is connected, configure both
- * DP and DM lines as rising edge to detect HS/HS/LS device connect scenario.
+ * the root hub port. For non-eUSB2 targets, when HS/FS device is connected,
+ * configure the DP line as falling edge to detect disconnect and remote
+ * wakeup. When LS device is connected, configure the DM line as falling edge
+ * for the same. For eUSB2 targets, the lines are swapped and rising edge is
+ * used: DP line for LS and DM line for HS/FS device detection. When no
+ * device is connected, configure both DP and DM lines as rising edge to
+ * detect HS/FS/LS device connect scenario.
*/
if (port->usb2_speed == USB_SPEED_LOW) {
- dwc3_qcom_enable_wakeup_irq(port->dm_hs_phy_irq,
- IRQ_TYPE_EDGE_FALLING);
+ if (qcom->has_eusb2_phy)
+ dwc3_qcom_enable_wakeup_irq(port->dp_hs_phy_irq,
+ IRQ_TYPE_EDGE_RISING);
+ else
+ dwc3_qcom_enable_wakeup_irq(port->dm_hs_phy_irq,
+ IRQ_TYPE_EDGE_FALLING);
} else if ((port->usb2_speed == USB_SPEED_HIGH) ||
(port->usb2_speed == USB_SPEED_FULL)) {
- dwc3_qcom_enable_wakeup_irq(port->dp_hs_phy_irq,
- IRQ_TYPE_EDGE_FALLING);
+ if (qcom->has_eusb2_phy)
+ dwc3_qcom_enable_wakeup_irq(port->dm_hs_phy_irq,
+ IRQ_TYPE_EDGE_RISING);
+ else
+ dwc3_qcom_enable_wakeup_irq(port->dp_hs_phy_irq,
+ IRQ_TYPE_EDGE_FALLING);
} else {
dwc3_qcom_enable_wakeup_irq(port->dp_hs_phy_irq,
IRQ_TYPE_EDGE_RISING);
@@ -325,7 +346,7 @@ static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
int i;
for (i = 0; i < qcom->num_ports; i++)
- dwc3_qcom_disable_port_interrupts(&qcom->ports[i]);
+ dwc3_qcom_disable_port_interrupts(qcom, i);
}
static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom)
@@ -333,7 +354,7 @@ static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom)
int i;
for (i = 0; i < qcom->num_ports; i++)
- dwc3_qcom_enable_port_interrupts(&qcom->ports[i]);
+ dwc3_qcom_enable_port_interrupts(qcom, i);
}
static int dwc3_qcom_suspend(struct dwc3_qcom *qcom, bool wakeup)
@@ -628,6 +649,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
int ret;
bool ignore_pipe_clk;
bool wakeup_source;
+ struct phy *phy;
qcom = devm_kzalloc(&pdev->dev, sizeof(*qcom), GFP_KERNEL);
if (!qcom)
@@ -698,6 +720,17 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
if (ret)
goto clk_disable;
+ phy = devm_of_phy_get_by_index(dev, dev->of_node, 0);
+ if (IS_ERR(phy)) {
+ if (PTR_ERR(phy) != -ENODEV) {
+ ret = dev_err_probe(dev, PTR_ERR(phy),
+ "failed to get usb2 phy\n");
+ goto clk_disable;
+ }
+ phy = NULL;
+ }
+ qcom->has_eusb2_phy = (phy_get_type(phy) == PHY_TYPE_EUSB2);
+
qcom->mode = usb_get_dr_mode(dev);
if (qcom->mode == USB_DR_MODE_HOST) {
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v7 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets
2026-09-05 15:29 ` [PATCH v7 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
@ 2026-09-09 13:00 ` Konrad Dybcio
0 siblings, 0 replies; 11+ messages in thread
From: Konrad Dybcio @ 2026-09-09 13:00 UTC (permalink / raw)
To: Krishna Kurapati, Vinod Koul, Neil Armstrong,
Manivannan Sadhasivam, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb
On 9/5/26 5:29 PM, Krishna Kurapati wrote:
> eUSB2 targets handle wakeup interrupts differently depending on device
> speed when operating in host mode.
>
> According to the eUSB2 specification, remote wakeup signaling in host
> mode is detected via different data-line assertions based on the
> connected device speed.
[...]
> @@ -628,6 +649,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
> int ret;
> bool ignore_pipe_clk;
> bool wakeup_source;
> + struct phy *phy;
>
> qcom = devm_kzalloc(&pdev->dev, sizeof(*qcom), GFP_KERNEL);
> if (!qcom)
> @@ -698,6 +720,17 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
> if (ret)
> goto clk_disable;
>
> + phy = devm_of_phy_get_by_index(dev, dev->of_node, 0);
> + if (IS_ERR(phy)) {
> + if (PTR_ERR(phy) != -ENODEV) {
GPT reports:
When CONFIG_GENERIC_PHY is disabled, the stub in include/linux/phy/phy.h:489-493
returns ERR_PTR(-ENOSYS). The patch only treats -ENODEV as “no PHY”:
But it's not like one can really use this driver without a PHY..
We can add a follow-up to depend on that for the qcom driver
otherwise
Acked-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 11+ messages in thread