aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/arm/idle-states.txt6
-rw-r--r--drivers/cpuidle/dt_idle_states.c7
2 files changed, 12 insertions, 1 deletions
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:
331 If the property is not present the idle-state must 331 If the property is not present the idle-state must
332 be considered operational. 332 be considered operational.
333 333
334 - idle-state-name:
335 Usage: Optional
336 Value type: <string>
337 Definition: A string used as a descriptive name for the idle
338 state.
339
334 In addition to the properties listed above, a state node may require 340 In addition to the properties listed above, a state node may require
335 additional properties specifics to the entry-method defined in the 341 additional properties specifics to the entry-method defined in the
336 idle-states node, please refer to the entry-method bindings 342 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,
27{ 27{
28 int err; 28 int err;
29 const struct of_device_id *match_id; 29 const struct of_device_id *match_id;
30 const char *desc;
30 31
31 match_id = of_match_node(matches, state_node); 32 match_id = of_match_node(matches, state_node);
32 if (!match_id) 33 if (!match_id)
@@ -73,6 +74,10 @@ static int init_state_node(struct cpuidle_state *idle_state,
73 return -EINVAL; 74 return -EINVAL;
74 } 75 }
75 76
77 err = of_property_read_string(state_node, "idle-state-name", &desc);
78 if (err)
79 desc = state_node->name;
80
76 idle_state->flags = CPUIDLE_FLAG_TIME_VALID; 81 idle_state->flags = CPUIDLE_FLAG_TIME_VALID;
77 if (of_property_read_bool(state_node, "local-timer-stop")) 82 if (of_property_read_bool(state_node, "local-timer-stop"))
78 idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP; 83 idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP;
@@ -82,7 +87,7 @@ static int init_state_node(struct cpuidle_state *idle_state,
82 * and desc become string pointers 87 * and desc become string pointers
83 */ 88 */
84 strncpy(idle_state->name, state_node->name, CPUIDLE_NAME_LEN - 1); 89 strncpy(idle_state->name, state_node->name, CPUIDLE_NAME_LEN - 1);
85 strncpy(idle_state->desc, state_node->name, CPUIDLE_DESC_LEN - 1); 90 strncpy(idle_state->desc, desc, CPUIDLE_DESC_LEN - 1);
86 return 0; 91 return 0;
87} 92}
88 93