//[*]--------------------------------------------------------------------------------------------------[*]
static void bh1780_work_func(struct work_struct *work)
{
	struct bh1780_data *bh1780 = container_of((struct delayed_work *)work,
						  struct bh1780_data, work);

	bh1780_measure(bh1780);

    #if defined(CONFIG_ODROID_EXYNOS5_IOBOARD_DEBUG)
        printk("===> %s : %d \n", __func__, bh1780->light_data);
    #endif

    if(bh1780->enabled)
	    schedule_delayed_work(&bh1780->work, BH1780_WORK_PERIOD);
	else    
	    bh1780->light_data = 0;
}
예제 #2
0
static void bh1780_work_func(struct work_struct *work)
{
	struct bh1780_data *bh1780 = container_of((struct delayed_work *)work,
						  struct bh1780_data, work);
	unsigned long delay = delay_to_jiffies(atomic_read(&bh1780->delay));

	bh1780_measure(bh1780);

	input_report_abs(bh1780->input, ABS_X, bh1780->light_data);
	input_sync(bh1780->input);

	mutex_lock(&bh1780->data_mutex);
	bh1780->light_data_last = bh1780->light_data;
	mutex_unlock(&bh1780->data_mutex);

	schedule_delayed_work(&bh1780->work, delay);
}