From: Maxime Ripard Date: Sun, 22 Mar 2015 03:18:06 +0000 (-0700) Subject: Input: edt-ft5x06 - allow to setting the maximum axes value through the DT X-Git-Tag: v5.15~74^2~769 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c00559884e09398a6451672472b4ea7f4118291;p=platform%2Fkernel%2Flinux-starfive.git Input: edt-ft5x06 - allow to setting the maximum axes value through the DT Currently the driver relies on some obscure and undocumented register to set the maximum axis value. The reported value is way too high to be meaningful, which confuses some userspace tools like QT's evdevtouch plugin which try to scale the reported events to the maximum values. Use the values from the DT to set meaningful values. Signed-off-by: Maxime Ripard Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index d4c24fb..cd8a747 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #define MAX_SUPPORT_POINTS 5 @@ -1044,6 +1045,10 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, 0, tsdata->num_x * 64 - 1, 0, 0); input_set_abs_params(input, ABS_MT_POSITION_Y, 0, tsdata->num_y * 64 - 1, 0, 0); + + if (!pdata) + touchscreen_parse_of_params(input); + error = input_mt_init_slots(input, MAX_SUPPORT_POINTS, 0); if (error) { dev_err(&client->dev, "Unable to init MT slots.\n");