drivers: cpuidle: Add status property to ARM idle states
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 15 Oct 2014 15:50:52 +0000 (16:50 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 19 Nov 2014 09:16:15 +0000 (10:16 +0100)
On some platforms the device tree bindings must provide the kernel
with a status flag for idle states, that defines whether the idle
state is operational or not in the current configuration.

This patch adds a status property to the ARM idle states compliant
with ePAPR v1.1 and updates the DT parsing code accordingly.

Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Documentation/devicetree/bindings/arm/idle-states.txt
drivers/cpuidle/dt_idle_states.c

index 37375c7f3ccce580ef6df59e1d1cf3dc475634f0..5e5151130c205375799a53cdd6c77adc2b4d4bfa 100644 (file)
@@ -317,6 +317,20 @@ follows:
                            In such systems entry-latency-us + exit-latency-us
                            will exceed wakeup-latency-us by this duration.
 
+       - status:
+               Usage: Optional
+               Value type: <string>
+               Definition: A standard device tree property [5] that indicates
+                           the operational status of an idle-state.
+                           If present, it shall be:
+                           "okay": to indicate that the idle state is
+                                   operational.
+                           "disabled": to indicate that the idle state has
+                                       been disabled in firmware so it is not
+                                       operational.
+                           If the property is not present the idle-state must
+                           be considered operational.
+
        In addition to the properties listed above, a state node may require
        additional properties specifics to the entry-method defined in the
        idle-states node, please refer to the entry-method bindings
index 52f4d11bbf3f697e8466b82c6667e27e3e04c213..22840f40283cda30c311c6aaf6ce1e9fe489f3fa 100644 (file)
@@ -169,6 +169,9 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
                if (!state_node)
                        break;
 
+               if (!of_device_is_available(state_node))
+                       continue;
+
                if (!idle_state_valid(state_node, i, cpumask)) {
                        pr_warn("%s idle state not valid, bailing out\n",
                                state_node->full_name);