diff options
Diffstat (limited to 'drivers/input/touchscreen/wm97xx-core.c')
-rw-r--r-- | drivers/input/touchscreen/wm97xx-core.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index 5dbe73af2f8f..72e2abea2c28 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c @@ -54,6 +54,10 @@ #define WM_CORE_VERSION "1.00" #define DEFAULT_PRESSURE 0xb0c0 +#ifdef CONFIG_MACH_COLIBRI_T20 +extern void *get_colibri_t20_audio_platform_data(void); +#endif + /* * Touchscreen absolute values @@ -442,8 +446,18 @@ static int wm97xx_read_samples(struct wm97xx *wm) "pen down: x=%x:%d, y=%x:%d, pressure=%x:%d\n", data.x >> 12, data.x & 0xfff, data.y >> 12, data.y & 0xfff, data.p >> 12, data.p & 0xfff); +#ifndef CONFIG_ANDROID input_report_abs(wm->input_dev, ABS_X, data.x & 0xfff); input_report_abs(wm->input_dev, ABS_Y, data.y & 0xfff); +#else /* !CONFIG_ANDROID */ + /* Hack: rotate touch for now due to missing calibration + integration + Note: 12-bit touch resolution */ + input_report_abs(wm->input_dev, ABS_X, 4096 - (data.x & 0xfff)); + input_report_abs(wm->input_dev, ABS_Y, 4096 - (data.y & 0xfff)); +#endif /* !CONFIG_ANDROID */ + + input_report_abs(wm->input_dev, ABS_PRESSURE, data.p & 0xfff); input_report_key(wm->input_dev, BTN_TOUCH, 1); input_sync(wm->input_dev); @@ -640,7 +654,12 @@ static int wm97xx_probe(struct device *dev) } /* set up touch configuration */ +#ifdef CONFIG_ANDROID + /* Hack: rename due to idc parser having issues with spaces in names */ + wm->input_dev->name = "wm97xx-ts"; +#else /* CONFIG_ANDROID */ wm->input_dev->name = "wm97xx touchscreen"; +#endif /* CONFIG_ANDROID */ wm->input_dev->phys = "wm97xx"; wm->input_dev->open = wm97xx_ts_input_open; wm->input_dev->close = wm97xx_ts_input_close; @@ -671,7 +690,13 @@ static int wm97xx_probe(struct device *dev) } platform_set_drvdata(wm->battery_dev, wm); wm->battery_dev->dev.parent = dev; + +#if defined(CONFIG_MACH_COLIBRI_T20) && !defined(CONFIG_ANDROID) + wm->battery_dev->dev.platform_data = get_colibri_t20_audio_platform_data(); +#else wm->battery_dev->dev.platform_data = pdata; +#endif + ret = platform_device_add(wm->battery_dev); if (ret < 0) goto batt_reg_err; |