mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Devicetree List <devicetree@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"ks.giri@samsung.com" <ks.giri@samsung.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Courtney Cavin <courtney.cavin@sonymobile.com>,
	Matt Porter <mporter@linaro.org>,
	Craig McGeachie <slapdau@yahoo.com.au>,
	LeyFoon Tan <lftan.linux@gmail.com>,
	Loic Pallardy <loic.pallardy@st.com>,
	"Anna, Suman" <s-anna@ti.com>,
	Ashwin Chaugule <ashwin.chaugule@linaro.org>,
	Bjorn Andersson <bjorn@kryo.se>,
	Patch Tracking <patches@linaro.org>,
	Mollie Wu <mollie.wu@linaro.org>,
	Tetsuya Takinishi <t.takinishi@jp.fujitsu.com>,
	Kevin Hilman <khilman@linaro.org>,
	Lee Jones <lee.jones@linaro.org>,
	Andy Green <andy.green@linaro.org>
Subject: Re: [PATCHv10 4/4] dt: mailbox: add generic bindings
Date: Mon, 4 Aug 2014 15:40:38 +0100	[thread overview]
Message-ID: <20140804144038.GQ30458@sirena.org.uk> (raw)
In-Reply-To: <CAJe_ZhdNjH+eyxMfpAw8Zg1SeZa1qh2ouMnTSress+6Gyr+5qA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1882 bytes --]

On Sat, Aug 02, 2014 at 01:17:18PM +0530, Jassi Brar wrote:
> On 2 August 2014 00:13, Mark Brown <broonie@kernel.org> wrote:
> > On Fri, Aug 01, 2014 at 06:02:45PM +0530, Jassi Brar wrote:

> > Can I suggest that if we do want to avoid strings for some reason (it's
> > not obvious to me why)

> The string and index are both to be taken from DT node of client.

>     pwr_cntrl: power {
>                ...
>                mbox-names = "pwr-ctrl", "rpc";
>                mboxes = <&mailbox 0
>                        &mailbox 1>;
>     };

> The xlate() will map string onto index. So rather than the client
> driver specify, say, "rpc" while requesting mailbox channel, it can
> directly specify index 1.

The whole point with specifying an array of names as well as the array
of mboxes is that you don't then need to do that in the driver code, it
provides a layer of indirection between the array indexes and the
identification of the resources.  This improves the legibility of the
driver (since you're asking for things by name rather than random
number) and DT (since there's a bit less of counting through potentially
long lists and making sure you edit the right entry.  It also makes life
easier if a future version of the binding allows one of the existing
mailboxes to be omitted since you don't need to have blank entries.

> > then we include a recommendation to provide
> > defines in a header file in order to improve legibility.  That's pretty
> > minor, though.

> Sorry I don't understand.

If there's defines in the DT header files (which would hopefully go
along with the bindings in some future where we actually split the
bindings out) then the driver can use those names rather than having
numbers in it.

While I think about it it would be good to be able to encourage people
to have things like <&mailbox 0> being able to be written as <&mailbox
NAME>.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-08-04 14:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-01 12:29 [PATCHv10 0/4] Common Mailbox Framework Jassi Brar
2014-08-01 12:30 ` [PATCHv10 1/4] mailbox: rename pl320-ipc specific mailbox.h Jassi Brar
2014-08-01 18:27   ` Mark Brown
2014-08-01 12:31 ` [PATCHv10 2/4] mailbox: Introduce framework for mailbox Jassi Brar
2014-08-01 18:37   ` Mark Brown
2014-08-02  7:50     ` Jassi Brar
2014-09-22 18:01   ` Ashwin Chaugule
2014-09-22 18:15     ` Sudeep Holla
2014-09-22 18:33       ` Sudeep Holla
2014-09-24 16:14         ` Ashwin Chaugule
2014-09-26  0:57           ` Jassi Brar
2014-09-26 15:43             ` Ashwin Chaugule
2014-08-01 12:32 ` [PATCHv10 3/4] doc: add documentation for mailbox framework Jassi Brar
2014-08-01 12:32 ` [PATCHv10 4/4] dt: mailbox: add generic bindings Jassi Brar
2014-08-01 18:43   ` Mark Brown
2014-08-02  7:47     ` Jassi Brar
2014-08-04 14:40       ` Mark Brown [this message]
2014-08-01 18:26 ` [PATCHv10 0/4] Common Mailbox Framework Mark Brown
2014-08-02  7:48   ` Jassi Brar
2014-09-09 16:23     ` Suman Anna
2014-09-09 16:57       ` Mark Brown

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=20140804144038.GQ30458@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=andy.green@linaro.org \
    --cc=arnd@arndb.de \
    --cc=ashwin.chaugule@linaro.org \
    --cc=bjorn@kryo.se \
    --cc=courtney.cavin@sonymobile.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jaswinder.singh@linaro.org \
    --cc=khilman@linaro.org \
    --cc=ks.giri@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=lftan.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    --cc=mark.rutland@arm.com \
    --cc=mollie.wu@linaro.org \
    --cc=mporter@linaro.org \
    --cc=patches@linaro.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=s-anna@ti.com \
    --cc=slapdau@yahoo.com.au \
    --cc=t.takinishi@jp.fujitsu.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®