* note. The strength of filtering can be set in the board-* specific
* files.
*/
+#define XPT2046_DEBUG 0
+#if XPT2046_DEBUG
+ #define xpt2046printk(msg...) printk(msg);
+#else
+ #define xpt2046printk(msg...)
+#endif
#define LCD_MAX_LENGTH 800
#define LCD_MAX_WIDTH 480
#define PT2046_TOUCH_AD_LEFT 3855
*/
x = packet->tc.x;
y = packet->tc.y;
- printk("***>%s:x=%d,y=%d\n",__FUNCTION__,x,y);
+
+ xpt2046printk("***>%s:x=%d,y=%d\n",__FUNCTION__,x,y);
+
/* range filtering */
if (x == MAX_12BIT)
x = 0;
* once more the measurement
*/
if (packet->tc.ignore) {
- printk("***>%s:ignored=%d\n",__FUNCTION__,packet->tc.ignore);
+
+ xpt2046printk("***>%s:ignored=%d\n",__FUNCTION__,packet->tc.ignore);
+
hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD),
HRTIMER_MODE_REL);
return;
input_report_abs(input, ABS_Y, y);
input_sync(input);
- printk("***>%s:input_report_abs(%4d/%4d)\n",__FUNCTION__,x, y);
+ xpt2046printk("***>%s:input_report_abs(%4d/%4d)\n",__FUNCTION__,x, y);
}
hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD),
static int average_val[2];
- printk("***>%s:%d,%d,%d,%d,%d,%d,%d,%d\n",__FUNCTION__,
+ xpt2046printk("***>%s:%d,%d,%d,%d,%d,%d,%d,%d\n",__FUNCTION__,
data_idx,ts->last_read,
ts->read_cnt,ts->debounce_max,
abs(ts->last_read - *val),ts->debounce_tol,
ts->read_rep,ts->debounce_rep);
-
+
/* discard the first sample. */
if(!ts->read_cnt)
{
ts->read_cnt = 0;
ts->last_read = 0;
memset(average_val,0,sizeof(average_val));
- printk("***>%s:XPT2046_FILTER_IGNORE\n",__FUNCTION__);
+ xpt2046printk("***>%s:XPT2046_FILTER_IGNORE\n",__FUNCTION__);
return XPT2046_FILTER_IGNORE;
}
}
* built from two 8 bit values written msb-first.
*/
val = (be16_to_cpup((__be16 *)t->rx_buf) >> 3) & 0x0fff;
- printk("***>%s:value=%d\n",__FUNCTION__,val);
+
+ xpt2046printk("***>%s:value=%d\n",__FUNCTION__,val);
+
action = ts->filter(ts->filter_data, ts->msg_idx, &val);
switch (action) {
case XPT2046_FILTER_REPEAT:
ts->pending = 0;
} else {
/* pen is still down, continue with the measurement */
- printk("***>%s:pen is still down, continue with the measurement\n",__FUNCTION__);
+ xpt2046printk("***>%s:pen is still down, continue with the measurement\n",__FUNCTION__);
ts->msg_idx = 0;
ts->wait_for_sync();
status = spi_async(ts->spi, &ts->msg[0]);
struct xpt2046 *ts = handle;
unsigned long flags;
- printk("***>%s.....%s.....%d\n",__FILE__,__FUNCTION__,__LINE__);
+ xpt2046printk("***>%s.....%s.....%d\n",__FILE__,__FUNCTION__,__LINE__);
spin_lock_irqsave(&ts->lock, flags);