diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-07-16 06:58:46 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-07-30 15:25:38 -0400 |
commit | c2e13cc2cea64385043fa9afaaf91a74ec438467 (patch) | |
tree | 839cf8593eeb6c0f62d0a6734a39b6dbd1bf40d4 /arch/x86/lguest/boot.c | |
parent | 5054e1e63946abff39bc7b154fac049110d9d3bb (diff) |
x86/lguest/timer: Migrate to new set-state interface
Migrate lguest driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.
This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.
We weren't doing anything while switching modes other than in shutdown
mode and so those are not implemented.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-and-tested-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: linaro-kernel@lists.linaro.org
Cc: Alexander Kuleshov <kuleshovmail@gmail.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: lguest@lists.ozlabs.org (open list:LGUEST)
Link: http://lkml.kernel.org/r/b96f1c308f4523255c5394a4e6e13f2b67685402.1437042675.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/lguest/boot.c')
-rw-r--r-- | arch/x86/lguest/boot.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index f2dc08c003eb..433e5a7dd37f 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -985,23 +985,11 @@ static int lguest_clockevent_set_next_event(unsigned long delta, | |||
985 | return 0; | 985 | return 0; |
986 | } | 986 | } |
987 | 987 | ||
988 | static void lguest_clockevent_set_mode(enum clock_event_mode mode, | 988 | static int lguest_clockevent_shutdown(struct clock_event_device *evt) |
989 | struct clock_event_device *evt) | 989 | { |
990 | { | 990 | /* A 0 argument shuts the clock down. */ |
991 | switch (mode) { | 991 | hcall(LHCALL_SET_CLOCKEVENT, 0, 0, 0, 0); |
992 | case CLOCK_EVT_MODE_UNUSED: | 992 | return 0; |
993 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
994 | /* A 0 argument shuts the clock down. */ | ||
995 | hcall(LHCALL_SET_CLOCKEVENT, 0, 0, 0, 0); | ||
996 | break; | ||
997 | case CLOCK_EVT_MODE_ONESHOT: | ||
998 | /* This is what we expect. */ | ||
999 | break; | ||
1000 | case CLOCK_EVT_MODE_PERIODIC: | ||
1001 | BUG(); | ||
1002 | case CLOCK_EVT_MODE_RESUME: | ||
1003 | break; | ||
1004 | } | ||
1005 | } | 993 | } |
1006 | 994 | ||
1007 | /* This describes our primitive timer chip. */ | 995 | /* This describes our primitive timer chip. */ |
@@ -1009,7 +997,7 @@ static struct clock_event_device lguest_clockevent = { | |||
1009 | .name = "lguest", | 997 | .name = "lguest", |
1010 | .features = CLOCK_EVT_FEAT_ONESHOT, | 998 | .features = CLOCK_EVT_FEAT_ONESHOT, |
1011 | .set_next_event = lguest_clockevent_set_next_event, | 999 | .set_next_event = lguest_clockevent_set_next_event, |
1012 | .set_mode = lguest_clockevent_set_mode, | 1000 | .set_state_shutdown = lguest_clockevent_shutdown, |
1013 | .rating = INT_MAX, | 1001 | .rating = INT_MAX, |
1014 | .mult = 1, | 1002 | .mult = 1, |
1015 | .shift = 0, | 1003 | .shift = 0, |