Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5039

Troubleshooting • rtcwake not working: /sys/class/rtc/rtc0/device/power/wakeup: No such file or directory

$
0
0
Hey,
We have a custom extension Hat that has an epson RX8130CE as an RTC. RTC alarm interrupts works fine, the standard RTC driver test passes
```
gssuser@er-edge-6b773b05:~ $ sudo rtctest

RTC Driver Test Example.

Counting 5 update (1/sec) interrupts from reading /dev/rtc0: 1 2 3 4 5
Again, from using select(2) on /dev/rtc: 1 2 3 4 5

Current RTC date/time is 29-7-2024, 09:32:07.
Alarm time now set to 09:32:12.
Waiting 5 seconds for alarm... okay. Alarm rang.

Periodic IRQ rate is 1Hz.
Counting 20 interrupts at:
2Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
4Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
16Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
32Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
64Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

*** Test complete ***
```
In the epson driver we register the RTC as a wakeup source:

```
// setup as wakeup-source if specified in device tree boolean property
if (device_property_read_bool(&client->dev, "wakeup-source")) {
dev_info(&client->dev, "setting device as wakeup capable\n");
device_set_wakeup_capable(&client->dev, true);
}
```
dmesg:
```
Jul 29 01:56:10 er-edge-6b773b05 kernel: [ 10.266475] rtc-rx8130 1-0032: setting device as wakeup capable
```

We also have an MCU on board, that while the PI is in halt mode, watches for RTC interrupts, and can wake-from-halt the PI, when there is an RTC IRQ, while the PI is in halt.

We can workaround the problem by setting an alarm in /sys/class/rtc/rtc0/device/rtc/rtc0/wakealarm then issue a halt or poweroff, but ideally we'd like to use the standard rtcwake utility.

Can someone please advise why there isn't a /sys/class/rtc/rtc0/device/power/wakeup generated even though in the driver initialization we set the RTC as device_set_wakeup_capable ?

Thanks & BR

Ferenc

Statistics: Posted by ferenj — Mon Jul 29, 2024 9:36 am



Viewing all articles
Browse latest Browse all 5039

Trending Articles