aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-11-21 10:26:49 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-11-21 10:26:49 -0500
commita74a5a3381c0f600d390e3997976c4ddf31417ab (patch)
tree74f6a5d328f8d0f5026db63d5760c355bf938cc5
parentfc14f9c1272f62c3e8d01300f52467c0d9af50f9 (diff)
parent18f95a3640dbf421ab9532e517070a0c1cd4d582 (diff)
Merge branch 'cpuidle/3.19' of http://git.linaro.org/git-ro/people/daniel.lezcano/linux into pm-cpuidle
Pull ARM cpuidle material for 3.19-rc1 from Daniel Lezcano. * 'cpuidle/3.19' of http://git.linaro.org/git-ro/people/daniel.lezcano/linux: drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages drivers: cpuidle: Add idle-state-name description to ARM idle states drivers: cpuidle: Add status property to ARM idle states
-rw-r--r--Documentation/devicetree/bindings/arm/idle-states.txt20
-rw-r--r--drivers/cpuidle/cpuidle-arm64.c13
-rw-r--r--drivers/cpuidle/dt_idle_states.c10
3 files changed, 31 insertions, 12 deletions
diff --git a/Documentation/devicetree/bindings/arm/idle-states.txt b/Documentation/devicetree/bindings/arm/idle-states.txt
index 37375c7f3ccc..a8274eabae2e 100644
--- a/Documentation/devicetree/bindings/arm/idle-states.txt
+++ b/Documentation/devicetree/bindings/arm/idle-states.txt
@@ -317,6 +317,26 @@ follows:
317 In such systems entry-latency-us + exit-latency-us 317 In such systems entry-latency-us + exit-latency-us
318 will exceed wakeup-latency-us by this duration. 318 will exceed wakeup-latency-us by this duration.
319 319
320 - status:
321 Usage: Optional
322 Value type: <string>
323 Definition: A standard device tree property [5] that indicates
324 the operational status of an idle-state.
325 If present, it shall be:
326 "okay": to indicate that the idle state is
327 operational.
328 "disabled": to indicate that the idle state has
329 been disabled in firmware so it is not
330 operational.
331 If the property is not present the idle-state must
332 be considered operational.
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
320 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
321 additional properties specifics to the entry-method defined in the 341 additional properties specifics to the entry-method defined in the
322 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/cpuidle-arm64.c b/drivers/cpuidle/cpuidle-arm64.c
index 50997ea942fc..1b10f92ecd5a 100644
--- a/drivers/cpuidle/cpuidle-arm64.c
+++ b/drivers/cpuidle/cpuidle-arm64.c
@@ -104,11 +104,8 @@ static int __init arm64_idle_init(void)
104 * reason to initialize the idle driver if only wfi is supported. 104 * reason to initialize the idle driver if only wfi is supported.
105 */ 105 */
106 ret = dt_init_idle_driver(drv, arm64_idle_state_match, 1); 106 ret = dt_init_idle_driver(drv, arm64_idle_state_match, 1);
107 if (ret <= 0) { 107 if (ret <= 0)
108 if (ret)
109 pr_err("failed to initialize idle states\n");
110 return ret ? : -ENODEV; 108 return ret ? : -ENODEV;
111 }
112 109
113 /* 110 /*
114 * Call arch CPU operations in order to initialize 111 * Call arch CPU operations in order to initialize
@@ -122,12 +119,6 @@ static int __init arm64_idle_init(void)
122 } 119 }
123 } 120 }
124 121
125 ret = cpuidle_register(drv, NULL); 122 return cpuidle_register(drv, NULL);
126 if (ret) {
127 pr_err("failed to register cpuidle driver\n");
128 return ret;
129 }
130
131 return 0;
132} 123}
133device_initcall(arm64_idle_init); 124device_initcall(arm64_idle_init);
diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c
index 52f4d11bbf3f..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
@@ -169,6 +174,9 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
169 if (!state_node) 174 if (!state_node)
170 break; 175 break;
171 176
177 if (!of_device_is_available(state_node))
178 continue;
179
172 if (!idle_state_valid(state_node, i, cpumask)) { 180 if (!idle_state_valid(state_node, i, cpumask)) {
173 pr_warn("%s idle state not valid, bailing out\n", 181 pr_warn("%s idle state not valid, bailing out\n",
174 state_node->full_name); 182 state_node->full_name);