Commit 959a91bd authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Len Brown

[ACPI] add _PDC support

Add support for _PDC to the ACPI processor "Performance States library" 
(perflib). If this field is empty, a bogus entry is passed to the _PDC
method so that the default (io) access is returned again. This patch
is partly based on David Moore's patch to
arch/i386/kernel/cpu/cpufreq/acpi.c, sent to the cpufreq mailing list on
June 24th, 2003.
parent 2f041d0b
...@@ -862,6 +862,33 @@ static void acpi_processor_ppc_exit(void) { ...@@ -862,6 +862,33 @@ static void acpi_processor_ppc_exit(void) {
* acpi_processor_performance. * acpi_processor_performance.
*/ */
static int acpi_processor_set_pdc (struct acpi_processor *pr)
{
acpi_status status = AE_OK;
u32 arg0_buf[3];
union acpi_object arg0 = {ACPI_TYPE_BUFFER};
struct acpi_object_list no_object = {1, &arg0};
struct acpi_object_list *pdc;
ACPI_FUNCTION_TRACE("acpi_processor_set_pdc");
arg0.buffer.length = 12;
arg0.buffer.pointer = (u8 *) arg0_buf;
arg0_buf[0] = ACPI_PDC_REVISION_ID;
arg0_buf[1] = 0;
arg0_buf[2] = 0;
pdc = (pr->performance->pdc) ? pr->performance->pdc : &no_object;
status = acpi_evaluate_object(pr->handle, "_PDC", pdc, NULL);
if ((ACPI_FAILURE(status)) && (pr->performance->pdc))
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Error evaluating _PDC, using legacy perf. control...\n"));
return_VALUE(status);
}
static int static int
acpi_processor_get_performance_control ( acpi_processor_get_performance_control (
struct acpi_processor *pr) struct acpi_processor *pr)
...@@ -1029,6 +1056,8 @@ acpi_processor_get_performance_info ( ...@@ -1029,6 +1056,8 @@ acpi_processor_get_performance_info (
return_VALUE(-ENODEV); return_VALUE(-ENODEV);
} }
acpi_processor_set_pdc(pr);
result = acpi_processor_get_performance_control(pr); result = acpi_processor_get_performance_control(pr);
if (result) if (result)
return_VALUE(result); return_VALUE(result);
...@@ -1037,6 +1066,10 @@ acpi_processor_get_performance_info ( ...@@ -1037,6 +1066,10 @@ acpi_processor_get_performance_info (
if (result) if (result)
return_VALUE(result); return_VALUE(result);
result = acpi_processor_get_platform_limit(pr);
if (result)
return_VALUE(result);
return_VALUE(0); return_VALUE(0);
} }
......
...@@ -67,6 +67,8 @@ struct acpi_processor_px { ...@@ -67,6 +67,8 @@ struct acpi_processor_px {
acpi_integer status; /* success indicator */ acpi_integer status; /* success indicator */
}; };
#define ACPI_PDC_REVISION_ID 0x1
struct acpi_processor_performance { struct acpi_processor_performance {
unsigned int state; unsigned int state;
unsigned int platform_limit; unsigned int platform_limit;
...@@ -74,9 +76,13 @@ struct acpi_processor_performance { ...@@ -74,9 +76,13 @@ struct acpi_processor_performance {
struct acpi_pct_register status_register; struct acpi_pct_register status_register;
unsigned int state_count; unsigned int state_count;
struct acpi_processor_px states[ACPI_PROCESSOR_MAX_PERFORMANCE]; struct acpi_processor_px states[ACPI_PROCESSOR_MAX_PERFORMANCE];
/* the _PDC objects passed by the driver, if any */
struct acpi_object_list *pdc;
}; };
/* Throttling Control */ /* Throttling Control */
struct acpi_processor_tx { struct acpi_processor_tx {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment