当前位置: 首页>>代码示例>>C++>>正文


C++ INIT_DELAYED_WORK_DEFERRABLE函数代码示例

本文整理汇总了C++中INIT_DELAYED_WORK_DEFERRABLE函数的典型用法代码示例。如果您正苦于以下问题:C++ INIT_DELAYED_WORK_DEFERRABLE函数的具体用法?C++ INIT_DELAYED_WORK_DEFERRABLE怎么用?C++ INIT_DELAYED_WORK_DEFERRABLE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了INIT_DELAYED_WORK_DEFERRABLE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tegra_sleep_info_init

static int __init tegra_sleep_info_init(void)
{
	/* Register callback from idle for all cpus */
	rq_wq = create_singlethread_workqueue("rq_stats");
	BUG_ON(!rq_wq);
	INIT_DELAYED_WORK_DEFERRABLE(&rq_info.rq_work, rq_work_fn);
	INIT_DELAYED_WORK_DEFERRABLE(&rq_info.def_timer_work, def_work_fn);
	init_rq_attribs();

	return 0;
}
开发者ID:kozmikkick,项目名称:eternityprj-kernel-endeavoru-128,代码行数:11,代码来源:tegra_sleep_stats.c

示例2: msm_sleep_info_init

static int __init msm_sleep_info_init(void)
{
	int err = 0;
	int cpu;
	struct sleep_data *sleep_info = NULL;

	/* Register callback from idle for all cpus */
	msm_idle_register_cb(idle_enter, idle_exit);
	rq_wq = create_singlethread_workqueue("rq_stats");
	BUG_ON(!rq_wq);
	INIT_DELAYED_WORK_DEFERRABLE(&rq_info.rq_work, rq_work_fn);
	INIT_DELAYED_WORK_DEFERRABLE(&rq_info.def_timer_work, def_work_fn);
	init_rq_attribs();

	for_each_possible_cpu(cpu) {
		printk(KERN_INFO "msm_sleep_stats: Initializing sleep stats "
				"for CPU[%d]\n", cpu);
		sleep_info = &per_cpu(core_sleep_info, cpu);
		sleep_info->cpu = cpu;
		INIT_WORK(&sleep_info->work, notify_uspace_work_fn);

		/* Initialize high resolution timer */
		hrtimer_init(&sleep_info->timer, CLOCK_MONOTONIC,
				HRTIMER_MODE_REL);
		sleep_info->timer.function = timer_func;

		/* Register for cpufreq policy changes */
		sleep_info->nb.notifier_call = policy_change_notifier;
		err = cpufreq_register_notifier(&sleep_info->nb,
					CPUFREQ_POLICY_NOTIFIER);
		if (err)
			goto cleanup;

		/* Create sysfs object */
		err = add_sysfs_objects(sleep_info);
		if (err)
			goto cleanup;

		continue;
cleanup:
		printk(KERN_INFO "msm_sleep_stats: Failed to initialize sleep "
				"stats for CPU[%d]\n", cpu);
		sleep_info->cpu = -1;
		cpufreq_unregister_notifier(&sleep_info->nb,
				CPUFREQ_POLICY_NOTIFIER);
		remove_sysfs_objects(sleep_info);
	}

	return 0;
}
开发者ID:AmeriCanAndroid,项目名称:kernel-android-msm-2.6.35,代码行数:50,代码来源:msm_sleep_stats.c

示例3: sr_class1p5_start

/**
 * sr_class1p5_start() - class 1p5 init
 * @voltdm:		sr voltage domain
 * @class_priv_data:	private data for the class
 *
 * we do class specific initialization like creating sysfs/debugfs entries
 * needed, spawning of a kthread if needed etc.
 */
static int sr_class1p5_start(struct voltagedomain *voltdm,
			     void *class_priv_data)
{
	struct sr_class1p5_work_data *work_data;
	int idx;

	if (IS_ERR_OR_NULL(voltdm) || IS_ERR_OR_NULL(class_priv_data)) {
		pr_err("%s: bad parameters!\n", __func__);
		return -EINVAL;
	}

	/* setup our work params */
	work_data = get_sr1p5_work(voltdm);
	if (!IS_ERR_OR_NULL(work_data)) {
		pr_err("%s: ooopps.. class already initialized for %s! bug??\n",
		       __func__, voltdm->name);
		return -EINVAL;
	}
	work_data = NULL;
	/* get the next spare work_data */
	for (idx = 0; idx < MAX_VDDS; idx++) {
		if (!class_1p5_data.work_data[idx].voltdm) {
			work_data = &class_1p5_data.work_data[idx];
			break;
		}
	}
	if (!work_data) {
		pr_err("%s: no more space for work data for domains!\n",
			__func__);
		return -ENOMEM;
	}
	work_data->voltdm = voltdm;
	INIT_DELAYED_WORK_DEFERRABLE(&work_data->work, do_calibrate);
	return 0;
}
开发者ID:CunningLogic,项目名称:asteroid_smart_kernel,代码行数:43,代码来源:smartreflex-class1p5.c

