Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 383d922c authored by Lina Iyer's avatar Lina Iyer
Browse files

drivers: arm: cpuidle: support ARMv7 targets for lpm governor



QCOM's low power mode cpuidle driver support ARM v8 targets primarily.
The initialization of PSCI for ARM v7 targets is done through the
generic ARM cpuidle driver. Since LPM driver replaces the ARM's default
driver for QCOM SoC's including the ARM v7 variants, we now have the
responsibility of initializing the PSCI cpuidle ops.

Also, since QCOM SoCs do not use ARM idle state definitions as suggested
in [1], the initialization of PSCI cpuidle ops would fail. Make the PSCI
cpuidle ops initialization conditional.

[1]. Documentation/devicetree/bindings/arm/idle-states.txt

Change-Id: Ifef6c5bdd76e93d34af45b51efbe12f784421746
Signed-off-by: default avatarLina Iyer <ilina@codeaurora.org>
parent 5a38caa6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ config ARM
	select ARCH_USE_BUILTIN_BSWAP
	select ARCH_USE_CMPXCHG_LOCKREF
	select ARCH_WANT_IPC_PARSE_VERSION
	select ARM_PSCI_FW if PM
	select BUILDTIME_EXTABLE_SORT if MMU
	select CLONE_BACKWARDS
	select CPU_PM if (SUSPEND || CPU_IDLE)
+12 −0
Original line number Diff line number Diff line
@@ -1702,6 +1702,18 @@ static int __init lpm_levels_module_init(void)
{
	int rc;

#ifdef CONFIG_ARM
	int cpu;

	for_each_possible_cpu(cpu) {
		rc = arm_cpuidle_init(smp_processor_id());
		if (rc) {
			pr_err("CPU%d ARM CPUidle init failed (%d)\n", cpu, rc);
			return rc;
		}
	}
#endif

	rc = platform_driver_register(&lpm_driver);
	if (rc) {
		pr_info("Error registering %s\n", lpm_driver.driver.name);
+6 −1
Original line number Diff line number Diff line
@@ -268,8 +268,9 @@ static int __init psci_features(u32 psci_func_id)
}

#ifdef CONFIG_CPU_IDLE
static DEFINE_PER_CPU_READ_MOSTLY(u32 *, psci_power_state);
static __maybe_unused DEFINE_PER_CPU_READ_MOSTLY(u32 *, psci_power_state);

#ifdef CONFIG_DT_IDLE_STATES
static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu)
{
	int i, ret, count = 0;
@@ -322,6 +323,10 @@ static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu)
	kfree(psci_states);
	return ret;
}
#else
static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu)
{ return 0; }
#endif

#ifdef CONFIG_ACPI
#include <acpi/processor.h>