aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/sleep')
-rw-r--r--drivers/acpi/sleep/main.c5
-rw-r--r--drivers/acpi/sleep/proc.c11
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index af7f4663deaa..0489a7d1d42c 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -32,9 +32,8 @@ static int acpi_sleep_prepare(u32 acpi_state)
32 if (!acpi_wakeup_address) { 32 if (!acpi_wakeup_address) {
33 return -EFAULT; 33 return -EFAULT;
34 } 34 }
35 acpi_set_firmware_waking_vector((acpi_physical_address) 35 acpi_set_firmware_waking_vector(
36 virt_to_phys((void *) 36 (acpi_physical_address)acpi_wakeup_address);
37 acpi_wakeup_address));
38 37
39 } 38 }
40 ACPI_FLUSH_CPU_CACHE(); 39 ACPI_FLUSH_CPU_CACHE();
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
index 8a5fe8710513..4ebbba2b6b19 100644
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -315,8 +315,11 @@ acpi_system_write_alarm(struct file *file,
315 cmos_bcd_write(day, acpi_gbl_FADT.day_alarm, rtc_control); 315 cmos_bcd_write(day, acpi_gbl_FADT.day_alarm, rtc_control);
316 if (acpi_gbl_FADT.month_alarm) 316 if (acpi_gbl_FADT.month_alarm)
317 cmos_bcd_write(mo, acpi_gbl_FADT.month_alarm, rtc_control); 317 cmos_bcd_write(mo, acpi_gbl_FADT.month_alarm, rtc_control);
318 if (acpi_gbl_FADT.century) 318 if (acpi_gbl_FADT.century) {
319 if (adjust)
320 yr += cmos_bcd_read(acpi_gbl_FADT.century, rtc_control) * 100;
319 cmos_bcd_write(yr / 100, acpi_gbl_FADT.century, rtc_control); 321 cmos_bcd_write(yr / 100, acpi_gbl_FADT.century, rtc_control);
322 }
320 /* enable the rtc alarm interrupt */ 323 /* enable the rtc alarm interrupt */
321 rtc_control |= RTC_AIE; 324 rtc_control |= RTC_AIE;
322 CMOS_WRITE(rtc_control, RTC_CONTROL); 325 CMOS_WRITE(rtc_control, RTC_CONTROL);
@@ -495,6 +498,12 @@ static int __init acpi_sleep_proc_init(void)
495 acpi_root_dir, &acpi_system_alarm_fops); 498 acpi_root_dir, &acpi_system_alarm_fops);
496 499
497 acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); 500 acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL);
501 /*
502 * Disable the RTC event after installing RTC handler.
503 * Only when RTC alarm is set will it be enabled.
504 */
505 acpi_clear_event(ACPI_EVENT_RTC);
506 acpi_disable_event(ACPI_EVENT_RTC, 0);
498#endif /* HAVE_ACPI_LEGACY_ALARM */ 507#endif /* HAVE_ACPI_LEGACY_ALARM */
499 508
500 /* 'wakeup device' [R/W] */ 509 /* 'wakeup device' [R/W] */