From 61a97510a093c3440475c3f0755efdba6ef26626 Mon Sep 17 00:00:00 2001 From: Justin Waters Date: Wed, 21 Mar 2012 13:23:28 -0400 Subject: [MXS TS] Add EV_KEY capability Touchscreen devices must support the EV_KEY capability for newer versions of tslib to work. This adds support for it. --- drivers/input/touchscreen/mxs-ts.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3