Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751697AbbHPREP (ORCPT ); Sun, 16 Aug 2015 13:04:15 -0400 Received: from mail-ob0-f180.google.com ([209.85.214.180]:35488 "EHLO mail-ob0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbbHPREN (ORCPT ); Sun, 16 Aug 2015 13:04:13 -0400 MIME-Version: 1.0 In-Reply-To: <1439200352-26767-67-git-send-email-daniel.lezcano@linaro.org> References: <55C87382.4070309@linaro.org> <1439200352-26767-1-git-send-email-daniel.lezcano@linaro.org> <1439200352-26767-67-git-send-email-daniel.lezcano@linaro.org> Date: Mon, 17 Aug 2015 01:04:12 +0800 Message-ID: Subject: Re: [PATCH 67/74] score/time: Migrate to new 'set-state' interface From: Lennox Wu To: Daniel Lezcano Cc: mingo@kernel.org, Thomas Gleixner , open list , Viresh Kumar , Chen Liqin , Michael Opdenacker Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3010 Lines: 78 Acked-by: Lennox Wu 2015-08-10 17:52 GMT+08:00 Daniel Lezcano : > From: Viresh Kumar > > Migrate score 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 in ONESHOT/SHUTDOWN/RESUME modes and so > callbacks for them aren't implemented. > > Cc: Chen Liqin > Cc: Lennox Wu > Cc: Michael Opdenacker > Signed-off-by: Viresh Kumar > Signed-off-by: Daniel Lezcano > --- > arch/score/kernel/time.c | 31 ++++++++++--------------------- > 1 file changed, 10 insertions(+), 21 deletions(-) > > diff --git a/arch/score/kernel/time.c b/arch/score/kernel/time.c > index 24770cd..679b8d7 100644 > --- a/arch/score/kernel/time.c > +++ b/arch/score/kernel/time.c > @@ -55,31 +55,20 @@ static int score_timer_set_next_event(unsigned long delta, > return 0; > } > > -static void score_timer_set_mode(enum clock_event_mode mode, > - struct clock_event_device *evdev) > +static int score_timer_set_periodic(struct clock_event_device *evt) > { > - switch (mode) { > - case CLOCK_EVT_MODE_PERIODIC: > - outl((TMR_M_PERIODIC | TMR_IE_ENABLE), P_TIMER0_CTRL); > - outl(SYSTEM_CLOCK/HZ, P_TIMER0_PRELOAD); > - outl(inl(P_TIMER0_CTRL) | TMR_ENABLE, P_TIMER0_CTRL); > - break; > - case CLOCK_EVT_MODE_ONESHOT: > - case CLOCK_EVT_MODE_SHUTDOWN: > - case CLOCK_EVT_MODE_RESUME: > - case CLOCK_EVT_MODE_UNUSED: > - break; > - default: > - BUG(); > - } > + outl((TMR_M_PERIODIC | TMR_IE_ENABLE), P_TIMER0_CTRL); > + outl(SYSTEM_CLOCK / HZ, P_TIMER0_PRELOAD); > + outl(inl(P_TIMER0_CTRL) | TMR_ENABLE, P_TIMER0_CTRL); > + return 0; > } > > static struct clock_event_device score_clockevent = { > - .name = "score_clockevent", > - .features = CLOCK_EVT_FEAT_PERIODIC, > - .shift = 16, > - .set_next_event = score_timer_set_next_event, > - .set_mode = score_timer_set_mode, > + .name = "score_clockevent", > + .features = CLOCK_EVT_FEAT_PERIODIC, > + .shift = 16, > + .set_next_event = score_timer_set_next_event, > + .set_state_periodic = score_timer_set_periodic, > }; > > void __init time_init(void) > -- > 1.9.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/