Commit c625f76a authored by Marc Zyngier's avatar Marc Zyngier Committed by Rafael J. Wysocki

clocksource / ACPI: Add probing infrastructure for ACPI-based clocksources

DT enjoys a rather nice probing infrastructure for clocksources,
while ACPI is so far stuck into a very distant past.

This patch introduces a declarative API, allowing clocksources
to be self-contained and be called when parsing the GTDT table.
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent f26527b1
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <linux/acpi.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
...@@ -38,6 +39,9 @@ void __init clocksource_of_init(void) ...@@ -38,6 +39,9 @@ void __init clocksource_of_init(void)
init_func(np); init_func(np);
clocksources++; clocksources++;
} }
clocksources += acpi_probe_device_table(clksrc);
if (!clocksources) if (!clocksources)
pr_crit("%s: no matching clocksources found\n", __func__); pr_crit("%s: no matching clocksources found\n", __func__);
} }
...@@ -525,6 +525,7 @@ ...@@ -525,6 +525,7 @@
KERNEL_DTB() \ KERNEL_DTB() \
IRQCHIP_OF_MATCH_TABLE() \ IRQCHIP_OF_MATCH_TABLE() \
ACPI_PROBE_TABLE(irqchip) \ ACPI_PROBE_TABLE(irqchip) \
ACPI_PROBE_TABLE(clksrc) \
EARLYCON_TABLE() \ EARLYCON_TABLE() \
EARLYCON_OF_TABLES() EARLYCON_OF_TABLES()
......
...@@ -258,4 +258,7 @@ void acpi_generic_timer_init(void); ...@@ -258,4 +258,7 @@ void acpi_generic_timer_init(void);
static inline void acpi_generic_timer_init(void) { } static inline void acpi_generic_timer_init(void) { }
#endif #endif
#define CLOCKSOURCE_ACPI_DECLARE(name, table_id, fn) \
ACPI_DECLARE_PROBE_ENTRY(clksrc, name, table_id, 0, NULL, 0, fn)
#endif /* _LINUX_CLOCKSOURCE_H */ #endif /* _LINUX_CLOCKSOURCE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment