drm/panel-edp: Add STA 116QHD024002
[drm/drm-misc.git] / include / linux / acpi_pmtmr.h
blob0ded9220d379c0e6f57243470ff7131baa961c63
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ACPI_PMTMR_H_
3 #define _ACPI_PMTMR_H_
5 #include <linux/clocksource.h>
7 /* Number of PMTMR ticks expected during calibration run */
8 #define PMTMR_TICKS_PER_SEC 3579545
10 /* limit it to 24 bits */
11 #define ACPI_PM_MASK CLOCKSOURCE_MASK(24)
13 /* Overrun value */
14 #define ACPI_PM_OVRRUN (1<<24)
16 #ifdef CONFIG_X86_PM_TIMER
18 extern u32 acpi_pm_read_verified(void);
19 extern u32 pmtmr_ioport;
21 static inline u32 acpi_pm_read_early(void)
23 if (!pmtmr_ioport)
24 return 0;
25 /* mask the output to 24 bits */
26 return acpi_pm_read_verified() & ACPI_PM_MASK;
29 /**
30 * Register callback for suspend and resume event
32 * @cb Callback triggered on suspend and resume
33 * @data Data passed with the callback
35 void acpi_pmtmr_register_suspend_resume_callback(void (*cb)(void *data, bool suspend), void *data);
37 /**
38 * Remove registered callback for suspend and resume event
40 void acpi_pmtmr_unregister_suspend_resume_callback(void);
42 #else
44 static inline u32 acpi_pm_read_early(void)
46 return 0;
49 #endif
51 #endif