summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Waters <justin.waters@timesys.com>2012-03-21 13:23:28 -0400
committerAnbarasan Shenbagaraj <anbarasan.shenbagaraj@timesys.com>2012-06-07 15:48:41 -0400
commit61a97510a093c3440475c3f0755efdba6ef26626 (patch)
tree54dca7b0ddd6d15bb3e0ae3d867193d3a863da9a
parentcca29a03fc83751ed319df4b3c38ce2f4216ee0a (diff)
[MXS TS] Add EV_KEY capability2.6.35-mx28-201203211323
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 fce77fd49e0f..2a28faac1f42 100644
--- a/drivers/input/touchscreen/mxs-ts.c
+++ b/drivers/input/touchscreen/mxs-ts.c
@@ -61,6 +61,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)
@@ -210,11 +211,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:
@@ -278,7 +286,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);
@@ -300,6 +309,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) {