From: NeilBrown <neilb@suse.de>
To: Tony Lindgren <tony@atomide.com>, Russell King <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Belisko Marek <marek.belisko@gmail.com>,
"Dr. H. Nikolaus Schaller" <hns@goldelico.com>
Subject: [PATCH 1/2] ARM: OMAP2+: dmtimer: allow counter to be set at any time.
Date: Thu, 24 Oct 2013 17:57:40 +1100 [thread overview]
Message-ID: <20131024065740.16889.96134.stgit@notabene.brown> (raw)
In-Reply-To: <20131024065536.16889.49902.stgit@notabene.brown>
It is perfectly appropriate to set the counter register
when the timer isn't running. The value set will be where
the counter starts counting from.
Signed-off-by: NeilBrown <neilb@suse.de>
---
arch/arm/plat-omap/dmtimer.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 869254c..d80d2c4 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -752,15 +752,16 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter);
int omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value)
{
- if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) {
- pr_err("%s: timer not available or enabled.\n", __func__);
+ if (unlikely(!timer))
return -EINVAL;
- }
+
+ omap_dm_timer_enable(timer);
omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value);
/* Save the context */
timer->context.tcrr = value;
+ omap_dm_timer_disable(timer);
return 0;
}
EXPORT_SYMBOL_GPL(omap_dm_timer_write_counter);
WARNING: multiple messages have this Message-ID (diff)
From: neilb@suse.de (NeilBrown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: OMAP2+: dmtimer: allow counter to be set at any time.
Date: Thu, 24 Oct 2013 17:57:40 +1100 [thread overview]
Message-ID: <20131024065740.16889.96134.stgit@notabene.brown> (raw)
In-Reply-To: <20131024065536.16889.49902.stgit@notabene.brown>
It is perfectly appropriate to set the counter register
when the timer isn't running. The value set will be where
the counter starts counting from.
Signed-off-by: NeilBrown <neilb@suse.de>
---
arch/arm/plat-omap/dmtimer.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 869254c..d80d2c4 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -752,15 +752,16 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter);
int omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value)
{
- if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) {
- pr_err("%s: timer not available or enabled.\n", __func__);
+ if (unlikely(!timer))
return -EINVAL;
- }
+
+ omap_dm_timer_enable(timer);
omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value);
/* Save the context */
timer->context.tcrr = value;
+ omap_dm_timer_disable(timer);
return 0;
}
EXPORT_SYMBOL_GPL(omap_dm_timer_write_counter);
WARNING: multiple messages have this Message-ID (diff)
From: NeilBrown <neilb@suse.de>
To: Tony Lindgren <tony@atomide.com>, Russell King <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: Belisko Marek <marek.belisko@gmail.com>,
"Dr. H. Nikolaus Schaller" <hns@goldelico.com>
Subject: [PATCH 1/2] ARM: OMAP2+: dmtimer: allow counter to be set at any time.
Date: Thu, 24 Oct 2013 17:57:40 +1100 [thread overview]
Message-ID: <20131024065740.16889.96134.stgit@notabene.brown> (raw)
In-Reply-To: <20131024065536.16889.49902.stgit@notabene.brown>
It is perfectly appropriate to set the counter register
when the timer isn't running. The value set will be where
the counter starts counting from.
Signed-off-by: NeilBrown <neilb@suse.de>
---
arch/arm/plat-omap/dmtimer.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 869254c..d80d2c4 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -752,15 +752,16 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter);
int omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value)
{
- if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) {
- pr_err("%s: timer not available or enabled.\n", __func__);
+ if (unlikely(!timer))
return -EINVAL;
- }
+
+ omap_dm_timer_enable(timer);
omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value);
/* Save the context */
timer->context.tcrr = value;
+ omap_dm_timer_disable(timer);
return 0;
}
EXPORT_SYMBOL_GPL(omap_dm_timer_write_counter);
next prev parent reply other threads:[~2013-10-24 6:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-24 6:57 [PATCH 0/2] ARM: OMAP: dmtimers improvements NeilBrown
2013-10-24 6:57 ` NeilBrown
2013-10-24 6:57 ` NeilBrown
2013-10-24 6:57 ` NeilBrown [this message]
2013-10-24 6:57 ` [PATCH 1/2] ARM: OMAP2+: dmtimer: allow counter to be set at any time NeilBrown
2013-10-24 6:57 ` NeilBrown
2013-10-24 6:57 ` [PATCH 2/2] ARM: OMAP: move dmtimer.h from plat-omap/include/plat to include/linux NeilBrown
2013-10-24 6:57 ` NeilBrown
2013-10-24 6:57 ` NeilBrown
2013-10-24 18:10 ` [PATCH 0/2] ARM: OMAP: dmtimers improvements Shilimkar, Santosh
2013-10-24 18:10 ` Shilimkar, Santosh
2013-10-25 14:31 ` Tony Lindgren
2013-10-25 14:31 ` Tony Lindgren
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=20131024065740.16889.96134.stgit@notabene.brown \
--to=neilb@suse.de \
--cc=hns@goldelico.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=marek.belisko@gmail.com \
--cc=tony@atomide.com \
/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.