linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Lee Jones <lee.jones@linaro.org>
Cc: sameo@linux.intel.com, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, spear-devel@list.st.com,
	Vipul Kumar Samar <vipulkumar.samar@st.com>
Subject: Re: [PATCH V2 2/2] mfd: stmpe: Extend DT support in stmpe driver
Date: Fri, 23 Nov 2012 18:09:23 +0530	[thread overview]
Message-ID: <CAKohpo=4orAgwVRRvukj+tu67CyVvoUegsJ7eXaCMA9exruqEA@mail.gmail.com> (raw)
In-Reply-To: <20121123093633.GD17471@gmail.com>

On 23 November 2012 15:06, Lee Jones <lee.jones@linaro.org> wrote:
> On Fri, 23 Nov 2012, Viresh Kumar wrote:
>>       pdev = platform_device_alloc(cell->name, id + cell->id);
>>
>> This is required when we have multiple instances of MFD device present
>> on board. How do you want me to handle this ?
>
> There are lots of examples of this already. I have to leave something
> to the imagination, or I'll be requesting a cut of your salary. :D

My manager already reduced my salary by 20% after reading this mail :(

Ok, this is what my understanding of whole this is. Platform devices are
named like:
- pdev-name: if id passed in pdev.id is -1
- pdev-name.0[1|2|...]: if id passed is 0[1|2|...]
- pdev-name.<dynamically allocated by kernel>: if id passed is -2

Now, we don't declare cell->id fields and they are currently zero and so
value is passed from pdata->id field. So, for example with multiple instances
of stmpe on a board, we have:

- stmpe-0: //Name just for reference...
   - stmpe-gpio.0
   - stmpe-ts.0
- stmpe-1:
   - stmpe-gpio.1
   - stmpe-ts.1
- stmpe-2:
   - stmpe-gpio.2
   - stmpe-ts.2

I main idea is to distinguish various instances of sub modules, like stmpe-gpio.
And this works well with non-DT support we have currently.

With DT, i am not sure how should we pass id field to mfd_add_devices(). If
we pass it -1, then multiple instances will have same name: "stmpe-gpio"

Sorry, for my lack of knowledge. Don't send another mail with salary cut
suggestion as that will make it -40% in total ;)

Thanks for reviewing :)

--
viresh

  reply	other threads:[~2012-11-23 12:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22  5:10 [PATCH V2 1/2] mfd: stmpe: Use devm_*() routines Viresh Kumar
2012-11-22  5:10 ` [PATCH V2 2/2] mfd: stmpe: Extend DT support in stmpe driver Viresh Kumar
2012-11-22 11:24   ` Lee Jones
2012-11-22 13:54     ` Viresh Kumar
2012-11-22 15:46       ` Lee Jones
2012-11-22 17:01         ` Viresh Kumar
2012-11-23  3:45           ` Shiraz Hashim
2012-11-23  9:33             ` Lee Jones
2012-11-23  9:23           ` Lee Jones
2012-11-22 18:31     ` Viresh Kumar
2012-11-23  9:39       ` Lee Jones
2012-11-23  4:29     ` Viresh Kumar
2012-11-23  9:36       ` Lee Jones
2012-11-23 12:39         ` Viresh Kumar [this message]
2012-11-23 15:43           ` Lee Jones
2012-11-23 15:45             ` Viresh Kumar
2012-11-22 10:27 ` [PATCH V2 1/2] mfd: stmpe: Use devm_*() routines Lee Jones
2012-11-22 10:30   ` Viresh Kumar
2012-11-22 17:10   ` Viresh Kumar
2012-11-23  9:40     ` Lee Jones
2012-11-23  9:42       ` Lee Jones
2012-11-23  9:44       ` Viresh Kumar
2012-11-23 11:03 ` Samuel Ortiz

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='CAKohpo=4orAgwVRRvukj+tu67CyVvoUegsJ7eXaCMA9exruqEA@mail.gmail.com' \
    --to=viresh.kumar@linaro.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=spear-devel@list.st.com \
    --cc=vipulkumar.samar@st.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).