From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: <thierry.reding@gmail.com>, <corbet@lwn.net>,
<alexandre.belloni@free-electrons.com>,
<boris.brezillon@free-electrons.com>, <linux-pwm@vger.kernel.org>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Cc: <nicolas.ferre@microchip.com>, <claudiu.beznea@microchip.com>
Subject: [PATCH v2 0/2] extends PWM framework to support PWM dead-times
Date: Tue, 9 May 2017 11:19:48 +0300 [thread overview]
Message-ID: <1494317990-9131-1-git-send-email-claudiu.beznea@microchip.com> (raw)
Hi all,
Please give feedback on these patches which extends PWM framework
in order to support PWM dead-times.
Since I didn't receive any inputs on RFC series I'm resending it as
normal patch series.
For a PWM controller with more than one output signals per PWM channel
dead-times are the delays introduced between the edges of the output
signals and the original signal introduced in dead-time generator
engine.
E.g. consider a PWM controller with a dead-time engine as in the following
diagram:
-----------------
| |---> PWMH
PWM signal --->| Dead-time engine|
| |---> PWML
-----------------
With no dead-time configured, the PWMH and PWML signals will be
complementary signals (rising and falling edges of PWMH and PWML
have opposite leves, same duration and same starting time) as
follows:
____0 D____P ____ ____ ____
PWM signal __| |____| |____| |____| |____| |___
____ ____ ____ ____ ____
PWMH __| |____| |____| |____| |____| |___
__ ____ ____ ____ ____ ___
PWML |____| |____| |____| |____| |____|
Where - 0 is the starting point of the signal
- D is the starting point of the duty-cycle
- P is the signal period
Based on the above diagram:
- rising edge dead-time - is the delay introduced in one of the
dead-time engine output signals; the delay is introduced after
rising edge of the original PWM signal
- falling edge dead-time - is the delay introduced in one of the
dead-time engine output signals; the delay is introduced after
the end of falling edge of the original PWM signal
The following diagram explain how PWM dead-times falls on some signals:
____0 D____P ____ ____ ____
PWM signal __| |____| |____| |____| |____| |___
__ __ __ __ __
PWMH ____| |____re| |______| |______| |______| |___
__ __ __ __ __ __
PWML |______| |____fe| |______| |______| |______|
In the upper diagram:
- re = rising edge = the delay between D point of the original PWM signal
(rising edge) and the starting point of the next edge of one of the PWM
dead-time engine output
- fe = falling edge = the delay between P point of the original PWM signal
(falling edge) and the starting point of the next edge of one of the PWM
dead-time engine output
To configure the PWM dead-times new inputs were added to sysfs,
in PWM subsystem, one for rising edge dead-time, one for falling
edge deadtime.
root@sama5d2-xplained:/sys/devices/platform/ahb/ahb:apb/f802c000.pwm/pwm/pwmchip0/pwm2# ls -l
-r--r--r-- 1 root root 4096 Feb 10 10:00 capture
-rw-r--r-- 1 root root 4096 Feb 10 10:01 deadtime_fe
-rw-r--r-- 1 root root 4096 Feb 10 10:02 deadtime_re
-rw-r--r-- 1 root root 4096 Feb 10 10:00 duty_cycle
-rw-r--r-- 1 root root 4096 Feb 10 10:00 enable
-rw-r--r-- 1 root root 4096 Feb 10 10:00 period
-rw-r--r-- 1 root root 4096 Feb 10 10:00 polarity
drwxr-xr-x 2 root root 0 Feb 10 10:00 power
-rw-r--r-- 1 root root 4096 Feb 10 10:00 uevent
The PWM dead-times are used in half bridge converters applications.
Thank you,
Claudiu Beznea
Changes since v1:
- fixed compilation warning
Changes since RFC patches:
- corrected the Documentation/pwm.txt
- in atmel-pwm.c check atmel_pwm->regs->dt before computing
dead-times or setting specific registers since the driver is
used by controllers witch supports dead-time configuration and
controller which does not.
Claudiu Beznea (2):
drivers: pwm: core: implement pwm dead-times
drivers: pwm: pwm-atmel: implement pwm dead-times
Documentation/pwm.txt | 55 ++++++++++++++++++++++++++++++++++++
drivers/pwm/core.c | 10 ++++++-
drivers/pwm/pwm-atmel.c | 62 ++++++++++++++++++++++++++++++++++++++---
drivers/pwm/sysfs.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/pwm.h | 36 ++++++++++++++++++++++++
5 files changed, 232 insertions(+), 5 deletions(-)
--
2.7.4
next reply other threads:[~2017-05-09 8:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 8:19 Claudiu Beznea [this message]
2017-05-09 8:19 ` [PATCH v2 1/2] drivers: pwm: core: implement pwm dead-times Claudiu Beznea
2017-05-27 22:28 ` Andy Shevchenko
2017-05-30 10:20 ` m18063
2017-05-09 8:19 ` [PATCH v2 2/2] drivers: pwm: pwm-atmel: " Claudiu Beznea
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=1494317990-9131-1-git-send-email-claudiu.beznea@microchip.com \
--to=claudiu.beznea@microchip.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=boris.brezillon@free-electrons.com \
--cc=corbet@lwn.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®