*** linux-orig/drivers/char//ads7846_ts.c Wed Jun 18 16:12:26 2003 --- linux/drivers/char//ads7846_ts.c Wed Sep 3 23:10:33 2003 *************** *** 85,91 **** static DECLARE_WAIT_QUEUE_HEAD(queue); static int head, tail, sample; static char pendown = 0; ! unsigned long Pressure; #if defined(CONFIG_ARCH_PXA_CORGI) static char ispass = 1; #endif --- 85,92 ---- static DECLARE_WAIT_QUEUE_HEAD(queue); static int head, tail, sample; static char pendown = 0; ! static unsigned long Pressure; ! static unsigned long tsPressure; #if defined(CONFIG_ARCH_PXA_CORGI) static char ispass = 1; #endif *************** *** 319,325 **** } ! #elif 1 #define abscmpmin(x,y,d) (\ ((int)((x)-(y))<(int)(d)) && \ ((int)((y)-(x))<(int)(d)) ) --- 320,326 ---- } ! #elif 0 #define abscmpmin(x,y,d) (\ ((int)((x)-(y))<(int)(d)) && \ ((int)((y)-(x))<(int)(d)) ) *************** *** 482,491 **** // printk("x=%d,y=%d\n",tp->xd,tp->yd); ! if (z1 != 0) Pressure = Rx * (tp->xd) * ((10*z2/z1) - 1*10) >> 10; ! else ! Pressure = 0; cmd = (1u << ADSCTRL_PD0_SH) | (1u << ADSCTRL_PD1_SH) | --- 483,493 ---- // printk("x=%d,y=%d\n",tp->xd,tp->yd); ! if (z1 != 0) { Pressure = Rx * (tp->xd) * ((10*z2/z1) - 1*10) >> 10; ! tsPressure = (15000 - x[3] * (z2 - z1) / z1) >> 4; ! } else ! tsPressure = Pressure = 0; cmd = (1u << ADSCTRL_PD0_SH) | (1u << ADSCTRL_PD1_SH) | *************** *** 566,576 **** // printk("fail %d\n", fail); if (fail == TOUCH_PANEL_AVERAGE) { ! Pressure = 0; // printk("pen up\n"); } else { ! Pressure = 1; tp->xd = tx / (TOUCH_PANEL_AVERAGE - fail); tp->yd = ty / (TOUCH_PANEL_AVERAGE - fail); // printk("pen position (%d,%d)\n", tx, ty); --- 568,581 ---- // printk("fail %d\n", fail); if (fail == TOUCH_PANEL_AVERAGE) { ! tsPressure = Pressure = 0; // printk("pen up\n"); } else { ! if (z1) { ! tsPressure = Pressure = (15000 - x * (z2 - z1) / z1) >> 4; ! } else ! tsPressure = Pressure = 0; tp->xd = tx / (TOUCH_PANEL_AVERAGE - fail); tp->yd = ty / (TOUCH_PANEL_AVERAGE - fail); // printk("pen position (%d,%d)\n", tx, ty); *************** *** 907,916 **** tc.pressure = 500; #elif defined(CONFIG_ARCH_PXA_CORGI) if( pos_dt.xd && pos_dt.yd && Pressure ) { ! tc.pressure = 500; #else if( pos_dt.xd && pos_dt.yd ){ ! tc.pressure = 1; #endif before_data = tc; pendown = 1; --- 912,921 ---- tc.pressure = 500; #elif defined(CONFIG_ARCH_PXA_CORGI) if( pos_dt.xd && pos_dt.yd && Pressure ) { ! tc.pressure = Pressure; #else if( pos_dt.xd && pos_dt.yd ){ ! tc.pressure = Pressure; #endif before_data = tc; pendown = 1; *************** *** 1233,1238 **** --- 1238,1246 ---- break; case 17: /* Clear all buffer data */ print_par(); + break; + case 64: /* read Pressure */ + copy_to_user((void *)arg, &tsPressure, sizeof(tsPressure)); break; default: return -EINVAL;