*** linux-orig/drivers/char//ads7846_ts.c Wed Jun 18 16:12:26 2003 --- linux/drivers/char//ads7846_ts.c Sat Aug 30 20:58: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,91 ---- static DECLARE_WAIT_QUEUE_HEAD(queue); static int head, tail, sample; static char pendown = 0; ! static unsigned long Pressure; #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)) ) --- 319,325 ---- } ! #elif 0 #define abscmpmin(x,y,d) (\ ((int)((x)-(y))<(int)(d)) && \ ((int)((y)-(x))<(int)(d)) ) *************** *** 368,374 **** } } } ! Pressure = 1; for(i=0;i<2;i++){ if( !z[i] ) Pressure = 0; --- 368,374 ---- } } } ! Pressure = 2; for(i=0;i<2;i++){ if( !z[i] ) Pressure = 0; *************** *** 570,576 **** // 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); --- 570,579 ---- // printk("pen up\n"); } else { ! if (z1) { ! Pressure = (15000 - x * (z2 - z1) / z1) >> 5; ! } else ! 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; --- 910,919 ---- 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; *************** *** 919,925 **** #if defined(CONFIG_ARCH_PXA_POODLE) && !defined(CONFIG_POODLE_TR0) // else if( !pendown ) else if( !isTimer ) ! Pressure = 1; #endif mod_timer(&tp_main_timer, jiffies + HZ / 100); } else { --- 922,928 ---- #if defined(CONFIG_ARCH_PXA_POODLE) && !defined(CONFIG_POODLE_TR0) // else if( !pendown ) else if( !isTimer ) ! Pressure = 4; #endif mod_timer(&tp_main_timer, jiffies + HZ / 100); } else { *************** *** 1233,1238 **** --- 1236,1244 ---- break; case 17: /* Clear all buffer data */ print_par(); + break; + case 64: /* read Pressure */ + copy_to_user((void *)arg, &Pressure, sizeof(Pressure)); break; default: return -EINVAL;