View Single Post
Old 11-17-2012, 12:49 AM   #17
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 712
Karma: 2290994
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by h1uke View Post
just FYI. My impression that linux touchscreen device driver on PW cannot
convey 3- or more fingers tap messages.
I tried this many times while creating a rudimentary touchscreen support for Qt
on KPW, but with no luck.
PW touchscreen kernel driver code expects up to 16 simultaneous touches, but tracks only up to 4. PW uses Cypress TrueTocuh Gen3 touchscreen, which certainly supports more than 2 simultaneous touches: you can look at it's capabilities at http://www.cypress.com/touch (open "Solutions" tab; can't provide direct link).

Excerpt from 5.3.0 kernel sources:
Spoiler:
Code:
$ grep -A34 -m1 cyttsp_i2c_platform_data drivers/input/touchscreen/cyttsp.c
static struct cyttsp_platform_data cyttsp_i2c_platform_data = {
	.mt_sync = 0,
	.maxx = 758,
	.maxy = 1024,
	.flags = 0,
	.gen = CY_GEN3,
	.use_st = 0,
	.use_mt = 1,
	.use_trk_id = 1,
	.use_hndshk = 1,
	.use_timer = 0,
	.use_sleep = 1,
	.use_gestures = 0,
	.use_load_file = 1,
	.use_force_fw_update = 1,
	.use_virtual_keys = 0,
	.use_lpm = 0,
	/* activate up to 4 groups
	 * and set active distance
	 */
	.gest_set = 0,
	/* change act_intrvl to customize the Active power state
	 * scanning/processing refresh interval for Operating mode
	 */
	.act_intrvl = CY_ACT_INTRVL_DFLT,
	/* change tch_tmout to customize the touch timeout for the
	 * Active power state for Operating mode
	 */
	.tch_tmout = CY_TCH_TMOUT_DFLT,
	/* change lp_intrvl to customize the Low Power power state
	 * scanning/processing refresh interval for Operating mode
	 */
	.lp_intrvl = CY_LP_INTRVL_DFLT,
	.name = CY_DRIVER_NAME,
};
Code:
$ grep -B1 -m3 'CY_NUM.*ID' drivers/input/touchscreen/cyttsp.h
/* maximum number of concurrent ST track IDs */
#define CY_NUM_ST_TCH_ID            2
/* maximum number of concurrent MT track IDs */
#define CY_NUM_MT_TCH_ID            4
/* maximum number of track IDs */
#define CY_NUM_TRK_ID               16
Code:
$ grep mt_create_slots drivers/input/touchscreen/cyttsp.c
		input_mt_create_slots(input_device, CY_NUM_TRK_ID);
Code:
$ grep -A33 Multi-Touch ./drivers/input/touchscreen/cyttsp.c
	/* set Multi-Touch current event signals */
	for (id = 0; id < CY_NUM_MT_TCH_ID; id++) {
		if (t->cur_mt_tch[id] >= CY_NUM_TRK_ID)
			continue;
		
		if ((slot = find_slot_by_id(t->cur_mt_tch[id])) < 0)
		{
			slot = find_next_slot();
			slots[slot] = t->cur_mt_tch[id];				
		}
		
		input_report_abs(ts->input, ABS_MT_SLOT, slot);
		input_report_abs(ts->input, ABS_MT_TRACKING_ID, slot);

		input_report_abs(ts->input, ABS_MT_POSITION_X,
						t->cur_mt_pos[id][CY_XPOS]);
		input_report_abs(ts->input, ABS_MT_POSITION_Y,
						t->cur_mt_pos[id][CY_YPOS]);
		if (mt_sync_func)
			mt_sync_func(ts->input);

		ts->act_trk[id] = CY_TCH;
		ts->prv_mt_pos[id][CY_XPOS] = t->cur_mt_pos[id][CY_XPOS];
		ts->prv_mt_pos[id][CY_YPOS] = t->cur_mt_pos[id][CY_YPOS];
		contacts_left++;
	}

	send_user_event(ts, ts->num_prv_st_tch, contacts_left);
	ts->num_prv_st_tch = contacts_left;
	
	input_report_key(ts->input, BTN_TOUCH, contacts_left > 0);
	input_report_key(ts->input, BTN_TOOL_FINGER, contacts_left >= 1);
	input_report_key(ts->input, BTN_TOOL_DOUBLETAP, contacts_left >= 2);
	input_report_key(ts->input, BTN_TOOL_TRIPLETAP, contacts_left == 3);


