本文整理汇总了C++中pm_notifier函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_notifier函数的具体用法?C++ pm_notifier怎么用?C++ pm_notifier使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_notifier函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tegra_cpufreq_init
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);
}
示例2: nvrm_init
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;
}
示例3: machine_kdump_pm_init
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;
}
示例4: cpu_hotplug_pm_sync_init
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;
}
示例5: pbm_module_init
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;
}
示例6: suspend_pm_init
static int __init suspend_pm_init(void)
{
pm_notifier(suspend_pm_cb, 0);
return 0;
}
示例7: machine_kdump_pm_init
static int __init machine_kdump_pm_init(void)
{
pm_notifier(machine_kdump_pm_cb, 0);
return 0;
}
示例8: pm_ext_init
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;
}