Messages in this thread | | | Date | Tue, 3 Mar 2015 08:02:51 -0800 | From | Bjorn Andersson <> | Subject | Re: [PATCH 1/4] mfd: devicetree: bindings: Add Qualcomm RPM regulator subnodes |
| |
On Tue 03 Mar 04:47 PST 2015, Mark Brown wrote:
> On Mon, Mar 02, 2015 at 08:25:37PM -0800, Bjorn Andersson wrote: > > > +- compatible: > > + Usage: required > > + Value type: <string> > > + Definition: must be one of: > > + "qcom,rpm-pm8058-regulators" > > + "qcom,rpm-pm8901-regulators" > > + "qcom,rpm-pm8921-regulators" > > Why do these subnodes have a compatible - do they ever appear except as > a child of a parent of the same type of device?
The relationship with the parent node is 1:M;
in the case of 8960/8064 there is only one PMIC controlled by the RPM, hence the dt will look like:
rpm { compatible = "qcom,rpm-apq8960";
regulators { compatible = "qcom,rpm-pm8921-regulators"; ... }; };
But for 8660, and later for e.g. 8974 we have something like:
rpm { compatible = "qcom,rpm-msm8660";
pm8058-regulators { compatible = "qcom,rpm-pm8058-regulators";
vdd_xxx-supply = <&pm8058_s4>; ... };
pm8901-regulators { compatible = "qcom,rpm-pm8901-regulators"; ... }; };
I intended to match these by name, having one rpm-regulator device instance and using desc->regulators_node to match regulators in the right node - with of_node being the rpm node.
But this doesn't really map to reality, as supplies are a property of pm8058 and pm8901 and not of the rpm. I ended up writing some custom device registering code to instantiate the right number of regulator children and give each of them the right of_node etc.
But as several other of-based platforms have a compatible in their regulators node I consider that a viable and cleaner solution.
Regards, Bjorn
| |