linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: rabin@rab.in (Rabin Vincent)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/8] ARM: S5PV310: Add Timer support
Date: Mon, 28 Jun 2010 20:49:18 +0530	[thread overview]
Message-ID: <20100628151918.GC3287@debian> (raw)
In-Reply-To: <1277476037-8806-6-git-send-email-kgene.kim@samsung.com>

On Fri, Jun 25, 2010 at 11:27:14PM +0900, Kukjin Kim wrote:
> +static void s5pv310_pwm_init(unsigned int pwm_id, unsigned long tcnt)
> +{
> +	unsigned long tcon;
> +
> +	tcon = __raw_readl(S3C2410_TCON);
> +
> +	/* timers reload after counting zero, so reduce the count by 1 */
> +	tcnt--;
> +
> +	printk(KERN_DEBUG "timer tcon=%08lx, tcnt %08lx\n", tcon, tcnt);

This function is called from set_event().  Do you really want this
printk every time a tick is programmed?

> +static void __init s5pv310_clocksource_init(void)
> +{
> +	unsigned long pclk;
> +	unsigned long clock_rate;
> +
> +	pclk = clk_get_rate(timerclk);
> +
> +	clk_set_rate(tdiv2, pclk / 2);
> +	clk_set_parent(tin2, tdiv2);
> +
> +	clock_rate = clk_get_rate(tin2);
> +
> +	pwm_clocksource.mult =
> +		clocksource_khz2mult(clock_rate/1000, pwm_clocksource.shift);
> +
> +	if (clocksource_register(&pwm_clocksource))
> +		panic("%s: can't register clocksource\n", pwm_clocksource.name);
> +
> +	s5pv310_pwm_init(2, ~0);
> +	s5pv310_pwm_start(2, 1);
> +}
> +

It would probably be prudent to start the clocksource before registering
it, rather than after.

  reply	other threads:[~2010-06-28 15:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-25 14:27 [PATCH 0/8] ARM: S5PV310: Add support for Samsung S5PV310 SoC Kukjin Kim
2010-06-25 14:27 ` [PATCH 1/8] ARM: S5P: Remove fixed uart offset dependent code Kukjin Kim
2010-06-25 14:27 ` [PATCH 2/8] ARM: S5PV310: Add new CPU initialization support Kukjin Kim
2010-06-25 14:27 ` [PATCH 3/8] ARM: S5PV310: Add Clock and PLL support Kukjin Kim
2010-06-25 14:27 ` [PATCH 4/8] ARM: S5PV310: Add IRQ support Kukjin Kim
2010-06-28 14:47   ` Rabin Vincent
2010-06-25 14:27 ` [PATCH 5/8] ARM: S5PV310: Add Timer support Kukjin Kim
2010-06-28 15:19   ` Rabin Vincent [this message]
2010-06-29 11:23     ` Kukjin Kim
2010-06-25 14:27 ` [PATCH 6/8] ARM: S5PV310: Add new Kconfig and Makefiles Kukjin Kim
2010-06-25 14:27 ` [PATCH 7/8] ARM: S5PV310: Add Board support file Kukjin Kim
2010-06-25 14:27 ` [PATCH 8/8] ARM: S5PV310: Add serial port support Kukjin Kim
2010-07-01  9:52   ` Kyungmin Park
2010-07-01  9:49 ` [PATCH 0/8] ARM: S5PV310: Add support for Samsung S5PV310 SoC Kyungmin Park

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=20100628151918.GC3287@debian \
    --to=rabin@rab.in \
    --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).