1. 18 May, 2018 1 commit
    • Alexandre Belloni's avatar
      rtc: ls1x: add range · d7599245
      Alexandre Belloni authored
      While the year is encoded on 32 bits in SYS_TOYWRITE1i/SYS_TOYREAD1. The
      Loongson 1c datasheet states that the range is from 0 to 99.
      
      The current code exceeds this range and seems to be working, I deduce that
      the leap year algorithm will fail in 2100.
      
      Anyway, alarm registers only encode the year on 14 bits so with alarm
      support, the range will always be limited to 0 to 16383.
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      d7599245
  2. 17 May, 2018 24 commits
  3. 16 May, 2018 1 commit
  4. 14 May, 2018 1 commit
  5. 06 May, 2018 4 commits
  6. 03 May, 2018 7 commits
  7. 19 Apr, 2018 2 commits
    • Zhang Rui's avatar
      rtc: cmos: introduce quirks to enable use_acpi_alarm mode · 36d91a4d
      Zhang Rui authored
      Use ACPI for RTC Alarm only for Intel platforms
      1. with Low Power S0 support
      2. with HPET RTC emulation enabled
      3. no earlier than 2015
      
      Note that, during the test, it is found that this patch
      1. works in 4.15-rc kernel
      2. hangs the platform after suspend-to-idle for 2 or 3 times, in 4.15.0
      3. works again in 4.16-rc3 kernel.
      4. works in the latest 4.15.12 stable kernel.
      
      Thus although this patch breaks 4.15.0 kernel for some unknown reason,
      still, it is safe for both upstream and backport.
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      36d91a4d
    • Zhang Rui's avatar
      rtc: cmos: acknowledge ACPI driven wake alarms upon resume · c6d3a278
      Zhang Rui authored
      Previously, the RTC alarm is acknowledged either by the cmos rtc irq
      handler, or by the hpet rtc irq handler.
      
      When using ACPI RTC Fixed event as the RTC alarm, the RTC alarm is
      acknowledged by the ACPI RTC event handler, as addressed in the previous
      patch.
      But, when resume from suspend-to-ram (ACPI S3), the ACPI SCI is cleared
      right after resume, thus the ACPI RTC event handler is not invoked at all,
      results in the RTC Alarm unacknowledged.
      
      Handle this by comparing the current time and the RTC Alarm time in the
      rtc_cmos driver .resume() callback
      1. Assume the wakeup event has already been fired if the RTC Alarm time
         is earlier than/equal to the current time, and ACK the RTC Alarm.
      2. Assume the wakeup event has not been fired if the RTC Alarm time
         is later than current time, and re-arm it if needed.
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      c6d3a278