From: "tip-bot2 for Lokesh Vutla" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Lokesh Vutla <lokeshvutla@ti.com>,
Tony Lindgen <tony@atomide.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>, x86 <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [tip: timers/core] clocksource/drivers/timer-ti-dm: Add support to get pwm current status
Date: Thu, 19 Mar 2020 08:47:47 -0000 [thread overview]
Message-ID: <158460766792.28353.14134380643914951850.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200305082715.15861-6-lokeshvutla@ti.com>
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 92fd86864ec4ac089de47f0f1f4c47418b343448
Gitweb: https://git.kernel.org/tip/92fd86864ec4ac089de47f0f1f4c47418b343448
Author: Lokesh Vutla <lokeshvutla@ti.com>
AuthorDate: Thu, 05 Mar 2020 13:57:14 +05:30
Committer: Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Mon, 16 Mar 2020 12:40:42 +01:00
clocksource/drivers/timer-ti-dm: Add support to get pwm current status
omap_dm_timer_ops provide support to configure the pwm but there is no
support to get the current status. For configuring pwm it is advised to
check the current hw status instead of relying on pwm framework. So
implement a new timer ops to get the current status of pwm.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Tony Lindgen <tony@atomide.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200305082715.15861-6-lokeshvutla@ti.com
---
drivers/clocksource/timer-ti-dm.c | 15 +++++++++++++++
include/linux/platform_data/dmtimer-omap.h | 1 +
2 files changed, 16 insertions(+)
diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
index b565b84..73ac73e 100644
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -627,6 +627,20 @@ static int omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on,
return 0;
}
+static int omap_dm_timer_get_pwm_status(struct omap_dm_timer *timer)
+{
+ u32 l;
+
+ if (unlikely(!timer))
+ return -EINVAL;
+
+ omap_dm_timer_enable(timer);
+ l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
+ omap_dm_timer_disable(timer);
+
+ return l;
+}
+
static int omap_dm_timer_set_prescaler(struct omap_dm_timer *timer,
int prescaler)
{
@@ -927,6 +941,7 @@ static const struct omap_dm_timer_ops dmtimer_ops = {
.set_load = omap_dm_timer_set_load,
.set_match = omap_dm_timer_set_match,
.set_pwm = omap_dm_timer_set_pwm,
+ .get_pwm_status = omap_dm_timer_get_pwm_status,
.set_prescaler = omap_dm_timer_set_prescaler,
.read_counter = omap_dm_timer_read_counter,
.write_counter = omap_dm_timer_write_counter,
diff --git a/include/linux/platform_data/dmtimer-omap.h b/include/linux/platform_data/dmtimer-omap.h
index bdaaf53..3173b7b 100644
--- a/include/linux/platform_data/dmtimer-omap.h
+++ b/include/linux/platform_data/dmtimer-omap.h
@@ -36,6 +36,7 @@ struct omap_dm_timer_ops {
unsigned int match);
int (*set_pwm)(struct omap_dm_timer *timer, int def_on,
int toggle, int trigger);
+ int (*get_pwm_status)(struct omap_dm_timer *timer);
int (*set_prescaler)(struct omap_dm_timer *timer, int prescaler);
unsigned int (*read_counter)(struct omap_dm_timer *timer);
next prev parent reply other threads:[~2020-03-19 8:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 8:27 [PATCH v3 0/6] clocksource: timer-ti-dm: Prepare for dynamic pwm period updates Lokesh Vutla
2020-03-05 8:27 ` [PATCH v3 1/6] clocksource: timer-ti-dm: Convert to SPDX identifier Lokesh Vutla
2020-03-06 16:57 ` Tony Lindgren
2020-03-19 8:47 ` [tip: timers/core] clocksource/drivers/timer-ti-dm: " tip-bot2 for Lokesh Vutla
2020-03-05 8:27 ` [PATCH v3 2/6] clocksource: timer-ti-dm: Prepare for using cpuidle Lokesh Vutla
2020-03-19 8:47 ` [tip: timers/core] clocksource/drivers/timer-ti-dm: " tip-bot2 for Tony Lindgren
2020-03-05 8:27 ` [PATCH v3 3/6] clocksource: timer-ti-dm: Implement cpu_pm notifier for context save and restore Lokesh Vutla
2020-03-16 10:51 ` Daniel Lezcano
2020-03-16 11:14 ` [PATCH v4 " Lokesh Vutla
2020-03-19 8:47 ` [tip: timers/core] clocksource/drivers/timer-ti-dm: " tip-bot2 for Lokesh Vutla
2020-03-05 8:27 ` [PATCH v3 4/6] clocksource: timer-ti-dm: Do not update counter on updating the period Lokesh Vutla
2020-03-19 8:47 ` [tip: timers/core] clocksource/drivers/timer-ti-dm: " tip-bot2 for Lokesh Vutla
2020-03-05 8:27 ` [PATCH v3 5/6] clocksource: timer-ti-dm: Add support to get pwm current status Lokesh Vutla
2020-03-06 17:08 ` Tony Lindgren
2020-03-19 8:47 ` tip-bot2 for Lokesh Vutla [this message]
2020-03-05 8:27 ` [PATCH v3 6/6] clocksource: timer-ti-dm: Enable autoreload in set_pwm Lokesh Vutla
2020-03-06 17:18 ` Tony Lindgren
2020-03-19 8:47 ` [tip: timers/core] clocksource/drivers/timer-ti-dm: " tip-bot2 for Lokesh Vutla
2020-03-30 13:18 ` [PATCH v3 6/6] clocksource: timer-ti-dm: " Thierry Reding
2020-03-06 17:19 ` [PATCH v3 0/6] clocksource: timer-ti-dm: Prepare for dynamic pwm period updates Tony Lindgren
2020-03-12 11:10 ` Daniel Lezcano
2020-03-12 17:26 ` Tony Lindgren
2020-03-16 12:41 ` Daniel Lezcano
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=158460766792.28353.14134380643914951850.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lokeshvutla@ti.com \
--cc=tony@atomide.com \
--cc=x86@kernel.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).