From: Greg Ungerer <gerg@uclinux.org>
To: Viresh Kumar <viresh.kumar@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-m68k@vger.kernel.org
Subject: Re: [PATCH 08/23] m68k/coldfire/pit: Migrate to new 'set-state' interface
Date: Thu, 16 Jul 2015 22:42:18 +1000 [thread overview]
Message-ID: <55A7A6AA.1050602@uclinux.org> (raw)
In-Reply-To: <e3b21870111e9f0a71a6a9b7ef3aa68fbb772f81.1437044517.git.viresh.kumar@linaro.org>
Hi Viresh,
On 16/07/15 21:26, Viresh Kumar wrote:
> Migrate m68k 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 ->set_mode(RESUME) and so tick_resume()
> isn't implemented.
>
> Cc: Greg Ungerer <gerg@uclinux.org>
Applied and tested ok (against 4.2-rc2).
Acked-by: Greg Ungerer <gerg@uclinux.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> arch/m68k/coldfire/pit.c | 66 ++++++++++++++++++++++--------------------------
> 1 file changed, 30 insertions(+), 36 deletions(-)
>
> diff --git a/arch/m68k/coldfire/pit.c b/arch/m68k/coldfire/pit.c
> index 493b3111d4c1..d86a9ffb3f13 100644
> --- a/arch/m68k/coldfire/pit.c
> +++ b/arch/m68k/coldfire/pit.c
> @@ -42,37 +42,28 @@ static u32 pit_cnt;
> * This is also called after resume to bring the PIT into operation again.
> */
>
> -static void init_cf_pit_timer(enum clock_event_mode mode,
> - struct clock_event_device *evt)
> +static int cf_pit_set_periodic(struct clock_event_device *evt)
> {
> - switch (mode) {
> - case CLOCK_EVT_MODE_PERIODIC:
> -
> - __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR));
> - __raw_writew(PIT_CYCLES_PER_JIFFY, TA(MCFPIT_PMR));
> - __raw_writew(MCFPIT_PCSR_EN | MCFPIT_PCSR_PIE | \
> - MCFPIT_PCSR_OVW | MCFPIT_PCSR_RLD | \
> - MCFPIT_PCSR_CLK64, TA(MCFPIT_PCSR));
> - break;
> -
> - case CLOCK_EVT_MODE_SHUTDOWN:
> - case CLOCK_EVT_MODE_UNUSED:
> -
> - __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR));
> - break;
> -
> - case CLOCK_EVT_MODE_ONESHOT:
> -
> - __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR));
> - __raw_writew(MCFPIT_PCSR_EN | MCFPIT_PCSR_PIE | \
> - MCFPIT_PCSR_OVW | MCFPIT_PCSR_CLK64, \
> - TA(MCFPIT_PCSR));
> - break;
> -
> - case CLOCK_EVT_MODE_RESUME:
> - /* Nothing to do here */
> - break;
> - }
> + __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR));
> + __raw_writew(PIT_CYCLES_PER_JIFFY, TA(MCFPIT_PMR));
> + __raw_writew(MCFPIT_PCSR_EN | MCFPIT_PCSR_PIE |
> + MCFPIT_PCSR_OVW | MCFPIT_PCSR_RLD |
> + MCFPIT_PCSR_CLK64, TA(MCFPIT_PCSR));
> + return 0;
> +}
> +
> +static int cf_pit_set_oneshot(struct clock_event_device *evt)
> +{
> + __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR));
> + __raw_writew(MCFPIT_PCSR_EN | MCFPIT_PCSR_PIE |
> + MCFPIT_PCSR_OVW | MCFPIT_PCSR_CLK64, TA(MCFPIT_PCSR));
> + return 0;
> +}
> +
> +static int cf_pit_shutdown(struct clock_event_device *evt)
> +{
> + __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR));
> + return 0;
> }
>
> /*
> @@ -88,12 +79,15 @@ static int cf_pit_next_event(unsigned long delta,
> }
>
> struct clock_event_device cf_pit_clockevent = {
> - .name = "pit",
> - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
> - .set_mode = init_cf_pit_timer,
> - .set_next_event = cf_pit_next_event,
> - .shift = 32,
> - .irq = MCF_IRQ_PIT1,
> + .name = "pit",
> + .features = CLOCK_EVT_FEAT_PERIODIC |
> + CLOCK_EVT_FEAT_ONESHOT,
> + .set_state_shutdown = cf_pit_shutdown,
> + .set_state_periodic = cf_pit_set_periodic,
> + .set_state_oneshot = cf_pit_set_oneshot,
> + .set_next_event = cf_pit_next_event,
> + .shift = 32,
> + .irq = MCF_IRQ_PIT1,
> };
>
>
next prev parent reply other threads:[~2015-07-16 12:42 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 11:26 [PATCH 00/23] ARCH: Migrate clockevent drivers to 'set-state' interface Viresh Kumar
2015-07-16 11:26 ` [PATCH 01/23] alpha/time: Migrate to new " Viresh Kumar
2015-07-16 11:26 ` [PATCH 02/23] ARC/time: " Viresh Kumar
2015-07-20 10:55 ` Vineet Gupta
2015-07-16 11:26 ` [PATCH 03/23] AVR32/time: " Viresh Kumar
2015-07-20 7:40 ` Hans-Christian Egtvedt
2015-07-16 11:26 ` [PATCH 04/23] blackfin/time-ts: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 05/23] c6x/timer64: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 06/23] cris/time: " Viresh Kumar
2015-07-17 18:47 ` Rabin Vincent
2015-07-16 11:26 ` [PATCH 07/23] hexagon/time: " Viresh Kumar
2015-07-21 22:28 ` rkuo
2015-07-16 11:26 ` [PATCH 08/23] m68k/coldfire/pit: " Viresh Kumar
2015-07-16 12:42 ` Greg Ungerer
2015-07-16 12:42 ` Greg Ungerer [this message]
2015-07-16 11:26 ` Viresh Kumar
2015-07-16 11:26 ` [PATCH 09/23] microblaze/timer: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 10/23] mn10300/cevt-mn10300: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 11/23] nios2/time: " Viresh Kumar
2015-07-17 9:01 ` Tobias Klauser
2015-07-21 10:03 ` [Nios2-dev] " Ley Foon Tan
2015-07-16 11:26 ` [PATCH 12/23] openrisc/time: " Viresh Kumar
2015-07-16 13:42 ` Jonas Bonn
2015-07-16 11:26 ` [PATCH 13/23] powerpc/time: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 14/23] s390/time: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 15/23] score/time: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 16/23] sh/localtimer: " Viresh Kumar
2015-07-16 11:38 ` Viresh Kumar
2015-07-16 11:26 ` [PATCH 17/23] sparc/time: " Viresh Kumar
2015-07-16 11:38 ` Viresh Kumar
2015-07-16 18:13 ` David Miller
2015-07-16 18:13 ` David Miller
2015-07-16 11:26 ` [PATCH 18/23] tile/time: " Viresh Kumar
2015-07-20 21:02 ` Chris Metcalf
2015-07-21 13:11 ` Chris Metcalf
2015-07-21 14:09 ` Viresh Kumar
2015-07-16 11:26 ` [PATCH 19/23] um/time: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 20/23] unicore/time: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 21/23] xtensa/time: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 22/23] drivers/hv: " Viresh Kumar
2015-07-16 11:26 ` [PATCH 23/23] kernel: broadcast-hrtimer: " Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55A7A6AA.1050602@uclinux.org \
--to=gerg@uclinux.org \
--cc=daniel.lezcano@linaro.org \
--cc=geert@linux-m68k.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.