This is a cache of https://discuss.96boards.org/t/rtc-ds-1374-wakealrm-mode/10892. It is a snapshot of the page at 2024-10-31T13:49:27.203+0000.
Rtc -ds 1374 wakealrm mode - 96Boards Forum

Rtc -ds 1374 wakealrm mode

Hello,

I hope you’re going well in this period.

I’m working on the driver rtc-ds-1374.c because in my embedded card, I got an RTC ds-1371 and the driver is compatible.

The problem I meet is with the alarm mode. In fact, I need alarm “wake up” to be enable but I have not got GPIO interrupt wired between rtc and CPU so as the driver need it to activate the alarm mode, I decided to modify the driver by activating it whithout interrupt specifier in devicetree.

Here is a link to reference driver rtc-ds-1374.c: rtc-ds1374.c - drivers/rtc/rtc-ds1374.c - Linux source code (v4.19.89) - Bootlin

These, are the new features I added:

1) Adding OSF bit info in sysfs: /sys/rtc/osf_status
2) enable alarm wake up without specifing interrupts in devicetree
--------------------------------
Exemple of devicetree:

ds1374:rtc@68 {
    compatible = "dallas,ds1374";
    wakeup-capable;
    reg = <0x68>;
};
--------------------------------

The problem is: With my modifications, I’m obliged to comment the lines:

//if (client->irq <= 0)
//    return -EINVAL;

in “ds1374_set_alarm” function. If I do that, the command hwclock return me the following error: “hwclock: select() to /dev/rtc0 to wait for clock tick timed out”. But if I don’t do that, the set alarm does not work, because when I try the command:

echo +20 > /sys/class/rtc/rtc0/wakealarm

System returns an error: “-sh: echo: write error: Invalid argument”

Do you know a method to get both working?

Thanks for all, and best reguards: Anthony.

problem is solved, you can see more detail on NXP site. Solved: RTC wakealarm mode without IRQ specification in de... - NXP Community