linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mingo@elte.hu (Ingo Molnar)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch 5/7] clockevents: Provide interface to reconfigure an active clock event device
Date: Thu, 19 May 2011 11:10:24 +0200	[thread overview]
Message-ID: <20110519091024.GB6251@elte.hu> (raw)
In-Reply-To: <20110518210136.437459958@linutronix.de>


* Thomas Gleixner <tglx@linutronix.de> wrote:

> Some ARM SoCs have clock event devices which have their frequency
> modified due to frequency scaling. Provide an interface which allows
> to reconfigure an active device. After reconfiguration reprogram the
> current pending event.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
>  include/linux/clockchips.h |    2 ++
>  kernel/time/clockevents.c  |   20 ++++++++++++++++++++
>  2 files changed, 22 insertions(+)
> 
> Index: linux-2.6-tip/include/linux/clockchips.h
> ===================================================================
> --- linux-2.6-tip.orig/include/linux/clockchips.h
> +++ linux-2.6-tip/include/linux/clockchips.h
> @@ -132,6 +132,8 @@ extern void clockevents_config_and_regis
>  					    u32 freq, unsigned long min_delta,
>  					    unsigned long max_delta);
>  
> +extern int clockevents_reconfigure(struct clock_event_device *ce, u32 freq);
> +
>  extern void clockevents_exchange_device(struct clock_event_device *old,
>  					struct clock_event_device *new);
>  extern void clockevents_set_mode(struct clock_event_device *dev,
> Index: linux-2.6-tip/kernel/time/clockevents.c
> ===================================================================
> --- linux-2.6-tip.orig/kernel/time/clockevents.c
> +++ linux-2.6-tip/kernel/time/clockevents.c
> @@ -238,6 +238,26 @@ void clockevents_config_and_register(str
>  	clockevents_register_device(dev);
>  }
>  
> +/**
> + * clockevents_reconfigure - Reconfigure and reprogram a clock event device.
> + * @dev:	device to modify
> + * @freq:	new device frequency
> + *
> + * Reconfigure and reprogram a clock event device in oneshot
> + * mode. Must be called on the cpu for which the device delivers per
> + * cpu timer events with interrupts disabled!  Returns 0 on success,
> + * -ETIME when the event is in the past.
> + */
> +int clockevents_reconfigure(struct clock_event_device *dev, u32 freq)

This too could use a struct clockevents_params perhaps - and would only use 
params.freq for now but might be extended in the future.

But i'm fine with this API as well:

Reviewed-by: Ingo Molnar <mingo@elte.hu>

Thanks,

	Ingo

  parent reply	other threads:[~2011-05-19  9:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 21:33 [patch 0/7] clocksources/clockevents improvements Thomas Gleixner
2011-05-18 21:33 ` [patch 1/7] clocksource: Restructure clocksource struct members Thomas Gleixner
2011-05-18 21:33 ` [patch 2/7] clocksource: Get rid of the hardcoded 5 seconds sleep time limit Thomas Gleixner
2011-05-19  0:57   ` John Stultz
2011-05-19  8:43     ` Thomas Gleixner
2011-05-20  1:10     ` john stultz
2011-05-18 21:33 ` [patch 4/7] clockevents: Provide combined configure and register function Thomas Gleixner
2011-05-19  9:08   ` Ingo Molnar
2011-05-19 10:00     ` Thomas Gleixner
2011-05-19 18:10       ` Ingo Molnar
2011-05-18 21:33 ` [patch 3/7] clockevents: Restructure clock_event_device members Thomas Gleixner
2011-05-18 21:33 ` [patch 5/7] clockevents: Provide interface to reconfigure an active clock event device Thomas Gleixner
2011-05-19  7:26   ` Linus Walleij
2011-05-19  9:10   ` Ingo Molnar [this message]
2011-05-19  9:33     ` Thomas Gleixner
2011-05-19  9:37       ` Ingo Molnar
2011-05-18 21:33 ` [patch 6/7] x86: Convert PIT to clockevents_config_and_register() Thomas Gleixner
2011-05-18 21:33 ` [patch 7/7] x86: hpet: Cleanup the clockevents init and register code Thomas Gleixner
2011-05-19  9:33   ` Ingo Molnar
2011-05-19  9:34 ` [patch 0/7] clocksources/clockevents improvements Ingo Molnar

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=20110519091024.GB6251@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).