From: Frank Rowand <frowand.list@gmail.com>
To: Courtney Cavin <courtney.cavin@sonymobile.com>
Cc: "Ivan T. Ivanov" <iivanov@mm-sol.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>,
Josh Cartwright <joshc@codeaurora.org>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH 1/2] mfd: pm8x41: add support for Qualcomm 8x41 PMICs
Date: Fri, 25 Apr 2014 17:53:39 -0700 [thread overview]
Message-ID: <535B0393.1080300@gmail.com> (raw)
In-Reply-To: <20140426004048.GQ17066@sonymobile.com>
On 4/25/2014 5:40 PM, Courtney Cavin wrote:
> On Sat, Apr 26, 2014 at 02:28:06AM +0200, Frank Rowand wrote:
>> On 4/23/2014 6:19 AM, Ivan T. Ivanov wrote:
> [...]
>>>> +static int pm8x41_probe(struct spmi_device *sdev)
>>>> +{
>>>> + struct regmap *regmap;
>>>> +
>>>> + regmap = devm_regmap_init_spmi_ext(sdev, &pm8x41_regmap_config);
>>>> + if (IS_ERR(regmap)) {
>>>> + dev_dbg(&sdev->dev, "regmap creation failed.\n");
>>>> + return PTR_ERR(regmap);
>>>> + }
>>>> +
>>>> + return of_platform_populate(sdev->dev.of_node, NULL, NULL, &sdev->dev);
>>>
>>> I think that this will not going to work. For example in this particular
>>> case, both controllers have "qcom,qpnp-revid" peripheral which is
>>> located at offset 0x100.
>>>
>>> And the result is:
>>>
>>> [ 0.963944] sysfs: cannot create duplicate filename '/bus/platform/devices/100.revid'
>>
>> The duplicate filename error is because pm8x41_probe() is calling of_platform_populate()
>> directly.
>>
>> If that call is removed then there is no attempt to create a revid file in
>> /sys/bus/platform/devices. If I add your pm8841@4 node to my dts file, then
>> the 100.revid file is properly created at
>>
>> /sys/firmware/devicetree/base/soc/qcom,spmi@fc4cf000/pm8841@4/qcom,revid@100
>>
>> and no attempt is made to create /sys/bus/platform/devices/100.revid
>>
>> This appears to be correct to me, because I do not think revid should be created as
>> a platform device.
>>
>
> Wait, what? That's the entire point of this driver.
>
> [...]
>>> Any suggestions?
>>
>> Remove of_platform_populate() from pm8x41_probe(). Do you know of any
>> other reason it can not be removed?
>
> I do! If you remove it, the entire driver becomes a useless pile of
> nothing!
>
> The PMICs targeted by this driver are mostly made up of independent
> blocks which should be able to be written as standalone device drivers.
> The design of this driver is to create a simple bus-like layer between
> SPMI and these independent blocks. of_platform_populate() is what makes
> it work.
>
> -Courtney
>
Hmmmm, yet another device tree conceptual thing for me to grok. I'll go
off and see if a bus-like layer can exist without being a platform device.
-Frank
next prev parent reply other threads:[~2014-04-26 0:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-23 0:31 [PATCH 1/2] mfd: pm8x41: add support for Qualcomm 8x41 PMICs Courtney Cavin
2014-04-23 0:31 ` [PATCH 2/2] mfd: pm8x41: document device tree bindings Courtney Cavin
2014-04-23 10:50 ` [PATCH 1/2] mfd: pm8x41: add support for Qualcomm 8x41 PMICs Lee Jones
2014-04-23 17:38 ` Courtney Cavin
2014-04-23 13:19 ` Ivan T. Ivanov
2014-04-23 18:16 ` Courtney Cavin
2014-04-23 20:34 ` Ivan T. Ivanov
2014-04-23 22:12 ` Courtney Cavin
2014-04-24 2:45 ` Rob Herring
2014-04-26 0:28 ` Frank Rowand
2014-04-26 0:40 ` Courtney Cavin
2014-04-26 0:53 ` Frank Rowand [this message]
2014-04-28 7:11 ` Ivan T. Ivanov
2014-05-07 18:35 ` Rob Herring
2014-04-23 21:46 ` Josh Cartwright
2014-04-23 23:36 ` Courtney Cavin
2014-04-24 18:18 ` Josh Cartwright
2014-05-09 12:45 ` Ivan T. Ivanov
2014-05-09 20:30 ` Courtney Cavin
2014-05-10 8:06 ` Ivan T. Ivanov
2014-04-26 1:38 ` David Collins
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=535B0393.1080300@gmail.com \
--to=frowand.list@gmail.com \
--cc=courtney.cavin@sonymobile.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=iivanov@mm-sol.com \
--cc=joshc@codeaurora.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sameo@linux.intel.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).