static void vibrator_enable_set_timeout(struct timed_output_dev *sdev,
	int timeout)
{
	 int extend_time = 0;

	printk(KERN_NOTICE "Vibrator: Set duration: %dms + %dms\n", timeout, extend_time);
	if( timeout > 0 )
	{
#if defined(CONFIG_HAS_WAKELOCK)
		if(!wake_lock_active(&vib_wl))
	wake_lock(&vib_wl);
#endif /*CONFIG_HAS_WAKELOCK*/
		set_vibrator(VIB_ON);
		if(timeout < MIN_TIME_MS)
			extend_time = MIN_TIME_MS - timeout;
		else
			extend_time = 0;
	if(cancel_delayed_work_sync(&vibrator_off_work))
		printk(KERN_NOTICE "Vibrator: Cancel off work to re-start\n");
	
	queue_delayed_work(vib_workqueue, &vibrator_off_work, msecs_to_jiffies(timeout + extend_time));
}
	else if(!timeout)
	{
		extend_time = 0;
		set_vibrator(VIB_OFF);
#if defined(CONFIG_HAS_WAKELOCK)
		if(wake_lock_active(&vib_wl))
			wake_unlock(&vib_wl);
#endif /*CONFIG_HAS_WAKELOCK*/
	}

}
static void msm_vibrator_update(struct work_struct *work)
{
	struct msm_vib *vib = container_of(work, struct msm_vib,
					 work);

	set_vibrator(vib->motor_en, vib->state);
}
static void vibrator_off_worker(struct work_struct *work)
{
	printk(KERN_NOTICE "Vibrator: %s\n", __func__);

	set_vibrator(VIB_OFF);
#if defined(CONFIG_HAS_WAKELOCK)
	if(wake_lock_active(&vib_wl))
	wake_unlock(&vib_wl);
#endif /*CONFIG_HAS_WAKELOCK*/
}
示例#4
0
void vlx_nand_boot(char * kernel_pname, char * cmdline, int backlight_set)
{
	boot_img_hdr *hdr = (void *)raw_header;
	block_dev_desc_t *dev = NULL;
	char * mode_ptr = NULL;
	int i,j;
	long long start = get_ticks();

	dev = get_dev("mmc", 1);
	if(NULL == dev){
		debugf("Fatal Error,get_dev mmc failed!\n");
		return;
	}

#ifdef CONFIG_SPLASH_SCREEN
	_boot_display_logo(dev, backlight_set);
	performance_debug("7:");
#endif
	set_vibrator(FALSE);

#if ((!BOOT_NATIVE_LINUX)||(BOOT_NATIVE_LINUX_MODEM))
	//load required image which config in table
	i = 0;
	while(s_boot_image_table[i]){
		j =0;
		while(s_boot_image_table[i][j].partition){
			_boot_load_required_image(dev,s_boot_image_table[i][j]);
			j++;
		}
		i++;
	}
	performance_debug("8:");
#endif
	//loader kernel and ramdisk
	if(!_boot_load_kernel_ramdisk_image(dev, kernel_pname, hdr))
		return;
	performance_debug("9:");
	load_image_time = get_ticks() - start;
	//secure check for secure boot
	_boot_secure_check();

        if(creat_cmdline(cmdline,hdr)){
            debugf("creat_cmdline failed\n");
            return;
        }
	performance_debug("10:");

#if BOOT_NATIVE_LINUX_MODEM
	//sipc addr clear
	sipc_addr_reset();
#endif
	vlx_entry();
}
static int msm_vibrator_suspend(struct device *dev)
{
	struct msm_vib *vib = dev_get_drvdata(dev);

	pr_info("[VIB] %s\n",__func__);

	hrtimer_cancel(&vib->vib_timer);
	cancel_work_sync(&vib->work);
	/* turn-off vibrator */
	set_vibrator(vib->motor_en, 0);

	return 0;
}
示例#6
0
static void update_vibrator(struct work_struct *work)
{
	set_vibrator(vibe_state);
}