All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: implement acpi_os_get_timer() according the spec
@ 2013-05-13 10:27 Mika Westerberg
  2013-05-13 11:38 ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Mika Westerberg @ 2013-05-13 10:27 UTC (permalink / raw)
  To: linux-acpi; +Cc: Rafael J. Wysocki, Len Brown, Mika Westerberg, linux-kernel

ACPI Timer() opcode should return monotonically increasing clock with 100ns
granularity. Implement this with the help of ktime_get().

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/acpi/osl.c |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 586e7e9..2a22170 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -835,19 +835,7 @@ void acpi_os_stall(u32 us)
  */
 u64 acpi_os_get_timer(void)
 {
-	static u64 t;
-
-#ifdef	CONFIG_HPET
-	/* TBD: use HPET if available */
-#endif
-
-#ifdef	CONFIG_X86_PM_TIMER
-	/* TBD: default to PM timer if HPET was not available */
-#endif
-	if (!t)
-		printk(KERN_ERR PREFIX "acpi_os_get_timer() TBD\n");
-
-	return ++t;
+	return ktime_to_ns(ktime_get()) / 100;
 }
 
 acpi_status acpi_os_read_port(acpi_io_address port, u32 * value, u32 width)
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-05-23  7:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 10:27 [PATCH] ACPI: implement acpi_os_get_timer() according the spec Mika Westerberg
2013-05-13 11:38 ` Rafael J. Wysocki
2013-05-13 11:44   ` Mika Westerberg
2013-05-20 10:25     ` Mika Westerberg
2013-05-20 11:07       ` Rafael J. Wysocki
2013-05-20 11:28         ` [PATCH v2] " Mika Westerberg
2013-05-23  7:27           ` [PATCH v3] " Mika Westerberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.