summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/atmel_mxt_ts.c
diff options
context:
space:
mode:
authorIiro Valkonen <iiro.valkonen@atmel.com>2011-02-23 21:07:20 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-02-25 09:27:00 -0800
commit0d3c07378bb7d423302d7cb0dcd3fa5a26c40220 (patch)
treebcf3554d15738f5e40706df1c294aa113fa0921b /drivers/input/touchscreen/atmel_mxt_ts.c
parent5f62615ef5e50b0ad6c125fe1e38f2ac675012e2 (diff)
downloadop-kernel-dev-0d3c07378bb7d423302d7cb0dcd3fa5a26c40220.zip
op-kernel-dev-0d3c07378bb7d423302d7cb0dcd3fa5a26c40220.tar.gz
Input: atmel_mxt_ts - remove matrix size check
The mxt_check_matrix_size() is currently setting the CTE mode to match xline/yline information that is in the platform data, but it does not take into account for example the fact that we could have a key array in use too (key array would use some x/y lines as well). It would be better to simply rely on the configuration data, and make sure that the CTE mode set in there matches the touch object (touchscreen, key array, proximity) configuration (which are set in the config data too). Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen/atmel_mxt_ts.c')
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index d2e5864..6264ba8 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -630,74 +630,6 @@ static int mxt_check_reg_init(struct mxt_data *data)
return 0;
}
-static int mxt_check_matrix_size(struct mxt_data *data)
-{
- const struct mxt_platform_data *pdata = data->pdata;
- struct device *dev = &data->client->dev;
- int mode = -1;
- int error;
- u8 val;
-
- dev_dbg(dev, "Number of X lines: %d\n", pdata->x_line);
- dev_dbg(dev, "Number of Y lines: %d\n", pdata->y_line);
-
- switch (pdata->x_line) {
- case 0 ... 15:
- if (pdata->y_line <= 14)
- mode = 0;
- break;
- case 16:
- if (pdata->y_line <= 12)
- mode = 1;
- if (pdata->y_line == 13 || pdata->y_line == 14)
- mode = 0;
- break;
- case 17:
- if (pdata->y_line <= 11)
- mode = 2;
- if (pdata->y_line == 12 || pdata->y_line == 13)
- mode = 1;
- break;
- case 18:
- if (pdata->y_line <= 10)
- mode = 3;
- if (pdata->y_line == 11 || pdata->y_line == 12)
- mode = 2;
- break;
- case 19:
- if (pdata->y_line <= 9)
- mode = 4;
- if (pdata->y_line == 10 || pdata->y_line == 11)
- mode = 3;
- break;
- case 20:
- mode = 4;
- }
-
- if (mode < 0) {
- dev_err(dev, "Invalid X/Y lines\n");
- return -EINVAL;
- }
-
- error = mxt_read_object(data, MXT_SPT_CTECONFIG,
- MXT_CTE_MODE, &val);
- if (error)
- return error;
-
- if (mode == val)
- return 0;
-
- /* Change the CTE configuration */
- mxt_write_object(data, MXT_SPT_CTECONFIG,
- MXT_CTE_CTRL, 1);
- mxt_write_object(data, MXT_SPT_CTECONFIG,
- MXT_CTE_MODE, mode);
- mxt_write_object(data, MXT_SPT_CTECONFIG,
- MXT_CTE_CTRL, 0);
-
- return 0;
-}
-
static int mxt_make_highchg(struct mxt_data *data)
{
struct device *dev = &data->client->dev;
@@ -864,11 +796,6 @@ static int mxt_initialize(struct mxt_data *data)
if (error)
return error;
- /* Check X/Y matrix size */
- error = mxt_check_matrix_size(data);
- if (error)
- return error;
-
error = mxt_make_highchg(data);
if (error)
return error;
OpenPOWER on IntegriCloud