Skip to contentSkip to conversation

dt-bindings: usb: usb-nop-xceiv: add wakeup-source property

PATCH Superseded Li Jun 2 participants 5 messages Oct 24, 2022 – Oct 25, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Li Jun

author
#0 lore raw

PATCH 1/2 dt-bindings: usb: usb-nop-xceiv: add wakeup-source property

usb phy may be part of wakeup source, so add wakeup source property to keep its resource(e.g power domain) active to make usb remote wakeup work.

---
 Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +5 -0
index 2824c17285ee..7b71e32d1df0 100644
@@ -39,6 +39,11 @@ properties:
       the VBus line.
     $ref: /schemas/types.yaml#/definitions/phandle
 
+  wakeup-source:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Specify if it's USB remote wakeup capable.
+
 required:
   - compatible
   - '#phy-cells'
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/2 usb: phy: generic: Add wakeup capability

In case usb phy is the wakeup source, enable its wakeup capability.

---
 drivers/usb/phy/phy-generic.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/phy/phy-generic.c +4 -0
index 8ed9327cc4a5..c1309ea24a52 100644
@@ -286,6 +286,7 @@ EXPORT_SYMBOL_GPL(usb_phy_gen_create_phy);
 static int usb_phy_generic_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
+	struct device_node *dn = dev->of_node;
 	struct usb_phy_generic	*nop;
 	int err;
 
@@ -323,6 +324,9 @@ static int usb_phy_generic_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, nop);
 
+	device_set_wakeup_capable(&pdev->dev,
+				  of_property_read_bool(dn, "wakeup-source"));
+
 	return 0;
 }
 
Signature · 1 line
2.34.1
#2 lore raw
In reply to Li Jun
Quoted 1 line · Li Jun

usb phy may be part of wakeup source, so add wakeup source property

s/usb/USB/

"part of wakeup source" is actually not descriptive. What do you want to say here?

Quoted 1 line

to keep its resource(e.g power domain) active to make usb remote

space before (
s/e.g/e.g./
s/usb/USB/

Quoted 12 lines

wakeup work.

---
 Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +0 -0
index 2824c17285ee..7b71e32d1df0 100644

Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml properties: · line 43

Quoted 5 lines
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +2 -0
@@ -39,6 +39,11 @@ properties:
       the VBus line.
     $ref: /schemas/types.yaml#/definitions/phandle
 
+  wakeup-source:
+    $ref: /schemas/types.yaml#/definitions/flag

This shouldn't be needed, as it is a standard property.

Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml properties: · line 45

Quoted 2 lines
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +2 -0
+    description:
+      Specify if it's USB remote wakeup capable.

Now you have to explain in the bindings what is "USB remote wakeup".

Best regards,
Krzysztof

author
#3 lore raw
Quoted 11 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Tuesday, October 25, 2022 8:23 AM
To: Jun Li <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Xu Yang <[email protected]>
Subject: Re: [PATCH 1/2] dt-bindings: usb: usb-nop-xceiv: add wakeup-source property

Quoted 7 lines
Quoted 1 line · Li Jun

usb phy may be part of wakeup source, so add wakeup source property

s/usb/USB/

"part of wakeup source" is actually not descriptive. What do you want to say here?

Will change to be "USB phy may be a system wakeup source".

Quoted 6 lines
Quoted 2 lines

to keep its resource(e.g power domain) active to make usb remote

space before (
s/e.g/e.g./
s/usb/USB/

Okay.

Quoted 17 lines
Quoted 17 lines

wakeup work.

---
 Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +0 -0
index 2824c17285ee..7b71e32d1df0 100644
@@ -39,6 +39,11 @@ properties:
       the VBus line.
     $ref: /schemas/types.yaml#/definitions/phandle
 
Quoted 4 lines

Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml properties: · line 43

Quoted 2 lines
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +2 -0
+  wakeup-source:
+    $ref: /schemas/types.yaml#/definitions/flag

This shouldn't be needed, as it is a standard property.

Will remove.

Quoted 5 lines

Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml properties: · line 45

Quoted 3 lines
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +2 -0
+    description:
+      Specify if it's USB remote wakeup capable.

Now you have to explain in the bindings what is "USB remote wakeup".

"USB remote wakeup" is a standard concept in USB world/spec, change the description like "if the USB phy can detect the remote wakeup signal while the system sleep" make sense to you?

Thanks
Li Jun

Quoted 3 lines

Best regards,
Krzysztof

#4 lore raw
Quoted 55 lines · Jun Li
Quoted 11 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Tuesday, October 25, 2022 8:23 AM
To: Jun Li <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Xu Yang <[email protected]>
Subject: Re: [PATCH 1/2] dt-bindings: usb: usb-nop-xceiv: add wakeup-source property

Quoted 7 lines
Quoted 1 line · Li Jun

usb phy may be part of wakeup source, so add wakeup source property

s/usb/USB/

"part of wakeup source" is actually not descriptive. What do you want to say here?

Will change to be "USB phy may be a system wakeup source".

Quoted 6 lines
Quoted 2 lines

to keep its resource(e.g power domain) active to make usb remote

space before (
s/e.g/e.g./
s/usb/USB/

Okay.

Quoted 17 lines
Quoted 17 lines

wakeup work.

---
 Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +0 -0
index 2824c17285ee..7b71e32d1df0 100644
@@ -39,6 +39,11 @@ properties:
       the VBus line.
     $ref: /schemas/types.yaml#/definitions/phandle
 
Quoted 4 lines

Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml properties: · line 43

Quoted 2 lines
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +2 -0
+  wakeup-source:
+    $ref: /schemas/types.yaml#/definitions/flag

This shouldn't be needed, as it is a standard property.

Will remove.

Quoted 1 line
Quoted 8 lines
Quoted 4 lines

Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml properties: · line 45

Quoted 2 lines
Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +2 -0
+    description:
+      Specify if it's USB remote wakeup capable.

Now you have to explain in the bindings what is "USB remote wakeup".

"USB remote wakeup" is a standard concept in USB world/spec, change the description like "if the USB phy can detect the remote wakeup signal while the system sleep" make sense to you?

If it is a standard concept, keep it.

Best regards,
Krzysztof