aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_idle.c
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>2008-02-11 20:46:31 -0500
committerLen Brown <len.brown@intel.com>2008-02-14 00:09:55 -0500
commit4fcb2fcd4d0678b8ae103d257dcb28074cbfc7fa (patch)
tree54bcf486976184804c8fc786d09a04e1ce26ef99 /drivers/acpi/processor_idle.c
parente760e716d47b48caf98da348368fd41b4a9b9e7e (diff)
ACPI, cpuidle: Clarify C-state description in sysfs
Add a new sysfs entry under cpuidle states. desc - can be used by driver to communicate to userspace any specific information about the state. This helps in identifying the exact hardware C-states behind the ACPI C-state definition. Idea is to export this through powertop, which will help to map the C-state reported by powertop to actual hardware C-state. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r--drivers/acpi/processor_idle.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 32003fdc91e8..baa389b908e2 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -945,11 +945,16 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
945 * Otherwise, ignore this info and continue. 945 * Otherwise, ignore this info and continue.
946 */ 946 */
947 cx.entry_method = ACPI_CSTATE_HALT; 947 cx.entry_method = ACPI_CSTATE_HALT;
948 snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI HLT");
948 } else { 949 } else {
949 continue; 950 continue;
950 } 951 }
952 } else {
953 snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI IOPORT 0x%x",
954 cx.address);
951 } 955 }
952 956
957
953 obj = &(element->package.elements[2]); 958 obj = &(element->package.elements[2]);
954 if (obj->type != ACPI_TYPE_INTEGER) 959 if (obj->type != ACPI_TYPE_INTEGER)
955 continue; 960 continue;
@@ -1643,6 +1648,11 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
1643 return -EINVAL; 1648 return -EINVAL;
1644 } 1649 }
1645 1650
1651 for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
1652 dev->states[i].name[0] = '\0';
1653 dev->states[i].desc[0] = '\0';
1654 }
1655
1646 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { 1656 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
1647 cx = &pr->power.states[i]; 1657 cx = &pr->power.states[i];
1648 state = &dev->states[count]; 1658 state = &dev->states[count];
@@ -1659,6 +1669,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
1659 cpuidle_set_statedata(state, cx); 1669 cpuidle_set_statedata(state, cx);
1660 1670
1661 snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i); 1671 snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i);
1672 strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
1662 state->exit_latency = cx->latency; 1673 state->exit_latency = cx->latency;
1663 state->target_residency = cx->latency * latency_factor; 1674 state->target_residency = cx->latency * latency_factor;
1664 state->power_usage = cx->power; 1675 state->power_usage = cx->power;