Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca53d434 authored by Viresh Kumar's avatar Viresh Kumar Committed by Thomas Gleixner
Browse files

x86/uv/time: Migrate to new set-state interface



Migrate uv 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: default avatarViresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org
Cc: Christoph Lameter <cl@linux.com>
Cc: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/52e04139746222a2e82a96d13953cbc306cfb59b.1437042675.git.viresh.kumar@linaro.org


Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent c2e13cc2
Loading
Loading
Loading
Loading
+13 −24
Original line number Diff line number Diff line
@@ -32,8 +32,7 @@

static cycle_t uv_read_rtc(struct clocksource *cs);
static int uv_rtc_next_event(unsigned long, struct clock_event_device *);
static void uv_rtc_timer_setup(enum clock_event_mode,
				struct clock_event_device *);
static int uv_rtc_shutdown(struct clock_event_device *evt);

static struct clocksource clocksource_uv = {
	.name		= RTC_NAME,
@@ -50,7 +49,7 @@ static struct clock_event_device clock_event_device_uv = {
	.rating			= 400,
	.irq			= -1,
	.set_next_event		= uv_rtc_next_event,
	.set_mode	= uv_rtc_timer_setup,
	.set_state_shutdown	= uv_rtc_shutdown,
	.event_handler		= NULL,
};

@@ -321,24 +320,14 @@ static int uv_rtc_next_event(unsigned long delta,
}

/*
 * Setup the RTC timer in oneshot mode
 * Shutdown the RTC timer
 */
static void uv_rtc_timer_setup(enum clock_event_mode mode,
			       struct clock_event_device *evt)
static int uv_rtc_shutdown(struct clock_event_device *evt)
{
	int ced_cpu = cpumask_first(evt->cpumask);

	switch (mode) {
	case CLOCK_EVT_MODE_PERIODIC:
	case CLOCK_EVT_MODE_ONESHOT:
	case CLOCK_EVT_MODE_RESUME:
		/* Nothing to do here yet */
		break;
	case CLOCK_EVT_MODE_UNUSED:
	case CLOCK_EVT_MODE_SHUTDOWN:
	uv_rtc_unset_timer(ced_cpu, 1);
		break;
	}
	return 0;
}

static void uv_rtc_interrupt(void)