};
+static int MX1TS_presed = 0;
+static int MX1TS_lastx = 0;
+static int MX1TS_lasty = 0;
+
static inline void mx1ts_reg_set_mask(struct mx1ts *mts , unsigned int reg, u32 mask)
{
u32 val;
{
unsigned int value;
- /*while (1) {
- value = mx1ts_reg_read(mts, ASP_ACNTLCR);
- value = 0X00000000;
- value |= ASP_SW3 | ASP_SW6 | ASP_SW5 | ASP_BGE | ASP_PADE ;
- mx1ts_reg_write(mts, ASP_ACNTLCR, value);
-
- pen_x = mx1ts_reg_read(mts, ASP_PADFIFO);
- mx1ts_evt_add(mts->ts_idev, 20 , pen_x, 00);*/
-
/* Enable pen touch interrupt. */
value = mx1ts_reg_read(mts, ASP_ICNTLR);
- value |= /*ASP_EDGE | ASP_POL |*/ ASP_PIRQE;
+ value |= ASP_EDGE | /*ASP_POL |*/ ASP_PIRQE;
mx1ts_reg_write(mts, ASP_ICNTLR, value);
printk(KERN_ERR "mx1_touchscreen pen_touch: aktivuji pen down interrupt \n");
static void mx1ts_evt_add(struct input_dev *idev, u8 p , u16 x, u16 y)
{
if((x < 7900 || x > 8900) && (y < 7751 || y > 10900)) {
+ MX1TS_presed = 1;
+ MX1TS_lastx = x;
+ MX1TS_lasty = y;
mx1ts_evt_add_touch(idev,p, x, y); /* TODO opravit pen_up pen_down zrejme chyba HW ??? TODO */
- mx1ts_evt_add_up(idev, x, y);
+
+
+ } else {
+ if(MX1TS_presed == 1) {
+ MX1TS_presed = 0;
+ mx1ts_evt_add_up(idev, MX1TS_lastx, MX1TS_lasty);
+ }
}
-
-
}
/*