summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-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) {