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

Commit e5e25bbe authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: firmware: psci: Set ARM32 cpuidle ops"

parents 864fd17d b39ce179
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ nodes to be present and contain the properties described below.
			    "allwinner,sun6i-a31"
			    "allwinner,sun8i-a23"
			    "arm,psci"
			    "psci"
			    "brcm,brahma-b15"
			    "marvell,armada-375-smp"
			    "marvell,armada-380-smp"
+26 −0
Original line number Diff line number Diff line
@@ -363,6 +363,24 @@ static int lpm_cpu_callback(struct notifier_block *cpu_nb,
	return NOTIFY_OK;
}

#ifdef CONFIG_ARM_PSCI

static int __init set_cpuidle_ops(void)
{
	int ret = 0, cpu;

	for_each_possible_cpu(cpu) {
		ret = arm_cpuidle_init(cpu);
		if (ret)
			goto exit;
	}

exit:
	return ret;
}

#endif

static enum hrtimer_restart lpm_hrtimer_cb(struct hrtimer *h)
{
	return HRTIMER_NORESTART;
@@ -1954,6 +1972,14 @@ static int __init lpm_levels_module_init(void)
		goto fail;
	}

#ifdef CONFIG_ARM_PSCI
	rc = set_cpuidle_ops();
	if (rc) {
		pr_err("%s(): Failed to set cpuidle ops\n", __func__);
		goto fail;
	}
#endif

fail:
	return rc;
}
+12 −1
Original line number Diff line number Diff line
@@ -230,6 +230,13 @@ static int __init psci_features(u32 psci_func_id)
#ifdef CONFIG_CPU_IDLE
static DEFINE_PER_CPU_READ_MOSTLY(u32 *, psci_power_state);

#ifdef CONFIG_ARM_PSCI
static int psci_cpu_init(struct device_node *cpu_node, int cpu)
{
	return 0;
}
#endif

static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu)
{
	int i, ret, count = 0;
@@ -333,10 +340,14 @@ int psci_cpu_suspend_enter(unsigned long state_id)
#ifdef CONFIG_ARM
static struct cpuidle_ops psci_cpuidle_ops __initdata = {
	.suspend = psci_cpu_suspend_enter,
#ifdef CONFIG_ARM_PSCI
	.init = psci_cpu_init,
#else
	.init = psci_dt_cpu_init_idle,
#endif
};

CPUIDLE_METHOD_OF_DECLARE(psci, "arm,psci", &psci_cpuidle_ops);
CPUIDLE_METHOD_OF_DECLARE(psci, "psci", &psci_cpuidle_ops);
#endif
#endif