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

Configure Feed

Select the types of activity you want to include in your feed.

clocksource/drivers/rda: Add sched_clock_register for RDA8810PL SoC

The current system log timestamp accuracy is tick based, which can not
meet the usage requirements and needs to reach nanoseconds.
Therefore, the sched_clock_register function needs to be added.

[ dlezcano: Fixed typos ]

Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/20251107063347.3692-1-enlin.mu@linux.dev

authored by

Enlin Mu and committed by
Daniel Lezcano
627f3f37 6a241689

+8 -1
+8 -1
drivers/clocksource/timer-rda.c
··· 13 13 14 14 #include <linux/init.h> 15 15 #include <linux/interrupt.h> 16 + #include <linux/sched_clock.h> 16 17 17 18 #include "timer-of.h" 18 19 ··· 154 153 }, 155 154 }; 156 155 157 - static u64 rda_hwtimer_read(struct clocksource *cs) 156 + static u64 rda_hwtimer_clocksource_read(void) 158 157 { 159 158 void __iomem *base = timer_of_base(&rda_ostimer_of); 160 159 u32 lo, hi; ··· 166 165 } while (hi != readl_relaxed(base + RDA_HWTIMER_LOCKVAL_H)); 167 166 168 167 return ((u64)hi << 32) | lo; 168 + } 169 + 170 + static u64 rda_hwtimer_read(struct clocksource *cs) 171 + { 172 + return rda_hwtimer_clocksource_read(); 169 173 } 170 174 171 175 static struct clocksource rda_hwtimer_clocksource = { ··· 191 185 return ret; 192 186 193 187 clocksource_register_hz(&rda_hwtimer_clocksource, rate); 188 + sched_clock_register(rda_hwtimer_clocksource_read, 64, rate); 194 189 195 190 clockevents_config_and_register(&rda_ostimer_of.clkevt, rate, 196 191 0x2, UINT_MAX);