예제 #1
0
static int __init acpi_processor_init(void)
{
	int result = 0;

	if (acpi_disabled)
		return 0;

	memset(&errata, 0, sizeof(errata));

#ifdef CONFIG_SMP
	if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_MADT, 0,
				(struct acpi_table_header **)&madt)))
		madt = NULL;
#endif
#ifdef CONFIG_ACPI_PROCFS
	acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
	if (!acpi_processor_dir)
		return -ENOMEM;
#endif
	/*
	 * Check whether the system is DMI table. If yes, OSPM
	 * should not use mwait for CPU-states.
	 */
	dmi_check_system(processor_idle_dmi_table);
	result = cpuidle_register_driver(&acpi_idle_driver);
	if (result < 0)
		goto out_proc;

	result = acpi_bus_register_driver(&acpi_processor_driver);
	if (result < 0)
		goto out_cpuidle;

	acpi_processor_install_hotplug_notify();

	acpi_thermal_cpufreq_init();

	acpi_processor_ppc_init();

	acpi_processor_throttling_init();

	return 0;

out_cpuidle:
	cpuidle_unregister_driver(&acpi_idle_driver);

out_proc:
#ifdef CONFIG_ACPI_PROCFS
	remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
#endif

	return result;
}
static void __exit acpi_processor_exit(void)
{
	acpi_processor_ppc_exit();

	acpi_thermal_cpufreq_exit();

	acpi_processor_uninstall_hotplug_notify();

	acpi_bus_unregister_driver(&acpi_processor_driver);

	cpuidle_unregister_driver(&acpi_idle_driver);

	remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);

	return;
}
예제 #3
0
static void __exit acpi_processor_exit(void)
{
	if (acpi_disabled)
		return;

	acpi_processor_ppc_exit();

	acpi_thermal_cpufreq_exit();

	acpi_processor_uninstall_hotplug_notify();

	acpi_bus_unregister_driver(&acpi_processor_driver);

	cpuidle_unregister_driver(&acpi_idle_driver);

	return;
}
예제 #4
0
static int __init acpi_processor_init(void)
{
	int result = 0;


	memset(&processors, 0, sizeof(processors));
	memset(&errata, 0, sizeof(errata));

#ifdef CONFIG_SMP
	if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_MADT, 0,
				(struct acpi_table_header **)&madt)))
		madt = NULL;
#endif

	acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
	if (!acpi_processor_dir)
		return -ENOMEM;
	acpi_processor_dir->owner = THIS_MODULE;

	result = cpuidle_register_driver(&acpi_idle_driver);
	if (result < 0)
		goto out_proc;

	result = acpi_bus_register_driver(&acpi_processor_driver);
	if (result < 0)
		goto out_cpuidle;

	acpi_processor_install_hotplug_notify();

	acpi_thermal_cpufreq_init();

	acpi_processor_ppc_init();

	return 0;

out_cpuidle:
	cpuidle_unregister_driver(&acpi_idle_driver);

out_proc:
	remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);

	return result;
}
예제 #5
0
static void __exit acpi_processor_exit(void)
{
	if (acpi_disabled)
		return;

	acpi_processor_ppc_exit();

	acpi_thermal_cpufreq_exit();

	acpi_processor_uninstall_hotplug_notify();

	acpi_bus_unregister_driver(&acpi_processor_driver);

	cpuidle_unregister_driver(&acpi_idle_driver);

#ifdef CONFIG_ACPI_PROCFS
	remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
#endif

	return;
}
예제 #6
0
/**
 * cpuidle_init - Init routine for v9r1 idle
 *
 * Registers the v9r1 specific cpuidle driver to the cpuidle
 * framework with the valid set of states.
 */
int __init cpuidle_init(void)
{
	struct cpuidle_device *dev;
	int i, max_cpuidle_state, cpu_id;

	cpuidle_register_driver(&idle_driver);

	wdt_base = ioremap(REG_BASE_WD0, REG_WD0_IOSIZE);

    gp_cpuidle_state = (unsigned int *)MEM_AXI_CPU_IDLE_ADDR;
    *gp_cpuidle_state = (CPU_IDLE_C4 << CPUIDLE_STATE_START_BIT) | (CPU_IDLE_STAT_VALID << CPUIDLE_STATE_MAGIC_START_BIT);/*init*/

	for_each_cpu(cpu_id, cpu_online_mask) {
		dev = &per_cpu(idle_dev, cpu_id);
		dev->cpu = cpu_id;

		printk(KERN_ERR "cpu=%d\n", dev->cpu);

		if (cpu_id == 0)
			dev->state_count = ARRAY_SIZE(cpuidle_set);
		else
			dev->state_count = 1;	/* Support IDLE only */

		max_cpuidle_state = dev->state_count;

		for (i = 0; i < max_cpuidle_state; i++) {
			memcpy(&dev->states[i], &cpuidle_set[i],
					sizeof(struct cpuidle_state));
		}

		dev->safe_state = &dev->states[0];

		if (cpuidle_register_device(dev)) {
			cpuidle_unregister_driver(&idle_driver);
			printk(KERN_ERR "CPUidle register device failed\n,");
			return -EIO;
		}
	}
예제 #7
0
static int __init acpi_processor_init(void)
{
	int result = 0;

	if (acpi_disabled)
		return 0;

	memset(&errata, 0, sizeof(errata));

	if (!cpuidle_register_driver(&acpi_idle_driver)) {
		printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
			acpi_idle_driver.name);
	} else {
		printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s\n",
			cpuidle_get_driver()->name);
	}

	result = acpi_bus_register_driver(&acpi_processor_driver);
	if (result < 0)
		goto out_cpuidle;

	acpi_processor_install_hotplug_notify();

	acpi_thermal_cpufreq_init();

	acpi_processor_ppc_init();

	acpi_processor_throttling_init();

	return 0;

out_cpuidle:
	cpuidle_unregister_driver(&acpi_idle_driver);

	return result;
}
static void __exit tegra_cpuidle_exit(void)
{
	unregister_pm_notifier(&tegra_cpuidle_pm_notifier);
	cpuidle_unregister_driver(&tegra_idle);
}