Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource: sti: Provide 'use timer as sched clock' capability

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

Lee Jones ff45d8dd 70bef01c

+8
+8
drivers/clocksource/clksrc_st_lpc.c
··· 16 16 #include <linux/clocksource.h> 17 17 #include <linux/init.h> 18 18 #include <linux/of_address.h> 19 + #include <linux/sched_clock.h> 19 20 #include <linux/slab.h> 20 21 21 22 #include <dt-bindings/mfd/st-lpc.h> ··· 39 38 writel_relaxed(1, ddata.base + LPC_LPT_START_OFF); 40 39 } 41 40 41 + static u64 notrace st_clksrc_sched_clock_read(void) 42 + { 43 + return (u64)readl_relaxed(ddata.base + LPC_LPT_LSB_OFF); 44 + } 45 + 42 46 static int __init st_clksrc_init(void) 43 47 { 44 48 unsigned long rate; ··· 52 46 st_clksrc_reset(); 53 47 54 48 rate = clk_get_rate(ddata.clk); 49 + 50 + sched_clock_register(st_clksrc_sched_clock_read, 32, rate); 55 51 56 52 ret = clocksource_mmio_init(ddata.base + LPC_LPT_LSB_OFF, 57 53 "clksrc-st-lpc", rate, 300, 32,