On May 29, 2014, at 11:19 AM, Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> wrote:
+= 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.
??
One reason to go with sub nodes is it creates a proper driver ordering dependency as I assume rpm driver will end up calling of_platform_populate for the sub nodes at the point that the RPM driver is ready. We could do this with deferred probe but doing it explicitly is better in my opinion as it limits the amount of time between when RPM is ready vs when the children can start doing things
- k--