lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKohpo=4orAgwVRRvukj+tu67CyVvoUegsJ7eXaCMA9exruqEA@mail.gmail.com>
Date:	Fri, 23 Nov 2012 18:09:23 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Lee Jones <lee.jones@...aro.org>
Cc:	sameo@...ux.intel.com, devicetree-discuss@...ts.ozlabs.org,
	linux-kernel@...r.kernel.org, spear-devel@...t.st.com,
	Vipul Kumar Samar <vipulkumar.samar@...com>
Subject: Re: [PATCH V2 2/2] mfd: stmpe: Extend DT support in stmpe driver

On 23 November 2012 15:06, Lee Jones <lee.jones@...aro.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