Exemplo n.º 1
0
static int cpu_boost_init(void)
{
	int cpu, ret;
	struct cpu_sync *s;

	cpufreq_register_notifier(&boost_adjust_nb, CPUFREQ_POLICY_NOTIFIER);

	cpu_boost_wq = alloc_workqueue("cpuboost_wq", WQ_HIGHPRI, 0);
	if (!cpu_boost_wq)
		return -EFAULT;

	INIT_WORK(&input_boost_work, do_input_boost);

	for_each_possible_cpu(cpu) {
		s = &per_cpu(sync_info, cpu);
		s->cpu = cpu;
		spin_lock_init(&s->lock);
		INIT_DELAYED_WORK(&s->boost_rem, do_boost_rem);
		INIT_DELAYED_WORK(&s->input_boost_rem, do_input_boost_rem);
	}
	atomic_notifier_chain_register(&migration_notifier_head,
					&boost_migration_nb);

	ret = smpboot_register_percpu_thread(&cpuboost_threads);
	if (ret)
		pr_err("Cannot register cpuboost threads.\n");

	ret = input_register_handler(&cpuboost_input_handler);
	if (ret)
		pr_err("Cannot register cpuboost input handler.\n");

	return ret;
}
Exemplo n.º 2
0
static int cpu_boost_init(void)
{
	int cpu, ret;
	struct cpu_sync *s;

	cpu_boost_wq = alloc_workqueue("cpuboost_wq", WQ_HIGHPRI, 0);
	if (!cpu_boost_wq)
		return -EFAULT;

	INIT_WORK(&input_boost_work, do_input_boost);

	for_each_possible_cpu(cpu) {
		s = &per_cpu(sync_info, cpu);
		s->cpu = cpu;
		init_waitqueue_head(&s->sync_wq);
		atomic_set(&s->being_woken, 0);
		spin_lock_init(&s->lock);
		INIT_DELAYED_WORK(&s->boost_rem, do_boost_rem);
		INIT_DELAYED_WORK(&s->input_boost_rem, do_input_boost_rem);
		s->thread = kthread_run(boost_mig_sync_thread, (void *)cpu,
					"boost_sync/%d", cpu);
		set_cpus_allowed(s->thread, *cpumask_of(cpu));
	}
	cpufreq_register_notifier(&boost_adjust_nb, CPUFREQ_POLICY_NOTIFIER);
	atomic_notifier_chain_register(&migration_notifier_head,
					&boost_migration_nb);
	ret = input_register_handler(&cpuboost_input_handler);

	return 0;
}
Exemplo n.º 3
0
int __init intelli_plug_init(void)
{
	int rc;

	//pr_info("intelli_plug: scheduler delay is: %d\n", delay);
	pr_info("intelli_plug: version %d.%d by faux123\n",
		 INTELLI_PLUG_MAJOR_VERSION,
		 INTELLI_PLUG_MINOR_VERSION);

	rc = input_register_handler(&intelli_plug_input_handler);
#ifdef CONFIG_POWERSUSPEND
	register_power_suspend(&intelli_plug_power_suspend_driver);
#endif

	intelliplug_wq = alloc_workqueue("intelliplug",
				WQ_HIGHPRI | WQ_UNBOUND, 1);
	intelliplug_boost_wq = alloc_workqueue("iplug_boost",
				WQ_HIGHPRI | WQ_UNBOUND, 1);
	INIT_DELAYED_WORK(&intelli_plug_work, intelli_plug_work_fn);
	INIT_DELAYED_WORK(&intelli_plug_boost, intelli_plug_boost_fn);
	queue_delayed_work_on(0, intelliplug_wq, &intelli_plug_work,
		msecs_to_jiffies(10));

	return 0;
}
Exemplo n.º 4
0
static int __devinit alsa_to_h2w_probe(struct platform_device *pdev)
{
	struct alsa_to_h2w_data *switch_data;
	int ret = 0;

	switch_data = kzalloc(sizeof(struct alsa_to_h2w_data), GFP_KERNEL);
	if (!switch_data)
		return -ENOMEM;
	headset_switch_data = switch_data;

	switch_data->sdev.name = "h2w";
	switch_data->sdev.print_name = headset_print_name;
	switch_data->sdev.print_state = headset_print_state;

	ret = switch_dev_register(&switch_data->sdev);
	if (ret < 0)
		goto err_switch_dev_register;

	platform_set_drvdata(pdev, switch_data);

	INIT_WORK(&switch_data->work, alsa_to_h2w_work);

	if (input_register_handler(&alsa_to_h2w_handler))
		pr_info("input_register_handler failed\n");
	return 0;

err_switch_dev_register:
	kfree(switch_data);
	return ret;
}
Exemplo n.º 5
0
int __init keybdev_init(void)
#endif
{
	input_register_handler(&keybdev_handler);
	kbd_ledfunc = keybdev_ledfunc;
	return 0;
}
Exemplo n.º 6
0
static int __init init(void)
{
	if (input_register_handler(&boost_input_handler))
		pr_info("Unable to register the input handler\n");

	return 0;
}
static int cpu_boost_init(void)
{
	int cpu, ret;
	struct cpu_sync *s;

	cpufreq_register_notifier(&boost_adjust_nb, CPUFREQ_POLICY_NOTIFIER);

	cpu_boost_wq = alloc_workqueue("cpuboost_wq", WQ_HIGHPRI, 0);
	if (!cpu_boost_wq)
		return -EFAULT;

	INIT_WORK(&input_boost_work, do_input_boost);

	for_each_possible_cpu(cpu) {
		s = &per_cpu(sync_info, cpu);
		s->cpu = cpu;
		init_waitqueue_head(&s->sync_wq);
		spin_lock_init(&s->lock);
		INIT_DELAYED_WORK(&s->boost_rem, do_boost_rem);
		INIT_DELAYED_WORK(&s->input_boost_rem, do_input_boost_rem);
		s->thread = kthread_run(boost_mig_sync_thread, (void *)cpu,
					"boost_sync/%d", cpu);
#if defined(CONFIG_ARCH_MSM8974) || defined(CONFIG_ARCH_MSM8974PRO)
		kthread_bind(s->thread, cpu);
#endif
	}
	atomic_notifier_chain_register(&migration_notifier_head,
					&boost_migration_nb);

	ret = input_register_handler(&cpuboost_input_handler);
	return 0;
}
Exemplo n.º 8
0
static int init(void)
{
	INIT_WORK(&touchboost_inputopen.inputopen_work, boost_input_open);

	input_register_handler(&boost_input_handler);

	return 0;
}
Exemplo n.º 9
0
static void __init touch_dvfs_handler_init(void)
{
	int ret;

	INIT_WORK(&kona_dvfs_data.dvfs_work, touch_dvfs_work);
	ret = input_register_handler(&touch_dvfs_handler);
	if (ret < 0)
		pr_err("tsp: failed to register touch dvfs handler\n");
}
Exemplo n.º 10
0
static int __init doubletap2wake_init(void)
{
	int rc = 0;

	doubletap2wake_pwrdev = input_allocate_device();
	if (!doubletap2wake_pwrdev) {
		pr_err("Can't allocate suspend autotest power button\n");
		goto err_alloc_dev;
	}

	input_set_capability(doubletap2wake_pwrdev, EV_KEY, KEY_POWER);
	doubletap2wake_pwrdev->name = "dt2w_pwrkey";
	doubletap2wake_pwrdev->phys = "dt2w_pwrkey/input0";

	rc = input_register_device(doubletap2wake_pwrdev);
	if (rc) {
		pr_err("%s: input_register_device err=%d\n", __func__, rc);
		goto err_input_dev;
	}

	dt2w_input_wq = create_workqueue("dt2wiwq");
	if (!dt2w_input_wq) {
		pr_err("%s: Failed to create dt2wiwq workqueue\n", __func__);
		return -EFAULT;
	}
	INIT_WORK(&dt2w_input_work, dt2w_input_callback);
	rc = input_register_handler(&dt2w_input_handler);
	if (rc)
		pr_err("%s: Failed to register dt2w_input_handler\n", __func__);

#ifdef CONFIG_HAS_EARLYSUSPEND
	register_early_suspend(&dt2w_early_suspend_handler);
#endif

#ifndef ANDROID_TOUCH_DECLARED
	android_touch_kobj = kobject_create_and_add("android_touch", NULL) ;
	if (android_touch_kobj == NULL) {
		pr_warn("%s: android_touch_kobj create_and_add failed\n", __func__);
	}
#endif
	rc = sysfs_create_file(android_touch_kobj, &dev_attr_doubletap2wake.attr);
	if (rc) {
		pr_warn("%s: sysfs_create_file failed for doubletap2wake\n", __func__);
	}
	rc = sysfs_create_file(android_touch_kobj, &dev_attr_doubletap2wake_version.attr);
	if (rc) {
		pr_warn("%s: sysfs_create_file failed for doubletap2wake_version\n", __func__);
	}

err_input_dev:
	input_free_device(doubletap2wake_pwrdev);
err_alloc_dev:
	pr_info(LOGTAG"%s done\n", __func__);

	return 0;
}
Exemplo n.º 11
0
static inline void sysrq_register_handler(void)
{
	int error;

	error = input_register_handler(&sysrq_handler);
	if (error)
		pr_err("Failed to register input handler, error %d", error);
	else
		sysrq_handler_registered = true;
}
static int __init cpu_iboost_init(void)
{
	struct boost_policy *b;
	int cpu, ret;

	boost_wq = alloc_workqueue("cpu_iboost_wq", WQ_HIGHPRI, 0);
	if (!boost_wq) {
		pr_err("Failed to allocate workqueue\n");
		ret = -EFAULT;
		goto err;
	}

	cpufreq_register_notifier(&cpu_do_boost_nb, CPUFREQ_POLICY_NOTIFIER);

	INIT_DELAYED_WORK(&fb_boost_work, fb_boost_fn);

	fb_register_client(&fb_boost_nb);

	for_each_possible_cpu(cpu) {
		b = &per_cpu(boost_info, cpu);
		b->cpu = cpu;
		INIT_DELAYED_WORK(&b->ib_restore_work, ib_restore_main);
		init_waitqueue_head(&b->sync_wq);
		atomic_set(&b->being_woken, 0);
		spin_lock_init(&b->lock);
		INIT_DELAYED_WORK(&b->mig_boost_rem, do_mig_boost_rem);
		b->thread = kthread_run(boost_mig_sync_thread, (void *)cpu,
					"boost_sync/%d", cpu);
		set_cpus_allowed(b->thread, *cpumask_of(cpu));
	}

	atomic_notifier_chain_register(&migration_notifier_head, &boost_migration_nb);

	INIT_WORK(&boost_work, ib_boost_main);

	ret = input_register_handler(&cpu_iboost_input_handler);
	if (ret) {
		pr_err("Failed to register input handler, err: %d\n", ret);
		goto err;
	}

	cpu_iboost_kobject = kobject_create_and_add("cpu_input_boost", kernel_kobj);
	if (!cpu_iboost_kobject) {
		pr_err("Failed to create kobject\n");
		goto err;
	}

	ret = sysfs_create_group(cpu_iboost_kobject, &cpu_iboost_attr_group);
	if (ret) {
		pr_err("Failed to create sysfs interface\n");
		kobject_put(cpu_iboost_kobject);
	}
err:
	return ret;
}
Exemplo n.º 13
0
static int __init boost_init(void)
{
	int ret;
	pm_qos_add_request(&touchboost_cpu_qos_min,
		PM_QOS_CPUFREQ_MIN, PM_QOS_DEFAULT_VALUE);
	pm_qos_add_request(&touchboost_ddr_qos_min,
		   PM_QOS_DDR_DEVFREQ_MIN, PM_QOS_DEFAULT_VALUE);
	pm_qos_add_request(&touchboost_gpu3d_qos_min,
		   PM_QOS_GPUFREQ_3D_MIN, PM_QOS_DEFAULT_VALUE);
	pm_qos_add_request(&touchboost_gpu2d_qos_min,
		   PM_QOS_GPUFREQ_2D_MIN, PM_QOS_DEFAULT_VALUE);
	INIT_WORK(&touchboost_wk, touchboost_work);
#ifdef CONFIG_DEBUG_FS
	debugfs_create_u32("touchbst_enable", 0644, NULL,
		&touch_boost_enabled);
#endif
	ret = input_register_handler(&touchboost_handler);
	if (ret)
		pr_err("touchboost_handler register failed");
	return input_register_handler(&keyboost_handler);
}
Exemplo n.º 14
0
static int __init thunderplug_init(void)
{
        int ret = 0;
        int sysfs_result;
        printk(KERN_DEBUG "[%s]\n",__func__);

        thunderplug_kobj = kobject_create_and_add("thunderplug", kernel_kobj);

        if (!thunderplug_kobj) {
                pr_err("%s Interface create failed!\n",
                        __FUNCTION__);
                return -ENOMEM;
        }

        sysfs_result = sysfs_create_group(thunderplug_kobj, &thunderplug_attr_group);

        if (sysfs_result) {
                pr_info("%s sysfs create failed!\n", __FUNCTION__);
                kobject_put(thunderplug_kobj);
        }

		lcd_worker.notifier_call = lcd_notifier_callback;

        lcd_register_client(&lcd_worker);

		pr_info("%s : registering input boost", THUNDERPLUG);
		ret = input_register_handler(&tplug_input_handler);
		if (ret) {
		pr_err("%s: Failed to register input handler: %d\n",
		       THUNDERPLUG, ret);
		}

		tplug_wq = alloc_workqueue("tplug",
				WQ_HIGHPRI | WQ_UNBOUND, 1);

		tplug_resume_wq = alloc_workqueue("tplug_resume",
				WQ_HIGHPRI | WQ_UNBOUND, 1);

		tplug_boost_wq = alloc_workqueue("tplug_boost",
				WQ_HIGHPRI | WQ_UNBOUND, 1);

		INIT_DELAYED_WORK(&tplug_work, tplug_work_fn);
		INIT_DELAYED_WORK(&tplug_resume_work, tplug_resume_work_fn);
		INIT_DELAYED_WORK(&tplug_boost, tplug_boost_work_fn);
		queue_delayed_work_on(0, tplug_wq, &tplug_work,
		                      msecs_to_jiffies(10));

        pr_info("%s: init\n", THUNDERPLUG);

        return ret;
}
Exemplo n.º 15
0
int __init intelli_plug_init(void)
{
	int rc;
#if defined (CONFIG_POWERSUSPEND) || defined(CONFIG_HAS_EARLYSUSPEND)
	int cpu;
	struct cpufreq_policy *policy;
	struct ip_cpu_info *l_ip_info;
#endif

	nr_possible_cores = num_possible_cpus();

	pr_info("intelli_plug: version %d.%d by faux123\n",
		 INTELLI_PLUG_MAJOR_VERSION,
		 INTELLI_PLUG_MINOR_VERSION);

	if (nr_possible_cores > 2) {
		nr_run_hysteresis = NR_RUN_HYSTERESIS_QUAD;
		nr_run_profile_sel = 0;
	} else {
		nr_run_hysteresis = NR_RUN_HYSTERESIS_DUAL;
		nr_run_profile_sel = NR_RUN_ECO_MODE_PROFILE;
	}

#if defined (CONFIG_POWERSUSPEND) || defined(CONFIG_HAS_EARLYSUSPEND)
	for_each_online_cpu(cpu) {
		l_ip_info = &per_cpu(ip_info, cpu);
		policy = cpufreq_cpu_get(cpu);
		l_ip_info->sys_max = policy->cpuinfo.max_freq;
		l_ip_info->cur_max = policy->max;
	}
#endif

	rc = input_register_handler(&intelli_plug_input_handler);
#ifdef CONFIG_POWERSUSPEND
	register_power_suspend(&intelli_plug_power_suspend_driver);
#endif
#ifdef CONFIG_HAS_EARLYSUSPEND
	register_early_suspend(&intelli_plug_early_suspend_driver);
#endif
	intelliplug_wq = alloc_workqueue("intelliplug",
				WQ_HIGHPRI | WQ_UNBOUND, 1);
	intelliplug_boost_wq = alloc_workqueue("iplug_boost",
				WQ_HIGHPRI | WQ_UNBOUND, 1);
	INIT_DELAYED_WORK(&intelli_plug_work, intelli_plug_work_fn);
	INIT_DELAYED_WORK(&intelli_plug_boost, intelli_plug_boost_fn);
	queue_delayed_work_on(0, intelliplug_wq, &intelli_plug_work,
		msecs_to_jiffies(10));

	return 0;
}
Exemplo n.º 16
0
static void kgdboc_restore_input_helper(struct work_struct *dummy)
{
	/*
                                                           
                                                         
                                                 
  */
	mutex_lock(&kgdboc_reset_mutex);

	if (input_register_handler(&kgdboc_reset_handler) == 0)
		input_unregister_handler(&kgdboc_reset_handler);

	mutex_unlock(&kgdboc_reset_mutex);
}
Exemplo n.º 17
0
static void kgdboc_restore_input_helper(struct work_struct *dummy)
{
	/*
	 * We need to take a mutex to prevent several instances of
	 * this work running on different CPUs so they don't try
	 * to register again already registered handler.
	 */
	mutex_lock(&kgdboc_reset_mutex);

	if (input_register_handler(&kgdboc_reset_handler) == 0)
		input_unregister_handler(&kgdboc_reset_handler);

	mutex_unlock(&kgdboc_reset_mutex);
}
Exemplo n.º 18
0
static int __init keybdev_init(void)
{
	input_register_handler(&keybdev_handler);
	kbd_ledfunc = keybdev_ledfunc;

	if (jp_kbd_109) {
		x86_keycodes[0xb5] = 0x73;	/* backslash, underscore */
		x86_keycodes[0xb6] = 0x70;
		x86_keycodes[0xb7] = 0x7d;	/* Yen, pipe */
		x86_keycodes[0xb8] = 0x79;
		x86_keycodes[0xb9] = 0x7b;
	}

	return 0;
}
Exemplo n.º 19
0
static int mac_hid_start_emulation(void)
{
	int err;

	err = mac_hid_create_emumouse();
	if (err)
		return err;

	err = input_register_handler(&mac_hid_emumouse_handler);
	if (err) {
		mac_hid_destroy_emumouse();
		return err;
	}

	return 0;
}
Exemplo n.º 20
0
static int init(void)
{
	input_boost_wq = alloc_workqueue("input_boost_wq", WQ_FREEZABLE | WQ_HIGHPRI, 1);

	if (!input_boost_wq)
		return -EFAULT;

	INIT_WORK(&input_boost_work, do_input_boost);
	INIT_DELAYED_WORK(&rem_input_boost, do_rem_input_boost);
	INIT_WORK(&touchboost_inputopen.inputopen_work, boost_input_open);

	input_register_handler(&boost_input_handler);

	cpufreq_register_notifier(&boost_adjust_nb, CPUFREQ_POLICY_NOTIFIER);

	return 0;
}
Exemplo n.º 21
0
static int touch_boost_init(void)
{
	int ret;

	touch_boost_wq = alloc_workqueue("touch_boost_wq", WQ_HIGHPRI, 0);
	if (!touch_boost_wq)
		return -EFAULT;

	INIT_WORK(&input_boost_work, do_input_boost);
	INIT_DELAYED_WORK(&input_boost_rem, do_input_boost_rem);

	ret = input_register_handler(&touchboost_input_handler);
	if (ret)
		pr_err("Cannot register touchboost input handler.\n");

	return ret;
}
Exemplo n.º 22
0
static int __init cfboost_init(void)
{
	int ret;

	cfb_wq = create_workqueue("icfb-wq");
	if (!cfb_wq)
		return -ENOMEM;
	INIT_WORK(&boost, cfb_boost);
	INIT_DELAYED_WORK(&unboost, cfb_unboost);
	ret = input_register_handler(&cfb_input_handler);
	if (ret) {
		destroy_workqueue(cfb_wq);
		return ret;
	}
	pm_qos_add_request(&qos_req, PM_QOS_CPU_FREQ_MIN,
			   PM_QOS_DEFAULT_VALUE);
	return 0;
}
Exemplo n.º 23
0
static int init(void)
{
	int ret;
	input_boost_wq = alloc_workqueue("input_boost_wq", WQ_FREEZABLE | WQ_HIGHPRI, 1);

	if (!input_boost_wq)
		return -EFAULT;

	INIT_WORK(&input_boost_work, do_input_boost);
	INIT_DELAYED_WORK(&rem_input_boost, do_rem_input_boost);

	ret = input_register_handler(&boost_input_handler);
	if (ret) {
		pr_err("Failed to register input handler, error: %d", ret);
		return ret;
	}

	cpufreq_register_notifier(&boost_adjust_nb, CPUFREQ_POLICY_NOTIFIER);

	return 0;
}
Exemplo n.º 24
0
int __init intelli_plug_init(void)
{
        int rc;

        //pr_info("intelli_plug: scheduler delay is: %d\n", delay);
        pr_info("intelli_plug: version %d.%d by faux123\n",
                 INTELLI_PLUG_MAJOR_VERSION,
                 INTELLI_PLUG_MINOR_VERSION);

        sampling_time = DEF_SAMPLING_MS;

        rc = input_register_handler(&intelli_plug_input_handler);
        INIT_DELAYED_WORK(&intelli_plug_work, intelli_plug_work_fn);
        schedule_delayed_work_on(0, &intelli_plug_work,
                msecs_to_jiffies(sampling_time));

#ifdef CONFIG_HAS_EARLYSUSPEND
        register_early_suspend(&intelli_plug_early_suspend_struct_driver);
#endif
        return 0;
}
Exemplo n.º 25
0
static int cpu_boost_init(void)
{
	int cpu, ret;
	struct cpu_sync *s;

	cpu_boost_wq = alloc_workqueue("cpuboost_wq", WQ_HIGHPRI, 0);
	if (!cpu_boost_wq)
		return -EFAULT;

	INIT_WORK(&input_boost_work, do_input_boost);
	INIT_DELAYED_WORK(&input_boost_rem, do_input_boost_rem);

	for_each_possible_cpu(cpu) {
		s = &per_cpu(sync_info, cpu);
		s->cpu = cpu;
	}
	cpufreq_register_notifier(&boost_adjust_nb, CPUFREQ_POLICY_NOTIFIER);
	ret = input_register_handler(&cpuboost_input_handler);

	return ret;
}
Exemplo n.º 26
0
int __init sleepy_plug_init(void)
{
	int rc;

	pr_info("sleepy_plug: version %d.%d by rmbq\n",
		 SLEEPY_PLUG_MAJOR_VERSION,
		 SLEEPY_PLUG_MINOR_VERSION);

	rc = input_register_handler(&sleepy_plug_input_handler);

	sleepy_plug_wq = alloc_workqueue("sleepyplug",
				WQ_HIGHPRI | WQ_UNBOUND, 1);

#ifdef CONFIG_POWERSUSPEND
	register_power_suspend(&sleepy_plug_power_suspend_driver);
#endif

	INIT_DELAYED_WORK(&sleepy_plug_work, sleepy_plug_work_fn);
	queue_delayed_work_on(0, sleepy_plug_wq, &sleepy_plug_work,
		msecs_to_jiffies(10));

	return 0;
}
Exemplo n.º 27
0
int __init rfkill_handler_init(void)
{
	switch (rfkill_master_switch_mode) {
	case RFKILL_INPUT_MASTER_UNBLOCKALL:
		rfkill_master_switch_op = RFKILL_GLOBAL_OP_UNBLOCK;
		break;
	case RFKILL_INPUT_MASTER_RESTORE:
		rfkill_master_switch_op = RFKILL_GLOBAL_OP_RESTORE;
		break;
	case RFKILL_INPUT_MASTER_UNLOCK:
		rfkill_master_switch_op = RFKILL_GLOBAL_OP_UNLOCK;
		break;
	default:
		return -EINVAL;
	}

	spin_lock_init(&rfkill_op_lock);

	/* Avoid delay at first schedule */
	rfkill_last_scheduled =
			jiffies - msecs_to_jiffies(RFKILL_OPS_DELAY) - 1;
	return input_register_handler(&rfkill_handler);
}
Exemplo n.º 28
0
int __init intelli_plug_init(void)
{
	int rc;

	nr_possible_cores = num_possible_cpus();

	pr_info("intelli_plug: version %d.%d by faux123\n",
		 INTELLI_PLUG_MAJOR_VERSION,
		 INTELLI_PLUG_MINOR_VERSION);

	if (nr_possible_cores > 2) {
		nr_run_hysteresis = NR_RUN_HYSTERESIS_QUAD;
		nr_run_profile_sel = 0;
	} else {
		nr_run_hysteresis = NR_RUN_HYSTERESIS_DUAL;
		nr_run_profile_sel = NR_RUN_ECO_MODE_PROFILE;
	}

	rc = input_register_handler(&intelli_plug_input_handler);
#ifdef CONFIG_POWERSUSPEND
	register_power_suspend(&intelli_plug_power_suspend_driver);
#endif
#ifdef CONFIG_HAS_EARLYSUSPEND
	register_early_suspend(&intelli_plug_early_suspend_driver);
#endif
	intelliplug_wq = alloc_workqueue("intelliplug",
				WQ_HIGHPRI | WQ_UNBOUND, 1);
	intelliplug_boost_wq = alloc_workqueue("iplug_boost",
				WQ_HIGHPRI | WQ_UNBOUND, 1);
	INIT_DELAYED_WORK(&intelli_plug_work, intelli_plug_work_fn);
	INIT_DELAYED_WORK(&intelli_plug_boost, intelli_plug_boost_fn);
	queue_delayed_work_on(0, intelliplug_wq, &intelli_plug_work,
		msecs_to_jiffies(10));

	return 0;
}
Exemplo n.º 29
0
static int __init sweep2wake_init(void)
{
	int rc = 0;

	printk(KERN_INFO "sweep2sleep: %s version %s\n", DRIVER_DESCRIPTION,
		DRIVER_VERSION);
	printk(KERN_INFO "sweep2sleep: by %s\n", DRIVER_AUTHOR);

	sweep2wake_pwrdev = input_allocate_device();

	input_set_capability(sweep2wake_pwrdev, EV_KEY, KEY_POWER);

	sweep2wake_pwrdev->name = "s2s_pwrkey";
	sweep2wake_pwrdev->phys = "s2s_pwrkey/input0";

	rc = input_register_device(sweep2wake_pwrdev);

	s2s_input_wq = create_workqueue("s2siwq");

	INIT_WORK(&s2s_input_work, s2s_input_callback);
	rc = input_register_handler(&s2s_input_handler);

	return 0;
}
Exemplo n.º 30
0
static int __init apmpower_init(void)
{
	return input_register_handler(&apmpower_handler);
}