示例4: sec_therm_probe

static __devinit int sec_therm_probe(struct platform_device *pdev)
{
	struct sec_therm_platform_data *pdata = dev_get_platdata(&pdev->dev);
	struct sec_therm_info *info;
	int ret = 0;

	dev_info(&pdev->dev, "%s: SEC Thermistor Driver Loading\n", __func__);

	info = kzalloc(sizeof(*info), GFP_KERNEL);
	if (!info)
		return -ENOMEM;

	platform_set_drvdata(pdev, info);

	info->dev = &pdev->dev;
	info->pdata = pdata;

	info->padc = s3c_adc_register(pdev, NULL, NULL, 0);

	ret = sysfs_create_group(&info->dev->kobj, &sec_therm_group);

	if (ret) {
		dev_err(info->dev,
			"failed to create sysfs attribute group\n");
	}

	INIT_DELAYED_WORK_DEFERRABLE(&info->polling_work,
			sec_therm_polling_work);
	schedule_delayed_work(&info->polling_work,
			msecs_to_jiffies(info->pdata->polling_interval));

	return ret;
}
开发者ID:Andro-Boy,项目名称:Googy-Max2-Kernel,代码行数:33,代码来源:sec_thermistor.c

示例5: init_display_devices

int __init init_display_devices(void)
{
	int ret;

	ret = fb_register_client(&framebuffer_nb);
	if (ret)
		pr_warning("Failed to register framebuffer notifier\n");

	ret = mcde_dss_register_notifier(&display_nb);
	if (ret)
		pr_warning("Failed to register dss notifier\n");

#ifdef CONFIG_DISPLAY_GENERIC_PRIMARY
	if (display_initialized_during_boot)
		generic_display0.power_mode = MCDE_DISPLAY_PM_STANDBY;
	ret = mcde_display_device_register(&generic_display0);
	if (ret)
		pr_warning("Failed to register generic display device 0\n");
#endif

#ifdef CONFIG_DISPLAY_AV8100_TERTIARY
	INIT_DELAYED_WORK_DEFERRABLE(&work_dispreg_hdmi,
			delayed_work_dispreg_hdmi);

	schedule_delayed_work(&work_dispreg_hdmi,
			msecs_to_jiffies(DISPREG_HDMI_DELAY));
#endif

	return ret;
}
开发者ID:CallMeVentus,项目名称:i9070_kernel_CoCore-P,代码行数:30,代码来源:board-u5500-mcde.c

示例6: sr_classp5_init

/**
 * sr_classp5_init() - class p5 init
 * @sr:			SR to init
 * @class_priv_data:	private data for the class (unused)
 *
 * we do class specific initialization like creating sysfs/debugfs entries
 * needed, spawning of a kthread if needed etc.
 */
static int sr_classp5_init(struct omap_sr *sr, void *class_priv_data)
{
	void **voltdm_cdata = NULL;
	struct sr_classp5_calib_data *work_data = NULL;

	if (IS_ERR_OR_NULL(sr) || IS_ERR_OR_NULL(sr->voltdm)) {
		pr_err("%s: bad parameters!\n", __func__);
		return -EINVAL;
	}

	voltdm_cdata = &sr->voltdm_cdata;
	if (*voltdm_cdata) {
		pr_err("%s: ooopps.. class already initialized for %s! bug??\n",
		       __func__, sr->name);
		return -EINVAL;
	}

	/* setup our work params */
	work_data = kzalloc(sizeof(struct sr_classp5_calib_data), GFP_KERNEL);
	if (!work_data) {
		pr_err("%s: no memory to allocate work data on domain %s\n",
		       __func__, sr->name);
		return -ENOMEM;
	}

	work_data->sr = sr;

	INIT_DELAYED_WORK_DEFERRABLE(&work_data->work, sr_classp5_calib_work);
	*voltdm_cdata = (void *)work_data;
	pm_qos_add_request(&work_data->qos, PM_QOS_CPU_DMA_LATENCY,
			   PM_QOS_DEFAULT_VALUE);

	return 0;
}
开发者ID:SciAps,项目名称:android-kernel,代码行数:42,代码来源:smartreflex-class1_p5.c

