Lines 316-321
acpi_system_write_alarm (
Link Here
|
316 |
} |
316 |
} |
317 |
|
317 |
|
318 |
spin_lock_irq(&rtc_lock); |
318 |
spin_lock_irq(&rtc_lock); |
|
|
319 |
/* |
320 |
* Disable alarm interrupt before set alsrm timer |
321 |
* or else when enable ACPI_EVENT_RTC, a suprious ACPI interrupt occured |
322 |
*/ |
323 |
rtc_control &= ~RTC_AIE; |
324 |
CMOS_WRITE(rtc_control, RTC_CONTROL); |
325 |
CMOS_READ(RTC_INTR_FLAGS); |
319 |
|
326 |
|
320 |
/* write the fields the rtc knows about */ |
327 |
/* write the fields the rtc knows about */ |
321 |
CMOS_WRITE(hr, RTC_HOURS_ALARM); |
328 |
CMOS_WRITE(hr, RTC_HOURS_ALARM); |
Lines 336-350
acpi_system_write_alarm (
Link Here
|
336 |
CMOS_WRITE(yr/100, acpi_gbl_FADT->century); |
343 |
CMOS_WRITE(yr/100, acpi_gbl_FADT->century); |
337 |
#endif |
344 |
#endif |
338 |
/* enable the rtc alarm interrupt */ |
345 |
/* enable the rtc alarm interrupt */ |
339 |
if (!(rtc_control & RTC_AIE)) { |
346 |
rtc_control |= RTC_AIE; |
340 |
rtc_control |= RTC_AIE; |
347 |
CMOS_WRITE(rtc_control, RTC_CONTROL); |
341 |
CMOS_WRITE(rtc_control,RTC_CONTROL); |
348 |
CMOS_READ(RTC_INTR_FLAGS); |
342 |
CMOS_READ(RTC_INTR_FLAGS); |
|
|
343 |
} |
344 |
|
349 |
|
345 |
spin_unlock_irq(&rtc_lock); |
350 |
spin_unlock_irq(&rtc_lock); |
346 |
|
351 |
|
347 |
acpi_set_register(ACPI_BITREG_RT_CLOCK_ENABLE, 1, ACPI_MTX_LOCK); |
352 |
acpi_clear_event(ACPI_EVENT_RTC); |
|
|
353 |
acpi_enable_event(ACPI_EVENT_RTC, 0); |
348 |
|
354 |
|
349 |
*ppos += count; |
355 |
*ppos += count; |
350 |
|
356 |
|
Lines 449-454
static struct file_operations acpi_syste
Link Here
|
449 |
}; |
455 |
}; |
450 |
|
456 |
|
451 |
|
457 |
|
|
|
458 |
static u32 rtc_handler(void * context) |
459 |
{ |
460 |
acpi_clear_event(ACPI_EVENT_RTC); |
461 |
acpi_disable_event(ACPI_EVENT_RTC, 0); |
462 |
|
463 |
return ACPI_INTERRUPT_HANDLED; |
464 |
} |
465 |
|
452 |
static int acpi_sleep_proc_init(void) |
466 |
static int acpi_sleep_proc_init(void) |
453 |
{ |
467 |
{ |
454 |
struct proc_dir_entry *entry = NULL; |
468 |
struct proc_dir_entry *entry = NULL; |
Lines 474-479
static int acpi_sleep_proc_init(void)
Link Here
|
474 |
if (entry) |
488 |
if (entry) |
475 |
entry->proc_fops = &acpi_system_wakeup_device_fops; |
489 |
entry->proc_fops = &acpi_system_wakeup_device_fops; |
476 |
|
490 |
|
|
|
491 |
acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); |
477 |
return 0; |
492 |
return 0; |
478 |
} |
493 |
} |
479 |
|
494 |
|