On 29/05/14 17:30, Kumar Gala wrote:

On May 29, 2014, at 11:19 AM, Srinivas Kandagatla 
<[email protected]> 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


I agree, there might be a win. But Am not sure to what extent this win is a win to rpm driver, as a side effect this brings other responsibilities to the rpm driver like adding sub-device power management awareness, device life cycle management to the rpm driver.

Only thing which made me think of this approach is the number of sub nodes it would end up with and passing ID using reg property.

Thanks,
srini

- k

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to