Skip to content

Commit

Permalink
ACPI: Decouple ACPI idle and ACPI processor drivers
Browse files Browse the repository at this point in the history
This patch introduces a new Kconfig symbol, ACPI_PROCESSOR_IDLE,
which is auto selected by architectures which support the ACPI
based C states for CPU Idle management.

The processor_idle driver in its present form contains declarations
specific to X86 and IA64. Since there are no reasonable defaults
for other architectures e.g. ARM64, the driver is selected only for
X86 or IA64.

This helps in decoupling the ACPI processor_driver from the ACPI
processor_idle driver which is useful for the upcoming alternative
patchwork for controlling CPU Performance (CPPC) and CPU Idle (LPI).

Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Ashwin Chaugule authored and Rafael J. Wysocki committed Aug 25, 2015
1 parent 239708a commit 5f05586
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
6 changes: 5 additions & 1 deletion drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,14 @@ config ACPI_CPU_FREQ_PSS
bool
select THERMAL

config ACPI_PROCESSOR_IDLE
bool
select CPU_IDLE

config ACPI_PROCESSOR
tristate "Processor"
depends on X86 || IA64
select CPU_IDLE
select ACPI_PROCESSOR_IDLE
select ACPI_CPU_FREQ_PSS
default y
help
Expand Down
3 changes: 2 additions & 1 deletion drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
obj-$(CONFIG_ACPI_BGRT) += bgrt.o

# processor has its own "processor." module_param namespace
processor-y := processor_driver.o processor_idle.o
processor-y := processor_driver.o
processor-$(CONFIG_ACPI_PROCESSOR_IDLE) += processor_idle.o
processor-$(CONFIG_ACPI_CPU_FREQ_PSS) += processor_throttling.o \
processor_thermal.o
processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
Expand Down
26 changes: 24 additions & 2 deletions include/acpi/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,35 @@ static inline void acpi_processor_throttling_init(void) {}
#endif /* CONFIG_ACPI_CPU_FREQ_PSS */

/* in processor_idle.c */
extern struct cpuidle_driver acpi_idle_driver;
#ifdef CONFIG_ACPI_PROCESSOR_IDLE
int acpi_processor_power_init(struct acpi_processor *pr);
int acpi_processor_power_exit(struct acpi_processor *pr);
int acpi_processor_cst_has_changed(struct acpi_processor *pr);
int acpi_processor_hotplug(struct acpi_processor *pr);
extern struct cpuidle_driver acpi_idle_driver;
#else
static inline int acpi_processor_power_init(struct acpi_processor *pr)
{
return -ENODEV;
}

static inline int acpi_processor_power_exit(struct acpi_processor *pr)
{
return -ENODEV;
}

static inline int acpi_processor_cst_has_changed(struct acpi_processor *pr)
{
return -ENODEV;
}

static inline int acpi_processor_hotplug(struct acpi_processor *pr)
{
return -ENODEV;
}
#endif /* CONFIG_ACPI_PROCESSOR_IDLE */

#ifdef CONFIG_PM_SLEEP
#if defined(CONFIG_PM_SLEEP) & defined(CONFIG_ACPI_PROCESSOR_IDLE)
void acpi_processor_syscore_init(void);
void acpi_processor_syscore_exit(void);
#else
Expand Down

0 comments on commit 5f05586

Please sign in to comment.