From: Grant Erickson <marathon96@gmail.com>
To: Kevin Hilman <khilman@deeprootsystems.com>
Cc: linux-omap@vger.kernel.org, Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH] Add OMAP Support for Generic PWM Devices using Dual-mode Timers
Date: Tue, 16 Nov 2010 10:13:43 -0800 [thread overview]
Message-ID: <C90809D7.1FED0%marathon96@gmail.com> (raw)
In-Reply-To: <874obhi4nb.fsf@deeprootsystems.com>
On 11/16/10 9:01 AM, Kevin Hilman wrote:
> Grant Erickson <marathon96@gmail.com> writes:
>> This patch adds support to request and use one or more of the OMAP
>> dual-mode timers as a generic PWM device compatible with other generic
>> PWM drivers such as the PWM backlight or PWM beeper driver.
>
> How will this co-exist with the PWM on the twl6030 PMIC
> (drivers/mfd/twl6030-pwm.c.)? Both are exporting the same API.
That's an excellent question. This driver started life in the 2.6.32 tree
where twl6030-pwm.c didn't exist. Thanks for the heads-up.
The right short-term solution is to probably change the configuration from:
config HAVE_PWM
to:
config OMAP_PWM
select HAVE_PWM
and then have it conflict with TWL6030_PWM if that's enabled.
> Regarding multilpe PWM drivers, there has been discussion on the
> linux-embedded list[1] regarding a more generic PWM framework, and a few
> other projects working on PWM for OMAP[2]. Someone needs to step up and
> consolidate/push this work forward as there is a clear need for a more
> generic PWM infrastructure on various SoCs. Your work is another
> example of similar work that needs to be coordinated with the other projects.
>
>> Boards can register such devices using platform data such as in the following
>> example:
>>
>> static struct omap2_pwm_platform_config pwm_config = {
>> .timer_id = 10, // GPT10_PWM_EVT
>> .polarity = 1 // Active-high
>> };
>
> Board code should not have to know which timers are PWM capable. This
> information is fixed at the SoC level.
Fair enough; however, board code does have to know which PWM outputs are
tied to which piece of hardware being driven by it. In the OMAP3, there
isn't an any-to-any mapping of PWM timers to PWM-capable output pins.
So, in this case, I explicitly:
1) configure that pin multiplexer as GPT10_PWM_EVT.
2) make available GPT10_PWM_EVT as a generic PWM because that's the one
precisely tied to the display backlight.
3) ensure that the backlight driver asks for the right generic PWM
associated with it.
> This information is available and is part of the in-progress conversion
> of the timers to use the omap_hwmod infrastructure. There are subsets
> of the timers that have various features (1ms timers, PWM capable, etc.)
> Using hwmod classes, they can be grouped together such that board code
> does not have to know which timers on which SoC are PWM capable. It
> can simply request a timer with certain capabilities.
>
> Kevin
>
> [1] http://marc.info/?l=linux-embedded&m=128594628918269&w=2
> [2] http://marc.info/?l=linux-embedded&m=128599642406671&w=2
I'll take a look at those references.
With the appropriate configuration change to avoid the conflict with
TWL6030-PWM, it's probably better to have this driver in-tree than not.
It'll give those working on the PWM abstraction and rework another working
use case to integrate and work from.
Thanks for the feedback and the references.
Best,
Grant
next prev parent reply other threads:[~2010-11-16 18:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-14 19:28 [PATCH] Add OMAP Support for Generic PWM Devices using Dual-mode Timers Grant Erickson
2010-11-16 12:37 ` Hemanth V
2010-11-16 17:45 ` Grant Erickson
2010-11-17 9:58 ` Hemanth V
2010-11-16 12:42 ` Felipe Balbi
2010-11-16 18:00 ` Grant Erickson
2010-11-16 17:01 ` Kevin Hilman
2010-11-16 18:13 ` Grant Erickson [this message]
2010-11-16 18:43 ` Kevin Hilman
2010-11-16 19:39 ` Grant Erickson
2010-11-16 19:52 ` Kevin Hilman
2010-11-16 20:20 ` Tony Lindgren
2010-11-16 18:54 ` Premi, Sanjeev
2010-11-16 19:11 ` Grant Erickson
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=C90809D7.1FED0%marathon96@gmail.com \
--to=marathon96@gmail.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--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 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).