static struct tsc2301_platform_data tsc2301_config = {
.reset_gpio = 118,
.dav_gpio = 103,
- .pen_int_gpio = 106,
.keymap = {
-1, /* Event for bit 0 */
KEY_UP, /* Event for bit 1 (up) */
tsc2301_config.ts_x_plate_ohm = 180;
tsc2301_config.ts_hw_avg = 4;
tsc2301_config.ts_ignore_last = 1;
- tsc2301_config.ts_max_pressure = 255;
+ tsc2301_config.ts_max_pressure = 2048;
+ tsc2301_config.ts_touch_pressure = 400;
tsc2301_config.ts_stab_time = 100;
+ tsc2301_config.ts_pressure_fudge = 2;
+ tsc2301_config.ts_x_max = 4096;
+ tsc2301_config.ts_x_fudge = 4;
+ tsc2301_config.ts_y_max = 4096;
+ tsc2301_config.ts_y_fudge = 7;
} else if (strcmp(conf->panel_name, "ls041y3") == 0) {
tsc2301_config.ts_x_plate_ohm = 280;
tsc2301_config.ts_hw_avg = 16;
- tsc2301_config.ts_touch_pressure= 215;
- tsc2301_config.ts_max_pressure = 255;
+ tsc2301_config.ts_touch_pressure = 400;
+ tsc2301_config.ts_max_pressure = 2048;
tsc2301_config.ts_ignore_last = 1;
+ tsc2301_config.ts_stab_time = 1000;
+ tsc2301_config.ts_pressure_fudge = 2;
+ tsc2301_config.ts_x_max = 4096;
+ tsc2301_config.ts_x_fudge = 4;
+ tsc2301_config.ts_y_max = 4096;
+ tsc2301_config.ts_y_fudge = 7;
} else {
printk(KERN_ERR "Unknown panel type, set default "
"touchscreen configuration\n");
*
* Initialize:
* Request access to GPIO103 (DAV)
- * tsc2301_dav_irq_handler will trigger when DAV line goes down
+ * tsc2301_ts_irq_handler will trigger when DAV line goes down
*
* 1) Pen is pressed against touchscreeen
* 2) TSC2301 performs AD conversion
* 3) After the conversion is done TSC2301 drives DAV line down
- * 4) GPIO IRQ is received and tsc2301_dav_irq_handler is called
- * 5) tsc2301_dav_irq_handler sets up tsc2301_ts_timer in TSC2301_TS_SCAN_TIME
+ * 4) GPIO IRQ is received and tsc2301_ts_irq_handler is called
+ * 5) tsc2301_ts_irq_handler sets up tsc2301_ts_timer in TSC2301_TS_SCAN_TIME
* 6) tsc2301_ts_timer disables the irq and requests spi driver
* to read X, Y, Z1 and Z2
* 7) SPI framework calls tsc2301_ts_rx after the coordinates are read
struct tsc2301_ts *ts;
struct input_dev *idev;
int dav_gpio, r;
+ int x_max, y_max;
+ int x_fudge, y_fudge, p_fudge;
if (pdata->dav_gpio < 0) {
dev_err(&tsc->spi->dev, "need DAV GPIO");
ts->x_plate_ohm = pdata->ts_x_plate_ohm ? : 280;
ts->hw_avg_max = pdata->ts_hw_avg;
- ts->max_pressure= pdata->ts_max_pressure ? : MAX_12BIT;
+ ts->max_pressure = pdata->ts_max_pressure ? : MAX_12BIT;
ts->touch_pressure = pdata->ts_touch_pressure ? : ts->max_pressure;
ts->ignore_last = pdata->ts_ignore_last;
ts->stab_time = pdata->ts_stab_time;
+ x_max = pdata->ts_x_max ? : 4096;
+ y_max = pdata->ts_y_max ? : 4096;
+ x_fudge = pdata->ts_x_fudge ? : 4;
+ y_fudge = pdata->ts_y_fudge ? : 8;
+ p_fudge = pdata->ts_pressure_fudge ? : 2;
+
if ((r = tsc2301_ts_check_config(ts, &ts->hw_flags))) {
dev_err(&tsc->spi->dev, "invalid configuration\n");
goto err2;
tsc2301_ts_setup_spi_xfer(tsc);
/* These parameters should perhaps be configurable? */
- input_set_abs_params(idev, ABS_X, 0, 4096, 0, 0);
- input_set_abs_params(idev, ABS_Y, 0, 4096, 0, 0);
- input_set_abs_params(idev, ABS_PRESSURE, 0, 1024, 0, 0);
+ input_set_abs_params(idev, ABS_X, 0, x_max, x_fudge, 0);
+ input_set_abs_params(idev, ABS_Y, 0, y_max, y_fudge, 0);
+ input_set_abs_params(idev, ABS_PRESSURE, 0, ts->max_pressure,
+ p_fudge, 0);
tsc2301_ts_start_scan(tsc);