From: Pavel Machek <pavel@ucw.cz>
To: Bill Gatliff <bgat@billgatliff.com>
Cc: linux-embedded@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PWM PATCH 1/5] API to consolidate PWM devices behind a common user and kernel interface
Date: Thu, 11 Feb 2010 21:04:56 +0100 [thread overview]
Message-ID: <20100211200456.GA1487@ucw.cz> (raw)
In-Reply-To: <c5873aa7c5d20254a9e54fc1ff179345b77c16b5.1265094517.git.bgat@billgatliff.com>
Hi!
> +Challenges
> +
> +One of the difficulties in implementing a generic PWM framework is the
> +fact that pulse-width-modulation applications involve real-world
> +signals, which often must be carefully managed to prevent destruction
> +of hardware that is linked to those signals. A DC motor that
> +experiences a brief interruption in the PWM signal controlling it
> +might destructively overheat; it could suddenly change speed, losing
> +synchronization with a sensor; it could even suddenly change direction
> +or torque, breaking the mechanical device connected to it.
Stop right here. Linux is not hard realtime os, nor is it an os that
never crashes.
> +(A generic PWM device framework is not directly responsible for
> +preventing the above scenarios: that responsibility lies with the
> +hardware designer, and the application and driver authors. But it
Exactly; if your hw can be damaged by software, it was misdesigned.
Is the paragraph #1 really neccessary?
> +Using the API to Generate PWM Signals -- Basic Functions for Users
> +
> +
> +pwm_request() -- Returns a pwm_channel pointer, which is subsequently
> +passed to the other user-related PWM functions. Once requested, a PWM
> +channel is marked as in-use and subsequent requests prior to
> +pwm_free() will fail.
> +
> +The names used to refer to PWM devices are defined by driver authors.
> +Typically they are platform device bus identifiers, and this
> +convention is encouraged for consistency.
> +
> +
> +pwm_free() -- Marks a PWM channel as no longer in use. The PWM device
> +is stopped before it is released by the API.
free is normally used for something else. Rename to open/close?
> +pwm_start(), pwm_stop() -- Turns the PWM signal on and off. Except
> +where stated otherwise by a driver author, signals are stopped at the
> +end of the current period, at which time the output is set to its
> +inactive state.
What does it mean to stop a signal? What is the difference between 0%
duty cycle and stop() ?
> +pwm_polarity() -- Defines whether the PWM signal output's active
> +region is "1" or "0". A 10% duty-cycle, polarity=1 signal will
> +conventionally be at 5V (or 3.3V, or 1000V, or whatever the platform
> +hardware does) for 10% of the period. The same configuration of a
> +polarity=0 signal will be at 5V (or 3.3V, or ...) for 90% of the
> +period.
Is polarity realy required? Can't driver just replace duty with
100%-duty?
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2010-02-11 20:04 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-02 7:14 [PWM PATCH 0/5] Implements a common PWM API Bill Gatliff
2010-02-02 7:14 ` [PWM PATCH 1/5] API to consolidate PWM devices behind a common user and kernel interface Bill Gatliff
2010-02-02 7:14 ` [PWM PATCH 2/5] Emulates PWM hardware using a high-resolution timer and a GPIO pin Bill Gatliff
2010-02-02 7:14 ` [PWM PATCH 3/5] Expunge old Atmel PWMC driver, replacing it with one that conforms to the PWM API Bill Gatliff
2010-02-02 7:14 ` [PWM PATCH 4/5] PWM-based LED control Bill Gatliff
2010-02-02 7:14 ` [PWM PATCH 5/5] LED "dimmer" trigger Bill Gatliff
2010-02-02 7:16 ` [PWM PATCH 3/5] Expunge old Atmel PWMC driver, replacing it with one that conforms to the PWM API Bill Gatliff
2010-02-02 17:52 ` H Hartley Sweeten
2010-02-03 4:10 ` Bill Gatliff
2010-02-11 20:07 ` [PWM PATCH 2/5] Emulates PWM hardware using a high-resolution timer and a GPIO pin Pavel Machek
2010-02-11 20:35 ` Bill Gatliff
2010-02-11 20:58 ` Pavel Machek
2010-02-12 7:22 ` Stanislav O. Bezzubtsev
2010-02-12 13:13 ` Geert Uytterhoeven
2010-02-12 13:41 ` Pavel Machek
2010-02-12 13:53 ` H Hartley Sweeten
2010-02-12 16:26 ` Bill Gatliff
2010-02-16 18:12 ` H Hartley Sweeten
2010-02-02 18:20 ` [PWM PATCH 1/5] API to consolidate PWM devices behind a common user and kernel interface H Hartley Sweeten
2010-02-03 4:12 ` Bill Gatliff
2010-02-04 1:39 ` H Hartley Sweeten
2010-02-04 5:31 ` Bill Gatliff
2010-02-04 17:30 ` Bill Gatliff
2010-02-11 20:04 ` Pavel Machek [this message]
2010-02-11 20:51 ` Bill Gatliff
2010-02-11 21:00 ` Pavel Machek
2010-02-02 17:44 ` [PWM PATCH 0/5] Implements a common PWM API H Hartley Sweeten
2010-02-03 4:08 ` Bill Gatliff
2010-02-04 23:20 ` H Hartley Sweeten
2010-02-05 18:53 ` Bill Gatliff
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=20100211200456.GA1487@ucw.cz \
--to=pavel@ucw.cz \
--cc=bgat@billgatliff.com \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-kernel@vger.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).