KT touchscreen driver has similar explicit limitation for number of simultaneous touches:
Code:
$ grep -B1 -m1 MAX_CONTACTS drivers/input/touchscreen/zforceint.h
/* Device specific configuration */
#define MAX_CONTACTS                2    // Maximum number of contacts the sensor can report
Code:
$ grep mt_create_slots drivers/input/touchscreen/zforce.c  
  input_mt_create_slots(tdev, MAX_CONTACTS);
BTW, you can try your's luck with enabling of 1mm stylus sensing (selection should be possible with file buried somewhere in /sys):
Spoiler:
Code:
$ grep -B1 CY_SCN drivers/input/touchscreen/cyttsp.h
/* Scan Type selection for finger and/or stylus activation */
#define CY_SCN_TYP_DFLT 0x01 /* finger only mutual scan */
#define CY_SCN_TYP_MUT_SELF 0x03 /*self scan and mutual scan*/
#define CY_SCN_TYP_SELF 0x02 /*self scan*/
#define CY_SCN_TYP_MUTUAL 0x01 /*mutual scan*/
Code:
$ grep '\(mutual\|self\|scan\)' ./drivers/input/touchscreen/cyttsp.c
	 * scanning/processing refresh interval for Operating mode
	 * scanning/processing refresh interval for Operating mode
 * 	test mode, scan type, 
 * 	TT_MODE[7:6] new data counter (00, 10 or 01 11), TT_MODE[1:0] scan type
		printk(KERN_INFO "%s:scan_type=0x%x\n", __func__, cyttsp_tsc->scn_typ);
	 * new data counter TT_MODE[7:6] = 00, scan type TT_MODE[1:0] = 00 (mutual scan)
	sscanf(buf, "%d %d %d", &ai, &tout, &li);
static ssize_t attr_sysinfo_scan_type_show(struct device *dev,
		printk(KERN_ERR "cyttsp:scan_type::cannot communicate when device is suspended");
	printk(KERN_INFO "scan type read 0x%x", scn_typ);
			len = sprintf(buf, "mutual-self");
			len = sprintf(buf, "mutual");
			len = sprintf(buf, "self");
			len = sprintf(buf, "?scan type: 0x%x", scn_typ);
static ssize_t attr_sysinfo_scan_type_store(struct device *dev,
		printk(KERN_ERR "cyttsp:scan_type::cannot communicate when device is suspended");
		if(0 == strncmp(buf, "mutual", 6)) {
		}else if(0 == strncmp(buf, "self", 4)) {
		}else if(0 == strncmp(buf, "mutual-self", 11)) {
			printk(KERN_ERR "cannot recognize scan type %s", buf);
		printk(KERN_INFO "\n\n%s scan_type read: 0x%x\n\n", __func__, st_read);
	printk(KERN_INFO "\n\n%s scan_type read: 0x%x retry %d\n\n", __func__, st_read, retry);	
static struct device_attribute sysinfo_scan_type =
	__ATTR(sysinfo_scan_type, 0644, attr_sysinfo_scan_type_show, attr_sysinfo_scan_type_store);	
	retval = device_create_file(&pdev->dev, &sysinfo_scan_type);	
		goto device_create_error_scan_type;
device_create_error_scan_type:
	device_remove_file(&pdev->dev, &sysinfo_scan_type);
	device_remove_file(&pdev->dev, &sysinfo_scan_type);
eureka is offline   Reply With Quote