diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-08-23 09:29:43 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-09-08 05:10:56 -0400 |
commit | 65516f8a7c2028381f0dae4c16ddb621c96158cc (patch) | |
tree | 1f6192832c77e25499331b074398e165c1220197 /include | |
parent | d1748302f70be7469809809283fe164156a34231 (diff) |
clockevents: Add direct ktime programming function
There is at least one architecture (s390) with a sane clockevent device
that can be programmed with the equivalent of a ktime. No need to create
a delta against the current time, the ktime can be used directly.
A new clock device function 'set_next_ktime' is introduced that is called
with the unmodified ktime for the timer if the clock event device has the
CLOCK_EVT_FEAT_KTIME bit set.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: john stultz <johnstul@us.ibm.com>
Link: http://lkml.kernel.org/r/20110823133142.815350967@de.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/clockchips.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 39bb050bdbb2..81e803e90aa4 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -45,20 +45,22 @@ enum clock_event_nofitiers { | |||
45 | */ | 45 | */ |
46 | #define CLOCK_EVT_FEAT_PERIODIC 0x000001 | 46 | #define CLOCK_EVT_FEAT_PERIODIC 0x000001 |
47 | #define CLOCK_EVT_FEAT_ONESHOT 0x000002 | 47 | #define CLOCK_EVT_FEAT_ONESHOT 0x000002 |
48 | #define CLOCK_EVT_FEAT_KTIME 0x000004 | ||
48 | /* | 49 | /* |
49 | * x86(64) specific misfeatures: | 50 | * x86(64) specific misfeatures: |
50 | * | 51 | * |
51 | * - Clockevent source stops in C3 State and needs broadcast support. | 52 | * - Clockevent source stops in C3 State and needs broadcast support. |
52 | * - Local APIC timer is used as a dummy device. | 53 | * - Local APIC timer is used as a dummy device. |
53 | */ | 54 | */ |
54 | #define CLOCK_EVT_FEAT_C3STOP 0x000004 | 55 | #define CLOCK_EVT_FEAT_C3STOP 0x000008 |
55 | #define CLOCK_EVT_FEAT_DUMMY 0x000008 | 56 | #define CLOCK_EVT_FEAT_DUMMY 0x000010 |
56 | 57 | ||
57 | /** | 58 | /** |
58 | * struct clock_event_device - clock event device descriptor | 59 | * struct clock_event_device - clock event device descriptor |
59 | * @event_handler: Assigned by the framework to be called by the low | 60 | * @event_handler: Assigned by the framework to be called by the low |
60 | * level handler of the event source | 61 | * level handler of the event source |
61 | * @set_next_event: set next event function | 62 | * @set_next_event: set next event function using a clocksource delta |
63 | * @set_next_ktime: set next event function using a direct ktime value | ||
62 | * @next_event: local storage for the next event in oneshot mode | 64 | * @next_event: local storage for the next event in oneshot mode |
63 | * @max_delta_ns: maximum delta value in ns | 65 | * @max_delta_ns: maximum delta value in ns |
64 | * @min_delta_ns: minimum delta value in ns | 66 | * @min_delta_ns: minimum delta value in ns |
@@ -81,6 +83,8 @@ struct clock_event_device { | |||
81 | void (*event_handler)(struct clock_event_device *); | 83 | void (*event_handler)(struct clock_event_device *); |
82 | int (*set_next_event)(unsigned long evt, | 84 | int (*set_next_event)(unsigned long evt, |
83 | struct clock_event_device *); | 85 | struct clock_event_device *); |
86 | int (*set_next_ktime)(ktime_t expires, | ||
87 | struct clock_event_device *); | ||
84 | ktime_t next_event; | 88 | ktime_t next_event; |
85 | u64 max_delta_ns; | 89 | u64 max_delta_ns; |
86 | u64 min_delta_ns; | 90 | u64 min_delta_ns; |