aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.daniel@samsung.com>2014-01-17 20:25:12 +0800
committerGraeme Gregory <graeme.gregory@linaro.org>2014-06-03 09:24:11 +0100
commit67ec04002a5ba46502b66bee7ce50fb656330b23 (patch)
tree55e4b9ae89461e4f888f263544c9c80ab68802ec
parentaf1a87558f1be03360e77ba148bb84399847e3d1 (diff)
downloadleg-kernel-67ec04002a5ba46502b66bee7ce50fb656330b23.tar.gz
clocksource / acpi: Add macro CLOCKSOURCE_ACPI_DECLARE
This macro does the same job as CLOCKSOURCE_OF_DECLARE. The device name from the ACPI timer table is matched with all the registered timer controllers and matching initialisation routine is invoked. Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
-rw-r--r--include/asm-generic/vmlinux.lds.h10
-rw-r--r--include/linux/clocksource.h12
2 files changed, 22 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 146e4fffd710..4014408c6d8f 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -148,6 +148,15 @@
#define CLKSRC_OF_TABLES()
#endif
+#ifdef CONFIG_ACPI
+#define CLKSRC_ACPI_TABLES() . = ALIGN(8); \
+ VMLINUX_SYMBOL(__clksrc_acpi_table) = .; \
+ *(__clksrc_acpi_table) \
+ *(__clksrc_acpi_table_end)
+#else
+#define CLKSRC_ACPI_TABLES()
+#endif
+
#ifdef CONFIG_IRQCHIP
#define IRQCHIP_OF_MATCH_TABLE() \
. = ALIGN(8); \
@@ -511,6 +520,7 @@
CLK_OF_TABLES() \
RESERVEDMEM_OF_TABLES() \
CLKSRC_OF_TABLES() \
+ CLKSRC_ACPI_TABLES() \
CPU_METHOD_OF_TABLES() \
KERNEL_DTB() \
IRQCHIP_OF_MATCH_TABLE()
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 67301a405712..1d500cf76a9f 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -341,6 +341,8 @@ extern int clocksource_i8253_init(void);
struct device_node;
typedef void(*clocksource_of_init_fn)(struct device_node *);
+typedef void(*clocksource_acpi_init_fn)(void);
+
#ifdef CONFIG_CLKSRC_OF
extern void clocksource_of_init(void);
@@ -358,4 +360,14 @@ static inline void clocksource_of_init(void) {}
.data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn }
#endif
+#ifdef CONFIG_ACPI
+#define CLOCKSOURCE_ACPI_DECLARE(name, compat, fn) \
+ static const struct acpi_device_id __clksrc_acpi_table_##name \
+ __used __section(__clksrc_acpi_table) \
+ = { .id = compat, \
+ .driver_data = (kernel_ulong_t)fn }
+#else
+#define CLOCKSOURCE_ACPI_DECLARE(name, compat, fn)
+#endif
+
#endif /* _LINUX_CLOCKSOURCE_H */