Thomas Gleixner | d66bea5 | 2007-02-16 01:27:57 -0800 | [diff] [blame] | 1 | #ifndef _ACPI_PMTMR_H_ |
| 2 | #define _ACPI_PMTMR_H_ |
| 3 | |
| 4 | #include <linux/clocksource.h> |
| 5 | |
| 6 | /* Number of PMTMR ticks expected during calibration run */ |
| 7 | #define PMTMR_TICKS_PER_SEC 3579545 |
| 8 | |
| 9 | /* limit it to 24 bits */ |
| 10 | #define ACPI_PM_MASK CLOCKSOURCE_MASK(24) |
| 11 | |
| 12 | /* Overrun value */ |
| 13 | #define ACPI_PM_OVRRUN (1<<24) |
| 14 | |
| 15 | #ifdef CONFIG_X86_PM_TIMER |
| 16 | |
| 17 | extern u32 acpi_pm_read_verified(void); |
| 18 | extern u32 pmtmr_ioport; |
| 19 | |
| 20 | static inline u32 acpi_pm_read_early(void) |
| 21 | { |
| 22 | if (!pmtmr_ioport) |
| 23 | return 0; |
| 24 | /* mask the output to 24 bits */ |
| 25 | return acpi_pm_read_verified() & ACPI_PM_MASK; |
| 26 | } |
| 27 | |
Thomas Gleixner | 70a2002 | 2008-01-30 13:30:18 +0100 | [diff] [blame^] | 28 | extern void pmtimer_wait(unsigned); |
| 29 | |
Thomas Gleixner | d66bea5 | 2007-02-16 01:27:57 -0800 | [diff] [blame] | 30 | #else |
| 31 | |
| 32 | static inline u32 acpi_pm_read_early(void) |
| 33 | { |
| 34 | return 0; |
| 35 | } |
| 36 | |
| 37 | #endif |
| 38 | |
| 39 | #endif |
| 40 | |