Skip to contentSkip to conversation

Correct gpio-ir-recv wakeup capability

PATCH In review Florian Fainelli 3 participants 6 messages Mar 24, 2023 – Apr 4, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Correct gpio-ir-recv wakeup capability

This small patch series fixes the gpio-ir-recv binding and driver to first indicate that it can be a wake-up source for the system, and second actually make that happen.

Changes in v2:
- corrected the indentation of the description for "wakeup-source"

Florian Fainelli (2):
dt-bindings: media: gpio-ir-receiver: Document wakeup-souce property
media: rc: gpio-ir-recv: Fix support for wake-up

 Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml | 3 +++
 drivers/media/rc/gpio-ir-recv.c                               | 2 ++
 2 files changed, 5 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/2 dt-bindings: media: gpio-ir-receiver: Document wakeup-souce property

The GPIO IR receiver can be used as a wake-up source for the system, document that.

---
 Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml +3 -0
index 61072745b983..008c007ed702 100644
@@ -23,6 +23,9 @@ properties:
     description: autosuspend delay time in milliseconds
     $ref: /schemas/types.yaml#/definitions/uint32
 
+  wakeup-source:
+    description: IR receiver can wake-up the system.
+
 required:
   - compatible
   - gpios
Signature · 1 line
2.34.1
Acked-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: media: gpio-ir-receiver: Document wakeup-souce property

Quoted 7 lines · Florian Fainelli

The GPIO IR receiver can be used as a wake-up source for the system, document that.

---
 Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml | 3 +++
 1 file changed, 3 insertions(+)

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/2 media: rc: gpio-ir-recv: Fix support for wake-up

In reply to Florian Fainelli

The driver was intended from the start to be a wake-up source for the system, however due to the absence of a suitable call to device_set_wakeup_capable(), the device_may_wakeup() call used to decide whether to enable the GPIO interrupt as a wake-up source would never happen. Lookup the DT standard "wakeup-source" property and call device_init_wakeup() to ensure the device is flagged as being wakeup capable.

Fixes fd0f6851eb46 ("[media] rc: Add support for GPIO based IR Receiver driver")
---
 drivers/media/rc/gpio-ir-recv.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/rc/gpio-ir-recv.c +2 -0
index 8dbe780dae4e..41ef8cdba28c 100644
@@ -103,6 +103,8 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
 		rcdev->map_name = RC_MAP_EMPTY;
 
 	gpio_dev->rcdev = rcdev;
+	if (of_property_read_bool(np, "wakeup-source"))
+		device_init_wakeup(dev, true);
 
 	rc = devm_rc_register_device(dev, rcdev);
 	if (rc < 0) {
Signature · 1 line
2.34.1
#4 lore raw
In reply to Florian Fainelli
Quoted 10 lines · Florian Fainelli

This small patch series fixes the gpio-ir-recv binding and driver to first indicate that it can be a wake-up source for the system, and second actually make that happen.

Changes in v2:
- corrected the indentation of the description for "wakeup-source"

Florian Fainelli (2):
dt-bindings: media: gpio-ir-receiver: Document wakeup-souce property
media: rc: gpio-ir-recv: Fix support for wake-up

Ping? Someone maintaining this driver?

Signature · 1 line
Florian
maintainer
#5 lore raw
Quoted 5 lines · Florian Fainelli
Quoted 4 lines · Florian Fainelli

This small patch series fixes the gpio-ir-recv binding and driver to first indicate that it can be a wake-up source for the system, and second actually make that happen.

Quoted 8 lines
Quoted 6 lines

Changes in v2:
- corrected the indentation of the description for "wakeup-source"

Florian Fainelli (2):
dt-bindings: media: gpio-ir-receiver: Document wakeup-souce property
media: rc: gpio-ir-recv: Fix support for wake-up

Ping? Someone maintaining this driver?

That's me :) Applied, thanks for the reminder.

Sean