From 97735da074fdd3fe39d975cad8760807df0d4388 Mon Sep 17 00:00:00 2001 From: Lorenzo Pieralisi Date: Wed, 15 Oct 2014 16:50:52 +0100 Subject: drivers: cpuidle: Add status property to ARM idle states 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 Signed-off-by: Lorenzo Pieralisi Signed-off-by: Daniel Lezcano --- Documentation/devicetree/bindings/arm/idle-states.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Documentation/devicetree') diff --git a/Documentation/devicetree/bindings/arm/idle-states.txt b/Documentation/devicetree/bindings/arm/idle-states.txt index 37375c7f3ccc..5e5151130c20 100644 --- a/Documentation/devicetree/bindings/arm/idle-states.txt +++ b/Documentation/devicetree/bindings/arm/idle-states.txt @@ -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: + 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 -- cgit v1.2.3-59-g8ed1b From c00bc5df7c01a189843cb048cf29e2a445e0037a Mon Sep 17 00:00:00 2001 From: Lorenzo Pieralisi Date: Wed, 15 Oct 2014 16:57:34 +0100 Subject: drivers: cpuidle: Add idle-state-name description to ARM idle states On ARM machines, where generally speaking the idle state numbering has no fixed and standard meaning it is useful to provide a description of the idle state inner workings for benchmarking and monitoring purposes. This patch adds a property to the idle states bindings that if present gives platform firmware a means of describing the idle state and export the string description to user space. The patch updates the DT parsing code accordingly to take the description, if present, into consideration. Acked-by: Kevin Hilman Signed-off-by: Lorenzo Pieralisi Signed-off-by: Daniel Lezcano --- Documentation/devicetree/bindings/arm/idle-states.txt | 6 ++++++ drivers/cpuidle/dt_idle_states.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'Documentation/devicetree') diff --git a/Documentation/devicetree/bindings/arm/idle-states.txt b/Documentation/devicetree/bindings/arm/idle-states.txt index 5e5151130c20..a8274eabae2e 100644 --- a/Documentation/devicetree/bindings/arm/idle-states.txt +++ b/Documentation/devicetree/bindings/arm/idle-states.txt @@ -331,6 +331,12 @@ follows: If the property is not present the idle-state must be considered operational. + - idle-state-name: + Usage: Optional + Value type: + Definition: A string used as a descriptive name for the idle + state. + 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 diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c index 22840f40283c..5301912cb84e 100644 --- a/drivers/cpuidle/dt_idle_states.c +++ b/drivers/cpuidle/dt_idle_states.c @@ -27,6 +27,7 @@ static int init_state_node(struct cpuidle_state *idle_state, { int err; const struct of_device_id *match_id; + const char *desc; match_id = of_match_node(matches, state_node); if (!match_id) @@ -73,6 +74,10 @@ static int init_state_node(struct cpuidle_state *idle_state, return -EINVAL; } + err = of_property_read_string(state_node, "idle-state-name", &desc); + if (err) + desc = state_node->name; + idle_state->flags = CPUIDLE_FLAG_TIME_VALID; if (of_property_read_bool(state_node, "local-timer-stop")) idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP; @@ -82,7 +87,7 @@ static int init_state_node(struct cpuidle_state *idle_state, * and desc become string pointers */ strncpy(idle_state->name, state_node->name, CPUIDLE_NAME_LEN - 1); - strncpy(idle_state->desc, state_node->name, CPUIDLE_DESC_LEN - 1); + strncpy(idle_state->desc, desc, CPUIDLE_DESC_LEN - 1); return 0; } -- cgit v1.2.3-59-g8ed1b