/* Enable pen touch interrupt. */
value = mx1ts_reg_read(mts, ASP_ICNTLR);
- value |= /*ASP_POL detekuje zvednuti |*/ ASP_EDGE | ASP_PIRQE;
+ value |= /*ASP_EDGE |*/ ASP_PIRQE;
mx1ts_reg_write(mts, ASP_ICNTLR, value);
- printk(KERN_ERR "mx1_touchscreen: aktivuji pen down interrupt \n");
+ printk(KERN_ERR "mx1_touchscreen pen_touch: aktivuji pen down interrupt \n");
}
static void mx1ts_disable_pen_touch_interrupt(struct mx1ts *mts)
value = mx1ts_reg_read(mts, ASP_ICNTLR);
value &= ~ASP_PIRQE;
mx1ts_reg_write(mts, ASP_ICNTLR, value);
- printk(KERN_ERR "mx1_touchscreen: deaktivuji pen down interrupt \n");
+ printk(KERN_ERR "mx1_touchscreen pen_touch: deaktivuji pen down interrupt \n");
}
static void mx1ts_enable_pen_up_interrupt(struct mx1ts *mts)
value = mx1ts_reg_read(mts, ASP_ICNTLR);
value |= ASP_PUIE;
mx1ts_reg_write(mts, ASP_ICNTLR, value);
- printk(KERN_ERR "mx1_touchscreen: aktivuji pen up interrupt \n");
+ printk(KERN_ERR "mx1_touchscreen pen_up: aktivuji pen up interrupt \n");
}
static void mx1ts_disable_pen_up_interrupt(struct mx1ts *mts)
value = mx1ts_reg_read(mts, ASP_ICNTLR);
value &= ~ASP_PUIE;
mx1ts_reg_write(mts, ASP_ICNTLR, value);
- printk(KERN_ERR "mx1_touchscreen: deaktivuji penup interrupt \n");
+ printk(KERN_ERR "mx1_touchscreen pen_up: deaktivuji pen up interrupt \n");
}
value = ASP_CLKEN | ASP_NM | ASP_SW6 | ASP_BGE;
mx1ts_reg_write(mts, ASP_ACNTLCR, value);
- /* Set the clock divide ratio to 2. */
- mx1ts_reg_write(mts, ASP_CLKDIV, 0x01);
+ /* 0x01 Set the clock divide ratio to 2. */
+ mx1ts_reg_write(mts, ASP_CLKDIV, 0x1f);
/* Set the sample rate control register. These values should yield
* about 150 samples per second, which seems to give good smooth
* lines. */
- value = (0x2 << ASP_DMCNT_SCALE) | /* Decimation ratio is 3 */
- (0x1 << ASP_IDLECNT_SCALE) | /* Idle count is 1 clock */
- (0x2 << ASP_DSCNT_SCALE); /* Data setup is 2 clocks */
+ value = (0x7 << ASP_DMCNT_SCALE) | /* 0x2 - Decimation ratio is 3 */
+ (0x3F << ASP_IDLECNT_SCALE) | /* 0x1 - Idle count is 1 clock */
+ (0xF << ASP_DSCNT_SCALE); /* 0x2 - Data setup is 2 clocks */
mx1ts_reg_write(mts, ASP_PSMPLRG, value);
/* Disable the compare function. */
static void mx1ts_evt_add(struct input_dev *idev, u8 p , u16 x, u16 y)
{
- input_report_key(idev, BTN_TOUCH, p);
+ input_report_key(idev, BTN_TOUCH, 1);
input_report_abs(idev, ABS_X, x);
input_report_abs(idev, ABS_Y, y);
- /* input_report_abs(idev, ABS_PRESSURE, pressure);*/
+ /*input_report_abs(idev, ABS_PRESSURE, p);*/
/*printk(KERN_ERR "P %i X %i Y %i.\n", p, x, y);*/ /*devprint dev_dbg(zarizeni, co se vypisuje)*/
input_sync(idev);
}
u16 mx1_cal_range_y;
static unsigned int auto_zero, pen_x, pen_y, pen_u;
- /*struct mx1ts *mts = (struct mx1_ts *) dev_id;*/
-
mx1_cal_range_x = 1;
mx1_cal_range_y = 1;
mx1ts_enable_pen_touch_interrupt(mts);
if(mts->is_open) /*report last known touch*/
- mx1ts_evt_add(mts->ts_idev, 0, 0, 0);
+ mx1ts_evt_add(mts->ts_idev, 1, 0, 0);
printk(KERN_ERR "Pen up interrupt.\n");
mx1ts_flush_fifo(mts);
mts->cal_range_y);
if(mts->is_open)
- mx1ts_evt_add(mts->ts_idev, 1, pen_x, pen_y);
+ mx1ts_evt_add(mts->ts_idev, 1 , pen_x, pen_y);
}
return IRQ_HANDLED;
}