コード例 #1
0
ファイル: dm_cpu_hotplug.c プロジェクト: gundal/nobleltehk
static int dynamic_hotplug(enum hotplug_cmd cmd)
{
	int ret = 0;

	mutex_lock(&dm_hotplug_lock);

	switch (cmd) {
	case CMD_LOW_POWER:
		ret = __cpu_hotplug(true, cmd);
		in_low_power_mode = true;
		delay = in_delay;
		break;
	case CMD_CLUST0_ONE_OUT:
	case CMD_CLUST1_OUT:
	case CMD_SLEEP_PREPARE:
		ret = __cpu_hotplug(true, cmd);
		break;
	case CMD_CLUST0_ONE_IN:
	case CMD_CLUST1_IN:
		ret = __cpu_hotplug(false, cmd);
		break;
	case CMD_CLUST0_IN:
	case CMD_NORMAL:
		ret = __cpu_hotplug(false, cmd);
		in_low_power_mode = false;
		delay = out_delay;
		break;
	}

	mutex_unlock(&dm_hotplug_lock);

	return ret;
}
コード例 #2
0
static int dynamic_hotplug(enum hotplug_cmd cmd)
{
	int ret = 0;

	mutex_lock(&dm_hotplug_lock);

	switch (cmd) {
	case CMD_LOW_POWER:
		ret = __cpu_hotplug(true, cmd);
		in_low_power_mode = true;
		break;
	case CMD_BIG_OUT:
		ret = __cpu_hotplug(true, cmd);
		break;
	case CMD_BIG_IN:
		ret = __cpu_hotplug(false, cmd);
		break;
	case CMD_NORMAL:
		ret = __cpu_hotplug(false, cmd);
		in_low_power_mode = false;
		break;
	}

	mutex_unlock(&dm_hotplug_lock);

	return ret;
}