static int __init tegra_cpufreq_init(void) { #ifdef CONFIG_HOTPLUG_CPU pm_notifier(tegra_cpufreq_pm_notifier, 0); #endif return cpufreq_register_driver(&s_tegra_cpufreq_driver); }
static int __init nvrm_init(void) { int ret = 0; printk(KERN_INFO "%s called\n", __func__); #if defined(CONFIG_PM) // Register PM notifier. pm_notifier(tegra_pm_notifier, 0); tegra_pm_notifier_continue_ok = 0; init_waitqueue_head(&tegra_pm_notifier_wait); #if defined(CONFIG_HAS_EARLYSUSPEND) register_early_suspend(&tegra_display_power); #endif // Create /sys/power/nvrm/notifier. nvrm_kobj = kobject_create_and_add("nvrm", power_kobj); sysfs_create_file(nvrm_kobj, &nvrm_lp2policy_attribute.attr); sysfs_create_file(nvrm_kobj, &nvrm_notifier_attribute.attr); sys_nvrm_notifier = NULL; init_waitqueue_head(&sys_nvrm_notifier_wait); #endif // Register NvRm platform driver. ret = platform_driver_register(&nvrm_driver); return ret; }
static int __init machine_kdump_pm_init(void) { pm_notifier(machine_kdump_pm_cb, 0); /* Create initial mapping for crashkernel memory */ arch_kexec_unprotect_crashkres(); return 0; }
static int __init cpu_hotplug_pm_sync_init(void) { /* * cpu_hotplug_pm_callback has higher priority than x86 * bsp_pm_callback which depends on cpu_hotplug_pm_callback * to disable cpu hotplug to avoid cpu hotplug race. */ pm_notifier(cpu_hotplug_pm_callback, 0); return 0; }
static int __init pbm_module_init(void) { int ret = 0; #if 1 /* CONFIG_PBM_PROC_FS */ mt_pbm_create_procfs(); #endif pm_notifier(_mt_pbm_pm_callback, 0); register_dlpt_notify(&kicker_pbm_by_dlpt, DLPT_PRIO_PBM); ret = create_pbm_kthread(); pbm_crit("pbm_module_init : Done\n"); if (ret) { pbm_err("FAILED TO CREATE PBM KTHREAD\n"); return ret; } return ret; }
int cpu_hotplug_pm_sync_init(void) { pm_notifier(cpu_hotplug_pm_callback, 0); return 0; }
static int __init suspend_pm_init(void) { pm_notifier(suspend_pm_cb, 0); return 0; }
static int __init machine_kdump_pm_init(void) { pm_notifier(machine_kdump_pm_cb, 0); return 0; }
int pm_ext_init(struct tty_struct *tty) { int res; pm_ext_tty = tty; /* * NOTE: No need to request AWR since this is done by the board * file. */ /* AWR should be low initially. */ gpio_direction_output(GPIO_MODEM_AWR, 0); /* Request and configure CWR. */ res = gpio_request(GPIO_MODEM_CWR, "cwr"); if (res < 0) { printk(KERN_ERR "pm_ext_init: request_gpio_cwr_failed: %d.\n", res); goto request_gpio_cwr_failed; } gpio_direction_input(GPIO_MODEM_CWR); /* Report initial state if different from low (WARN). */ if (gpio_get_value(GPIO_MODEM_CWR)) { printk(KERN_WARNING "pm_ext_init: CWR already asserted.\n"); cwr_notify(pm_ext_tty, true); } /* Trigger on both falling and rising edges on CWR. */ res = request_irq(gpio_to_irq(GPIO_MODEM_CWR), cwr_irq, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "cwr_irq", NULL); if (res < 0) { printk(KERN_ERR "pm_ext_init: request_irq_failed: %d.\n", res); goto request_irq_failed; } /* Make IRQ wakeup capable. */ res = enable_irq_wake(gpio_to_irq(GPIO_MODEM_CWR)); if (res < 0) { printk(KERN_ERR "pm_ext_init: enable_irq_wake_failed: %d.\n", res); goto enable_irq_wake_failed; } #ifdef CONFIG_HAS_WAKELOCK wake_lock_init(&awr_wakelock, WAKE_LOCK_SUSPEND, "caif_awr"); wake_lock_init(&cwr_wakelock, WAKE_LOCK_SUSPEND, "caif_cwr"); #endif /* CONFIG_HAS_WAKELOCK */ pm_notifier(pm_notify, 0); return 0; enable_irq_wake_failed: request_irq_failed: gpio_free(GPIO_MODEM_CWR); request_gpio_cwr_failed: gpio_free(GPIO_MODEM_AWR); return -ENODEV; }