aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Stiffler2015-07-06 12:03:53 -0500
committerJacob Stiffler2015-07-06 12:03:53 -0500
commit875c69b2c37ba94f9e38d2c9211bd66f604ad7cc (patch)
treef566b8ffff4157d425525019541df2f8a87cd58c
parent92e014a9296b273f68782cb375b9961bff9ad843 (diff)
downloadprocessor-sdk-linux-01.00.00.tar.gz
processor-sdk-linux-01.00.00.tar.xz
processor-sdk-linux-01.00.00.zip
input: edt-ft5x06: Enable max axes values to be set in DT.processor-sdk-linux-01.00.00
* The edt-ft5x06 driver sets max axes values to quantities much larger than what is actually obtainable. * Use the device tree to get the actual max values. Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
-rw-r--r--drivers/input/touchscreen/edt-ft5x06.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index de9ae8612cb9..996a00a1ac84 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -963,6 +963,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
963 struct input_dev *input; 963 struct input_dev *input;
964 int error; 964 int error;
965 char fw_version[EDT_NAME_LEN]; 965 char fw_version[EDT_NAME_LEN];
966 unsigned int max_x, max_y;
966 967
967 dev_dbg(&client->dev, "probing for EDT FT5x06 I2C\n"); 968 dev_dbg(&client->dev, "probing for EDT FT5x06 I2C\n");
968 969
@@ -1038,12 +1039,25 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
1038 __set_bit(EV_KEY, input->evbit); 1039 __set_bit(EV_KEY, input->evbit);
1039 __set_bit(EV_ABS, input->evbit); 1040 __set_bit(EV_ABS, input->evbit);
1040 __set_bit(BTN_TOUCH, input->keybit); 1041 __set_bit(BTN_TOUCH, input->keybit);
1041 input_set_abs_params(input, ABS_X, 0, tsdata->num_x * 64 - 1, 0, 0); 1042
1042 input_set_abs_params(input, ABS_Y, 0, tsdata->num_y * 64 - 1, 0, 0); 1043 if ( of_property_read_u32(client->dev.of_node, "touchscreen-size-x", &max_x) == 0 ) {
1043 input_set_abs_params(input, ABS_MT_POSITION_X, 1044 input_set_abs_params(input, ABS_X, 0, max_x - 1, 0, 0);
1044 0, tsdata->num_x * 64 - 1, 0, 0); 1045 input_set_abs_params(input, ABS_MT_POSITION_X,
1045 input_set_abs_params(input, ABS_MT_POSITION_Y, 1046 0, max_x - 1, 0, 0);
1046 0, tsdata->num_y * 64 - 1, 0, 0); 1047 } else {
1048 input_set_abs_params(input, ABS_X, 0, tsdata->num_x * 64 - 1, 0, 0);
1049 input_set_abs_params(input, ABS_MT_POSITION_X,
1050 0, tsdata->num_x * 64 - 1, 0, 0);
1051 }
1052 if ( of_property_read_u32(client->dev.of_node, "touchscreen-size-y", &max_y) == 0 ) {
1053 input_set_abs_params(input, ABS_Y, 0, max_y - 1, 0, 0);
1054 input_set_abs_params(input, ABS_MT_POSITION_Y,
1055 0, max_y - 1, 0, 0);
1056 } else {
1057 input_set_abs_params(input, ABS_Y, 0, tsdata->num_y * 64 - 1, 0, 0);
1058 input_set_abs_params(input, ABS_MT_POSITION_Y,
1059 0, tsdata->num_y * 64 - 1, 0, 0);
1060 }
1047 error = input_mt_init_slots(input, MAX_SUPPORT_POINTS, 0); 1061 error = input_mt_init_slots(input, MAX_SUPPORT_POINTS, 0);
1048 if (error) { 1062 if (error) {
1049 dev_err(&client->dev, "Unable to init MT slots.\n"); 1063 dev_err(&client->dev, "Unable to init MT slots.\n");