diff options
Diffstat (limited to 'drivers/acpi/sleep/proc.c')
-rw-r--r-- | drivers/acpi/sleep/proc.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c index 34962578039d..ccc11b33d89c 100644 --- a/drivers/acpi/sleep/proc.c +++ b/drivers/acpi/sleep/proc.c | |||
@@ -73,7 +73,7 @@ acpi_system_write_sleep(struct file *file, | |||
73 | static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) | 73 | static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) |
74 | { | 74 | { |
75 | u32 sec, min, hr; | 75 | u32 sec, min, hr; |
76 | u32 day, mo, yr; | 76 | u32 day, mo, yr, cent = 0; |
77 | unsigned char rtc_control = 0; | 77 | unsigned char rtc_control = 0; |
78 | unsigned long flags; | 78 | unsigned long flags; |
79 | 79 | ||
@@ -87,20 +87,19 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) | |||
87 | rtc_control = CMOS_READ(RTC_CONTROL); | 87 | rtc_control = CMOS_READ(RTC_CONTROL); |
88 | 88 | ||
89 | /* If we ever get an FACP with proper values... */ | 89 | /* If we ever get an FACP with proper values... */ |
90 | if (acpi_gbl_FADT->day_alrm) | 90 | if (acpi_gbl_FADT.day_alarm) |
91 | /* ACPI spec: only low 6 its should be cared */ | 91 | /* ACPI spec: only low 6 its should be cared */ |
92 | day = CMOS_READ(acpi_gbl_FADT->day_alrm) & 0x3F; | 92 | day = CMOS_READ(acpi_gbl_FADT.day_alarm) & 0x3F; |
93 | else | 93 | else |
94 | day = CMOS_READ(RTC_DAY_OF_MONTH); | 94 | day = CMOS_READ(RTC_DAY_OF_MONTH); |
95 | if (acpi_gbl_FADT->mon_alrm) | 95 | if (acpi_gbl_FADT.month_alarm) |
96 | mo = CMOS_READ(acpi_gbl_FADT->mon_alrm); | 96 | mo = CMOS_READ(acpi_gbl_FADT.month_alarm); |
97 | else | 97 | else |
98 | mo = CMOS_READ(RTC_MONTH); | 98 | mo = CMOS_READ(RTC_MONTH); |
99 | if (acpi_gbl_FADT->century) | 99 | if (acpi_gbl_FADT.century) |
100 | yr = CMOS_READ(acpi_gbl_FADT->century) * 100 + | 100 | cent = CMOS_READ(acpi_gbl_FADT.century); |
101 | CMOS_READ(RTC_YEAR); | 101 | |
102 | else | 102 | yr = CMOS_READ(RTC_YEAR); |
103 | yr = CMOS_READ(RTC_YEAR); | ||
104 | 103 | ||
105 | spin_unlock_irqrestore(&rtc_lock, flags); | 104 | spin_unlock_irqrestore(&rtc_lock, flags); |
106 | 105 | ||
@@ -111,10 +110,11 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) | |||
111 | BCD_TO_BIN(day); | 110 | BCD_TO_BIN(day); |
112 | BCD_TO_BIN(mo); | 111 | BCD_TO_BIN(mo); |
113 | BCD_TO_BIN(yr); | 112 | BCD_TO_BIN(yr); |
113 | BCD_TO_BIN(cent); | ||
114 | } | 114 | } |
115 | 115 | ||
116 | /* we're trusting the FADT (see above) */ | 116 | /* we're trusting the FADT (see above) */ |
117 | if (!acpi_gbl_FADT->century) | 117 | if (!acpi_gbl_FADT.century) |
118 | /* If we're not trusting the FADT, we should at least make it | 118 | /* If we're not trusting the FADT, we should at least make it |
119 | * right for _this_ century... ehm, what is _this_ century? | 119 | * right for _this_ century... ehm, what is _this_ century? |
120 | * | 120 | * |
@@ -134,6 +134,8 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) | |||
134 | * | 134 | * |
135 | */ | 135 | */ |
136 | yr += 2000; | 136 | yr += 2000; |
137 | else | ||
138 | yr += cent * 100; | ||
137 | 139 | ||
138 | seq_printf(seq, "%4.4u-", yr); | 140 | seq_printf(seq, "%4.4u-", yr); |
139 | (mo > 12) ? seq_puts(seq, "**-") : seq_printf(seq, "%2.2u-", mo); | 141 | (mo > 12) ? seq_puts(seq, "**-") : seq_printf(seq, "%2.2u-", mo); |
@@ -317,12 +319,12 @@ acpi_system_write_alarm(struct file *file, | |||
317 | * offsets into the CMOS RAM here -- which for some reason are pointing | 319 | * offsets into the CMOS RAM here -- which for some reason are pointing |
318 | * to the RTC area of memory. | 320 | * to the RTC area of memory. |
319 | */ | 321 | */ |
320 | if (acpi_gbl_FADT->day_alrm) | 322 | if (acpi_gbl_FADT.day_alarm) |
321 | CMOS_WRITE(day, acpi_gbl_FADT->day_alrm); | 323 | CMOS_WRITE(day, acpi_gbl_FADT.day_alarm); |
322 | if (acpi_gbl_FADT->mon_alrm) | 324 | if (acpi_gbl_FADT.month_alarm) |
323 | CMOS_WRITE(mo, acpi_gbl_FADT->mon_alrm); | 325 | CMOS_WRITE(mo, acpi_gbl_FADT.month_alarm); |
324 | if (acpi_gbl_FADT->century) | 326 | if (acpi_gbl_FADT.century) |
325 | CMOS_WRITE(yr / 100, acpi_gbl_FADT->century); | 327 | CMOS_WRITE(yr / 100, acpi_gbl_FADT.century); |
326 | /* enable the rtc alarm interrupt */ | 328 | /* enable the rtc alarm interrupt */ |
327 | rtc_control |= RTC_AIE; | 329 | rtc_control |= RTC_AIE; |
328 | CMOS_WRITE(rtc_control, RTC_CONTROL); | 330 | CMOS_WRITE(rtc_control, RTC_CONTROL); |