示例7: omap4_dpll_low_power_cascade_check_entry

int omap4_dpll_low_power_cascade_check_entry()
{
	int delay = usecs_to_jiffies(LP_DELAY);

	INIT_DELAYED_WORK_DEFERRABLE(&lpmode_work,
			omap4_dpll_low_power_cascade_check_timer);

	return schedule_delayed_work_on(0, &lpmode_work, delay);
}
开发者ID:CunningLogic,项目名称:asteroid_smart_kernel,代码行数:9,代码来源:dpll-44xx.c

示例8: dbs_timer_init

/***********************************************************
*调频任务初始化
***********************************************************/
static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
{
    /* We want all CPUs to do sampling nearly on same jiffy */
    unsigned long delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
    if (NULL == dbs_info) {
        cpufreq_err("!!!!!!dbs_timer_init!!!!!!error\n");
        return;
    }

    INIT_DELAYED_WORK_DEFERRABLE(&(dbs_info->work), balong_do_dbs_timer);/*lint !e613*/
    schedule_delayed_work_on(dbs_info->cpu, &(dbs_info->work), delay);/*lint !e613*/
}
开发者ID:herryfan,项目名称:kernel-huawei-h60,代码行数:15,代码来源:cpufreq_balong_ondemand.c

示例9: sec_hal_fg_init

bool sec_hal_fg_init(struct i2c_client *client)
{
	struct sec_fuelgauge_info *fuelgauge =
			i2c_get_clientdata(client);

	mutex_init(&fuelgauge->info.adclock);
	INIT_DELAYED_WORK_DEFERRABLE(&fuelgauge->info.monitor_work,
		adc_monitor_work);

	schedule_delayed_work(&fuelgauge->info.monitor_work, HZ);
	return true;
}
开发者ID:junkyde,项目名称:vikinger-stock,代码行数:12,代码来源:adc_fuelgauge.c

示例10: smb347_probe

static int __devinit smb347_probe(struct i2c_client *client,
			const struct i2c_device_id *id)
{
	struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
	int ret, irq_num, i;
	uint8_t val, buf[15];

	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
		return -EIO;

	charger = kzalloc(sizeof(*charger), GFP_KERNEL);
	if (!charger)
		return -ENOMEM;

	charger->client = client;
	charger->dev = &client->dev;
	i2c_set_clientdata(client, charger);

	/* Restore default setting: APSD Enable & 5/1/HC mode Pin control */
	smb347_default_setback();

	ret = sysfs_create_group(&client->dev.kobj, &smb347_group);
	if (ret) {
		dev_err(&client->dev, "smb347_probe: unable to create the sysfs\n");
	}

	mutex_init(&charger->cable_lock);

	smb347_wq = create_singlethread_workqueue("smb347_wq");
	INIT_DELAYED_WORK_DEFERRABLE(&charger->inok_isr_work, inok_isr_work_function);
	//INIT_DELAYED_WORK(&charger->regs_dump_work, regs_dump_work_func);

	ret = smb347_inok_irq(charger);
	if (ret) {
		dev_err(&client->dev, "%s(): Failed in requesting ACOK# pin isr\n",
				__func__);
		goto error;
	}

	//queue_delayed_work(smb347_wq, &charger->regs_dump_work, 30*HZ);

	cable_type_detect();

	ret = register_otg_callback( (callback_t)smb347_otg_status, charger);

	if (ret < 0)
		goto error;

	return 0;
error:
	kfree(charger);
	return ret;
}
开发者ID:Hundsbuah,项目名称:Kernel-Nexus7,代码行数:53,代码来源:smb347-charger.c

示例11: init_rq_avg

static int __init init_rq_avg(void)
{
	rq_data = kzalloc(sizeof(struct runqueue_data), GFP_KERNEL);
	if (rq_data == NULL) {
		pr_err("%s cannot allocate memory\n", __func__);
		return -ENOMEM;
	}
	spin_lock_init(&rq_data->lock);
	rq_data->update_rate = RQ_AVG_TIMER_RATE;
	INIT_DELAYED_WORK_DEFERRABLE(&rq_data->work, rq_work_fn);

	return 0;
}
开发者ID:morristech,项目名称:GT-I9300-JB-3.0.y,代码行数:13,代码来源:cpufreq_pegasusq.c

示例12: sr_classp5_recal_init

