From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Bjorn Andersson <bjorn@kryo.se>
Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Josh Cartwright <joshc@codeaurora.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH 1/3] mfd: devicetree: bindings: Add Qualcomm RPM DT binding
Date: Thu, 29 May 2014 22:25:59 +0100 [thread overview]
Message-ID: <5387A5E7.5040905@linaro.org> (raw)
In-Reply-To: <CAJAp7Ogi8s+_HHUA0zt3dM6ssDHxeQ1xNFvvO7AbSyz9o6n+9w@mail.gmail.com>
On 29/05/14 19:38, Bjorn Andersson wrote:
> On Thu, May 29, 2014 at 9:19 AM, Srinivas Kandagatla
> <srinivas.kandagatla@linaro.org> wrote:
>>> +- reg:
>>> + Usage: required
>>> + Value type: <prop-encoded-array>
>>> + Definition: two entries specifying the RPM's message ram and ipc
>>> register
>>> +
>>> +- reg-names:
>>> + Usage: required
>>> + Value type: <string-array>
>>> + Definition: must contain the following, in order:
>>> + "msg_ram"
>>> + "ipc"
>>
>>
>> +1 for kumar's comment.
>>
>> cant enforce the order here. should fix it in the driver.
>>
>
> Yes I can, this is as decided by the devicetree maintainers. The order
> of e.g. reg and interrupts must be defined.
>
Does not make sense. Unless Am missing something obvious.
Having reg-names/interrupt-names would give driver flexibility to get
the resources by name, as long as the order of reg and reg-names match.
So the order of reg is really not really necessary. Unless the driver is
coded to access it via index.
Hardly 1/2 bindings documents enforce this.
>>> += SUBDEVICES
>>> +
>>> +The RPM exposes resources to its subnodes. The below bindings specify the
>>> set
>>> +of valid subnodes that can operate on these resources.
>>
>>
>> Why should these devices be on sub nodes?
>>
>> Any reason not to implement it like this,
>>
>> rpm: rpm@108000 {
>> compatible = "qcom,rpm-msm8960";
>>
>> reg = <0x108000 0x1000 0x2011008 0x4>;
>>
>> interrupts = <0 19 0>, <0 21 0>, <0 22 0>;
>> interrupt-names = "ack", "err", "wakeup";
>> };
>>
>> pm8921_s1: pm8921-s1 {
>> compatible = "qcom,rpm-pm8921-smps";
>>
>> regulator-min-microvolt = <1225000>;
>> regulator-max-microvolt = <1225000>;
>> regulator-always-on;
>>
>> qcom,rpm = <&rpm QCOM_RPM_PM8921_S1>;
>> qcom,switch-mode-frequency = <3200000>;
>> qcom,hpm-threshold = <100000>;
>> };
>>
>> This would simplify the driver code too and handle the interface neatly then
>> depending on device hierarchy.
>> rpm would be a interface library to the clients. Makes the drivers more
>> independent, and re-usable if we do this way.
>
> The subnodes doesn't describe separate pieces of hardware but rather
> pieces of the rpm, that's why they should live inside the rpm. There
> will not be any re-use of these drivers outside having a rpm as
> parent.
>
> I do have some patches for family b, where I'm moving things around a
> little bit in the implementation to be able to re-use child-devices
> where that makes sense (clock implementation is the same for the two).
> But that is implementation specific and does not affect the dt.
>
Good point, Am more of thinking of some other SOCs might have similar pmic.
>
> Implementation wise, having the individual subnodes as children in the
> device model makes a lot of sense, as the children should be probed
> when the rpm appears and when the rpm goes away it should bring down
> all subnodes. If there was any power management it would be the same
> thing.
Thats great, you have already thought about it.
>
> So I think this makes for a cleaner implementation; all I need to do
> is to call of_platform_populate at the end of the probe and in remove
> I need to tell the children that they should go away. I do not need to
> support any phandle based lookups and separate life cycle management.
>
Am ok with either approaches.
>>
>> [...
>>
>>> +- qcom,force-mode-none:
>>> + Usage: optional (default if no other qcom,force-mode is specified)
>>> + Value type: <empty>
>>> + Defintion: indicates that the regulator should not be forced to
>>> any
>>> + particular mode
>>> +
>>> +- qcom,force-mode-lpm:
>>> + Usage: optional
>>> + Value type: <empty>
>>> + Definition: indicates that the regulator should be forced to
>>> operate in
>>> + low-power-mode
>>> +
>>> +- qcom,force-mode-auto:
>>> + Usage: optional (only available for 8960/8064)
>>> + Value type: <empty>
>>> + Definition: indicates that the regulator should be automatically
>>> pick
>>> + operating mode
>>> +
>>> +- qcom,force-mode-hpm:
>>> + Usage: optional (only available for 8960/8064)
>>> + Value type: <empty>
>>> + Definition: indicates that the regulator should be forced to
>>> operate in
>>> + high-power-mode
>>> +
>>> +- qcom,force-mode-bypass: (only for 8960/8064)
>>> + Usage: optional (only available for 8960/8064)
>>> + Value type: <empty>
>>> + Definition: indicates that the regulator should be forced to
>>> operate in
>>> + bypass mode
>>> +
>>
>> ...]
>>
>> Probably qcom,force-mode:
>> Usage: optional.
>> Value type: <string>
>>
>> Definition: must be one of:
>> "none"
>> "lpm"
>> "auto"
>> "hpm"
>> "bypass"
>>
>> Makes it much simpler, as they seems to be mutually exclusive. simillar
>> comments apply to other bindings too.
>
> Please see my answer to Kumar.
>
Ok. I don’t have a strong feeling on any of those 3 approaches.
Thanks,
srini
>
> Thanks for the comments!
>
> Regards,
> Bjorn
>
next prev parent reply other threads:[~2014-05-29 21:25 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-27 17:28 [PATCH 0/3] Qualcomm Resource Power Manager driver Bjorn Andersson
2014-05-27 17:28 ` [PATCH 1/3] mfd: devicetree: bindings: Add Qualcomm RPM DT binding Bjorn Andersson
2014-05-28 16:34 ` Kumar Gala
2014-05-29 18:24 ` Bjorn Andersson
2014-05-29 22:32 ` Frank Rowand
2014-05-29 16:19 ` Srinivas Kandagatla
2014-05-29 16:30 ` Kumar Gala
2014-05-29 17:09 ` Srinivas Kandagatla
2014-05-29 18:38 ` Bjorn Andersson
2014-05-29 21:25 ` Srinivas Kandagatla [this message]
2014-05-29 16:54 ` Lee Jones
2014-05-29 19:05 ` Bjorn Andersson
2014-05-27 17:28 ` [PATCH 2/3] mfd: qcom-rpm: Driver for the Qualcomm RPM Bjorn Andersson
2014-05-29 16:19 ` Srinivas Kandagatla
2014-05-29 19:45 ` Bjorn Andersson
2014-05-29 21:41 ` Srinivas Kandagatla
2014-05-29 22:11 ` Bjorn Andersson
2014-05-27 17:28 ` [PATCH 3/3] regulator: qcom-rpm: Regulator driver " Bjorn Andersson
2014-05-28 16:55 ` Mark Brown
2014-05-29 21:03 ` Bjorn Andersson
2014-05-29 21:18 ` Mark Brown
2014-05-29 21:59 ` Bjorn Andersson
2014-05-29 22:04 ` Mark Brown
2014-05-28 16:23 ` [PATCH 0/3] Qualcomm Resource Power Manager driver Kumar Gala
2014-05-28 16:59 ` Bjorn Andersson
2014-05-28 17:06 ` Kumar Gala
[not found] ` <8CA95B37-E5EE-46BE-ABFD-64AA3BBF4E96-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2014-05-29 18:14 ` Bjorn Andersson
2014-06-02 8:15 ` Stanimir Varbanov
2014-06-02 10:01 ` 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=5387A5E7.5040905@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=bjorn.andersson@sonymobile.com \
--cc=bjorn@kryo.se \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=joshc@codeaurora.org \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.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).