linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Courbot <acourbot@nvidia.com>
To: Thierry Reding <thierry.reding@avionic-design.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree-discuss@lists.ozlabs.org" 
	<devicetree-discuss@lists.ozlabs.org>
Subject: Use of the pwm-names DT property
Date: Wed, 4 Jul 2012 15:53:22 +0900	[thread overview]
Message-ID: <4FF3E862.8050101@nvidia.com> (raw)

Hi Thierry,

Looking at your PWM/DT integration patches for linux-next, I was 
wondering what is the rationale behind using the pwm-names property. If 
I got it correctly, its purpose is to be able to reference different 
PWMs by name, e.g. by having

	pwms = <&pwm 0 5000000>, <&pwm 1 5000000>;
	pwm-names = "backlight", "flash";

You could get the first PWM in the driver code by calling pwm_get(dev, 
"backlight") and the second through pwm_get(dev, "flash").

While I am ok with this way of doing, why not having the form that is 
already used by the regulator and gpio frameworks, in which the consumer 
is part of the property name?

	vdd-supply = <&vdd_reg>;
	core-supply = <&core_reg>;

Both regulators are then accessed using regulator_get(dev, "vdd") and 
regulator_get(dev, "core").

Wouldn't it make more sense to follow the same scheme that has been 
popularized by other frameworks? It also has the advantage that you do 
not need to maintain two different properties which must be the same size.

Thanks,
Alex.

             reply	other threads:[~2012-07-04  6:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04  6:53 Alex Courbot [this message]
2012-07-04  7:39 ` Use of the pwm-names DT property Thierry Reding
2012-07-04  7:48   ` Alex Courbot

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=4FF3E862.8050101@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@avionic-design.de \
    /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).