Linux Driver - RTC PCF85063A - Wakeup Problem

181 views Asked by At

I'm working in a kernel patch for my imx6ull's embedded Linux image. I'm using a PCF85063A in I2C1, but its wakeup interrupt doesn't work. INT pin is connected to SODIMM 106 and I can't figure out the reason why it's not working.

At boot I get:

[    8.487168] rtc-pcf85063 0-0051: registered as rtc0 
[    8.502610] rtc-pcf85063 0-0051: setting system clock to 2023-07-07T16:28:49 UTC (1688747329)
[  146.689736] [<1c6ab285>] irq_default_primary_handler threaded [<b6666757>] pcf85063_rtc_handle_irq

If I try to change /sys/power/state, I get:

[  266.251231] PM: suspend entry (deep)  
[  266.312442] Filesystems sync: 0.054 seconds
[  266.324553] Freezing user space processes
[  266.339858] Freezing user space processes completed (elapsed 0.010 seconds)
[  266.348429] OOM killer disabled.
[  266.351779] Freezing remaining freezable tasks
[  266.361847] Freezing remaining freezable tasks completed (elapsed 0.005 seconds)
[  266.369741] printk: Suspending console(s) (use no_console_suspend to debug)
[  266.494859] PM: suspend devices took 0.110 seconds
[  266.534029] Disabling non-boot CPUs ...
[  266.820497] PM: resume devices took 0.260 seconds
[  266.840124] OOM killer enabled.
[  266.843347] Restarting tasks ... done.
[  266.884987] random: crng reseeded on system resumption
[  266.912850] PM: suspend exit
-sh: echo: write error: Device or resource busy

Using rtcwake (rtcwake -u -s 60 -m mem), I get:

[  202.338932] PM: suspend entry (deep)                                         
[  202.376789] Filesystems sync: 0.032 seconds                                  
[  202.393022] systemd-journald[121]: Data hash table of /run/log/journal/1e231.
[  202.416581] Freezing user space processes                                    
[  202.447739] Freezing user space processes completed (elapsed 0.026 seconds)  
[  202.457459] OOM killer disabled.                                             
[  202.460937] Freezing remaining freezable tasks                               
[  202.471934] Freezing remaining freezable tasks completed (elapsed 0.006 seco)
[  202.479707] printk: Suspending console(s) (use no_console_suspend to debug)  
[  202.605185] PM: suspend devices took 0.110 seconds                           
[  202.643749] Disabling non-boot CPUs ...                                      
[  202.931423] PM: resume devices took 0.260 seconds                            
[  202.950730] OOM killer enabled.                                              
[  202.953949] Restarting tasks ...                                             
[  202.966793] systemd-journald[121]: /run/log/journal/1e2317323e804be59d671ac5.
[  202.995698] done.                                                            
[  202.998191] random: crng reseeded on system resumption                       
[  203.005129] PM: suspend exit                                                 
rtcwake: write error 

SODIMM 106 was allocated to touchscreen interrupt, but I've already change it.

Do you have a clue about what I'm doing wrong??

My updates in dt were:

&i2c1 {
    status = "okay";

    pcf85063: rtc@51 {
      compatible = "nxp,pcf85063a";
      reg = <0x51>;
      pinctrl-names = "default";
      pinctrl-0 = <&pinctrl_rtc_int>;
      interrupt-parent = <&gpio1>;
      interrupts = <10 IRQ_TYPE_EDGE_FALLING>; /* SODIMM 106*/
      quartz-load-femtofarads = <12500>;
      clock {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        clock-frequency = <32768>;
      };
    };
  };

&snvs_rtc {
    status = "disabled";
};
0

There are 0 answers