mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-31 16:38:12 +00:00
177cf6e52b
All the clocksource drivers's init function are now converted to return an error code. CLOCKSOURCE_OF_DECLARE is no longer used as well as the clksrc-of table. Let's convert back the names: - CLOCKSOURCE_OF_DECLARE_RET => CLOCKSOURCE_OF_DECLARE - clksrc-of-ret => clksrc-of Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> For exynos_mct and samsung_pwm_timer: Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> For arch/arc: Acked-by: Vineet Gupta <vgupta@synopsys.com> For mediatek driver: Acked-by: Matthias Brugger <matthias.bgg@gmail.com> For the Rockchip-part Acked-by: Heiko Stuebner <heiko@sntech.de> For STi : Acked-by: Patrice Chotard <patrice.chotard@st.com> For the mps2-timer.c and versatile.c changes: Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> For the OXNAS part : Acked-by: Neil Armstrong <narmstrong@baylibre.com> For LPC32xx driver: Acked-by: Sylvain Lemieux <slemieux.tyco@gmail.com> For Broadcom Kona timer change: Acked-by: Ray Jui <ray.jui@broadcom.com> For Sun4i and Sun5i: Acked-by: Chen-Yu Tsai <wens@csie.org> For Meson6: Acked-by: Carlo Caione <carlo@caione.org> For Keystone: Acked-by: Santosh Shilimkar <ssantosh@kernel.org> For NPS: Acked-by: Noam Camus <noamca@mellanox.com> For bcm2835: Acked-by: Eric Anholt <eric@anholt.net>
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
/*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* Copyright (C) 2014 ARM Limited
|
|
*/
|
|
|
|
#include <linux/clocksource.h>
|
|
#include <linux/io.h>
|
|
#include <linux/of_address.h>
|
|
#include <linux/sched_clock.h>
|
|
|
|
#define SYS_24MHZ 0x05c
|
|
|
|
static void __iomem *versatile_sys_24mhz;
|
|
|
|
static u64 notrace versatile_sys_24mhz_read(void)
|
|
{
|
|
return readl(versatile_sys_24mhz);
|
|
}
|
|
|
|
static int __init versatile_sched_clock_init(struct device_node *node)
|
|
{
|
|
void __iomem *base = of_iomap(node, 0);
|
|
|
|
if (!base)
|
|
return -ENXIO;
|
|
|
|
versatile_sys_24mhz = base + SYS_24MHZ;
|
|
|
|
sched_clock_register(versatile_sys_24mhz_read, 32, 24000000);
|
|
|
|
return 0;
|
|
}
|
|
CLOCKSOURCE_OF_DECLARE(vexpress, "arm,vexpress-sysreg",
|
|
versatile_sched_clock_init);
|
|
CLOCKSOURCE_OF_DECLARE(versatile, "arm,versatile-sysreg",
|
|
versatile_sched_clock_init);
|