コード例 #1
0
//[*]--------------------------------------------------------------------------------------------------[*]
void	odroidq_enable	(struct touch *ts)
{
	if(ts->disabled)		{
		odroidq_calibration(ts);	
		
		enable_irq(ts->irq);		ts->disabled = false;
	}
}
コード例 #2
0
ファイル: odroidq-touch.c プロジェクト: amuxtux/exynos4210
//[*]--------------------------------------------------------------------------------------------------[*]
void 	odroidq_work		(struct touch *ts)
{
	status_u		status;
	button_u		button;
	event_stack_u	event_stack;
	unsigned char	cmd, id;
	
	cmd = TOUCH_STATUS;
	if(ts->pdata->i2c_read(ts->client, (unsigned char *)&cmd, sizeof(cmd), (unsigned char *)&status.byte[0], sizeof(status_u)) < 0)	return;

	if(ts->pdata->keycode)	{
		cmd = BUTTON_STATUS;
		if(ts->pdata->i2c_read(ts->client, (unsigned char *)&cmd, sizeof(cmd), (unsigned char *)&button.ubyte, sizeof(button_u)) < 0)	return;
		ts->pdata->key_report(ts, button.ubyte);
	}

	if(status.bits.fifo_overflow || status.bits.large_object || status.bits.abnomal_status)	{
		printk("[Error Status] fifo_overflow(%d), large_object(%d), abnomal_status(%d)\n"	, status.bits.fifo_overflow
																							, status.bits.large_object
																							, status.bits.abnomal_status);
		// Error reconfig
		odroidq_calibration	(ts);
		return;
	}

	do	{
		cmd = EVENT_STACK;
		ts->pdata->i2c_read(ts->client, (unsigned char *)&cmd,  sizeof(cmd), (unsigned char *)&event_stack.byte[0],	sizeof(event_stack_u));

		if(status.bits.fifo_valid)	{
			if((event_stack.bits.event != EVENT_UNKNOWN) && (event_stack.bits.number < ts->pdata->max_fingers))	{
				if((event_stack.bits.event == EVENT_PRESS) || (event_stack.bits.event == EVENT_MOVE))	{
					ts->finger[event_stack.bits.number].event		= TS_EVENT_MOVE;
					ts->finger[event_stack.bits.number].id			= event_stack.bits.number;
					ts->finger[event_stack.bits.number].x			=			
						(unsigned int)(((event_stack.bits.msb_x << 8) & 0xF00) | event_stack.bits.lsb_x);
					ts->finger[event_stack.bits.number].y			=
						(unsigned int)(((event_stack.bits.msb_y << 8) & 0xF00) | event_stack.bits.lsb_y);
					ts->finger[event_stack.bits.number].pressure	=
						(unsigned int)(event_stack.bits.pressure);
				}
				else	{
					if(ts->finger[event_stack.bits.number].event == TS_EVENT_MOVE)
						ts->finger[event_stack.bits.number].event = TS_EVENT_RELEASE;
					else
						ts->finger[event_stack.bits.number].event = TS_EVENT_UNKNOWN;
				}
			}
		}		
	}	while(!gpio_get_value(ts->pdata->irq_gpio));

	ts->pdata->report(ts);
}
コード例 #3
0
//[*]--------------------------------------------------------------------------------------------------[*]
int		odroidq_early_probe	(struct touch *ts)
{
#if defined(SOFT_AVR_FILTER_ENABLE)
	if(ts->pdata->max_fingers)	{
		if(!(pSoftFilter = kzalloc(sizeof(soft_filter_t) * ts->pdata->max_fingers, GFP_KERNEL)))	{
			printk("touch soft-filter struct malloc error!\n");	return	-ENOMEM;
		}
	}
#endif

	odroidq_calibration(ts);	

	return 	0;
}