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

clocksource: Add clocksource id for arm arch counter

Add clocksource id to the ARM generic counter so that it can be easily
identified from callers such as ptp_kvm.

Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201209060932.212364-6-jianyong.wu@arm.com

authored by

Jianyong Wu and committed by
Marc Zyngier
100148d0 b2c67cbe

+3
+2
drivers/clocksource/arm_arch_timer.c
··· 16 16 #include <linux/cpu_pm.h> 17 17 #include <linux/clockchips.h> 18 18 #include <linux/clocksource.h> 19 + #include <linux/clocksource_ids.h> 19 20 #include <linux/interrupt.h> 20 21 #include <linux/of_irq.h> 21 22 #include <linux/of_address.h> ··· 192 191 193 192 static struct clocksource clocksource_counter = { 194 193 .name = "arch_sys_counter", 194 + .id = CSID_ARM_ARCH_COUNTER, 195 195 .rating = 400, 196 196 .read = arch_counter_read, 197 197 .mask = CLOCKSOURCE_MASK(56),
+1
include/linux/clocksource_ids.h
··· 5 5 /* Enum to give clocksources a unique identifier */ 6 6 enum clocksource_ids { 7 7 CSID_GENERIC = 0, 8 + CSID_ARM_ARCH_COUNTER, 8 9 CSID_MAX, 9 10 }; 10 11