static void sr_classp5_recal_init(void)
{
	unsigned long delay;
	INIT_DELAYED_WORK_DEFERRABLE(&recal_work, sr_classp5_recal_work);
	pm_qos_add_request(&recal_qos, PM_QOS_CPU_DMA_LATENCY,
			   PM_QOS_DEFAULT_VALUE);
	delay = msecs_to_jiffies(CONFIG_OMAP_SR_CLASS1_P5_RECALIBRATION_DELAY);
	schedule_delayed_work(&recal_work, delay);
	next_recal_time = jiffies + delay;
	sr_classp5_recal_register_sleep_pm_notifier();
	recal_scheduled = true;
	pr_info("SmartReflex Recalibration delay = %dms\n",
		CONFIG_OMAP_SR_CLASS1_P5_RECALIBRATION_DELAY);
}
开发者ID:SciAps,项目名称:android-kernel,代码行数:14,代码来源:smartreflex-class1_p5.c

示例13: user_init_device

int user_init_device(struct fb_info *fb_info)
{
	int i, error = 0;
	struct omap3epfb_par *par = fb_info->par;

	fb_info->class_flag |= FB_SYSFS_FLAG_ATTR;

	mutex_init(&par->area_mutex);

	for (i = 0; i < ARRAY_SIZE(device_attrs); i++) {
		error = device_create_file(fb_info->dev, &device_attrs[i]);

		if (error)
			break;
	}

	if (error) {
		while (--i >= 0)
			device_remove_file(fb_info->dev, &device_attrs[i]);
		fb_info->class_flag &= ~FB_SYSFS_FLAG_ATTR;
	}
	INIT_DELAYED_WORK_DEFERRABLE(&par->lost_update, omap3epfb_lost_update);
	INIT_DELAYED_WORK_DEFERRABLE(&par->clear_work, omap3epfb_clear_work);
	INIT_DELAYED_WORK_DEFERRABLE(&par->disable_work, omap3epfb_disable_work);

	// Start with page flip mode active.
	par->pgflip_refresh = 1;

	// Disabled as default.
	par->clear_delay = 0;

	par->effect_active = 0;
	strncpy(par->effect_active_debug, "--------", EFFECT_ARRAY_SIZE);
	par->effect_active_debug[EFFECT_ARRAY_SIZE] = 0;

	return 0;
}
开发者ID:staylo,项目名称:nook2,代码行数:37,代码来源:omap3epfb-user.c

示例14: auto_hotplug_init

static int __init auto_hotplug_init(void)
{
        pr_info("auto_hotplug: v0.220 by _thalamus\n");
        pr_info("auto_hotplug: %d CPUs detected\n", CPUS_AVAILABLE);

        INIT_DELAYED_WORK(&hotplug_decision_work, hotplug_decision_work_fn);
        INIT_DELAYED_WORK_DEFERRABLE(&hotplug_unpause_work, hotplug_unpause_work_fn);
        INIT_WORK(&hotplug_online_all_work, hotplug_online_all_work_fn);
        INIT_WORK(&hotplug_online_single_work, hotplug_online_single_work_fn);
        INIT_WORK(&hotplug_offline_all_work, hotplug_offline_all_work_fn);
        INIT_DELAYED_WORK_DEFERRABLE(&hotplug_offline_work, hotplug_offline_work_fn);

        /*
         * Give the system time to boot before fiddling with hotplugging.
         */
        flags |= HOTPLUG_PAUSED;
        schedule_delayed_work_on(0, &hotplug_decision_work, HZ * 5);
        schedule_delayed_work(&hotplug_unpause_work, HZ * 10);

#ifdef CONFIG_HAS_EARLYSUSPEND
        register_early_suspend(&auto_hotplug_suspend);
#endif
        return 0;
}
开发者ID:perillamint,项目名称:Kite2,代码行数:24,代码来源:auto_hotplug.c

示例15: sec_hal_fg_init

bool sec_hal_fg_init(struct i2c_client *client)
{
	struct sec_fuelgauge_info *fuelgauge =
			i2c_get_clientdata(client);

	fuelgauge->info.last_vcell_check_time.tv_sec = 0;
	fuelgauge->info.is_init = 2;
	adc_get_reset_percentage(fuelgauge);

	mutex_init(&fuelgauge->info.adclock);
	INIT_DELAYED_WORK_DEFERRABLE(&fuelgauge->info.monitor_work,
		adc_monitor_work);

	schedule_delayed_work(&fuelgauge->info.monitor_work, HZ);
	return true;
}
开发者ID:mahound,项目名称:bricked-S7275-kernel,代码行数:16,代码来源:adc_fuelgauge.c


注:本文中的INIT_DELAYED_WORK_DEFERRABLE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。