summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Waters <justin.waters@timesys.com>2012-03-21 13:23:28 -0400
committerJustin Waters <justin.waters@timesys.com>2012-03-21 13:32:52 -0400
commitcbe6640576657b003ae8682fe254ee68fb832637 (patch)
treee9b0b3a9baeaa5a01221babf21a8df9fed180602
parentd0183eb2433e3332c2720637238b18b1fdff7946 (diff)
[MXS TS] Add EV_KEY capability2.6.31-mx28-201203211723
Touchscreen devices must support the EV_KEY capability for newer versions of tslib to work. This adds support for it.
-rw-r--r--drivers/input/touchscreen/mxs-ts.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/mxs-ts.c b/drivers/input/touchscreen/mxs-ts.c
index a2ea102290a8..cd26e81d375e 100644
--- a/drivers/input/touchscreen/mxs-ts.c
+++ b/drivers/input/touchscreen/mxs-ts.c
@@ -59,6 +59,7 @@ struct mxs_ts_info {
u16 x;
u16 y;
int sample_count;
+ int last_press;
};
static inline void enter_state_touch_detect(struct mxs_ts_info *info)
@@ -208,11 +209,18 @@ static void process_lradc(struct mxs_ts_info *info, u16 x, u16 y,
info->sample_count);
if (pressure) {
input_report_abs(info->idev, ABS_PRESSURE, pressure);
+ /* report the BTN_TOUCH */
+ if (pressure != info->last_press)
+ input_event(info->idev, EV_KEY,
+ BTN_TOUCH, pressure);
+
enter_state_x_plane(info);
hw_lradc_set_delay_trigger_kick(
LRADC_DELAY_TRIGGER_TOUCHSCREEN, 1);
} else
enter_state_touch_detect(info);
+
+ info->last_press = pressure;
break;
default:
@@ -276,7 +284,8 @@ static int __devinit mxs_ts_probe(struct platform_device *pdev)
}
idev->name = "MXS touchscreen";
- idev->evbit[0] = BIT(EV_ABS);
+ idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+ idev->keybit[BIT_WORD(BTN_TOUCH)] |= BIT_MASK(BTN_TOUCH);
input_set_abs_params(idev, ABS_X, 0, 0xFFF, 0, 0);
input_set_abs_params(idev, ABS_Y, 0, 0xFFF, 0, 0);
input_set_abs_params(idev, ABS_PRESSURE, 0, 1, 0, 0);
@@ -298,6 +307,7 @@ static int __devinit mxs_ts_probe(struct platform_device *pdev)
info->x_minus_mask = plat_data->x_minus_mask;
info->y_plus_mask = plat_data->y_plus_mask;
info->y_minus_mask = plat_data->y_minus_mask;
+ info->last_press = -1;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {