From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] PWM: update enable status when using the internal API
Date: Thu, 8 Dec 2016 18:04:41 +0100 [thread overview]
Message-ID: <1481216681-24393-3-git-send-email-jlu@pengutronix.de> (raw)
In-Reply-To: <1481216681-24393-1-git-send-email-jlu@pengutronix.de>
Without these, 'devinfo pwmX' will show enabled=0 even though the PWM
was enabled (for example by a pwm-backlight).
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
drivers/pwm/core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 360520195a05..ee65619c4ea5 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -281,6 +281,8 @@ unsigned int pwm_get_duty_cycle(struct pwm_device *pwm)
*/
int pwm_enable(struct pwm_device *pwm)
{
+ pwm->p_enable = 1;
+
if (!test_and_set_bit(FLAG_ENABLED, &pwm->flags))
return pwm->chip->ops->enable(pwm->chip);
@@ -293,6 +295,8 @@ EXPORT_SYMBOL_GPL(pwm_enable);
*/
void pwm_disable(struct pwm_device *pwm)
{
+ pwm->p_enable = 0;
+
if (test_and_clear_bit(FLAG_ENABLED, &pwm->flags))
pwm->chip->ops->disable(pwm->chip);
}
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-12-08 17:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-08 17:04 [PATCH 1/3] i.MX: IPUv3: Add parallel display support Jan Luebbe
2016-12-08 17:04 ` [PATCH 2/3] video: IPU framebuffer: honor clock and enable polarities Jan Luebbe
2016-12-08 17:04 ` Jan Luebbe [this message]
2016-12-12 5:12 ` [PATCH 1/3] i.MX: IPUv3: Add parallel display support Sascha Hauer
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=1481216681-24393-3-git-send-email-jlu@pengutronix.de \
--to=jlu@pengutronix.de \
--cc=barebox@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