All of lore.kernel.org
 help / color / mirror / Atom feed
From: Iiro Valkonen <iiro.valkonen@atmel.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Trilok Soni <tsoni@codeaurora.org>, linux-input@vger.kernel.org
Subject: Re: [PATCH 3/5] Skip matrix size check
Date: Fri, 11 Feb 2011 15:32:17 +0200	[thread overview]
Message-ID: <4D553A61.1090608@atmel.com> (raw)
In-Reply-To: <20110204085906.GF13046@core.coreip.homeip.net>


Ok, I think the "matrix size check" should be really skipped altogether. It is currently setting the CTE mode to match xline/yline info 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 need some x/y lines too). I think it would be best to just rely on the config 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). Here's a patch removing the check.

Regards,
-- 
Iiro


From: Iiro Valkonen <iiro.valkonen@atmel.com>

Remove the mxt224-specific matrix size check

Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
---
 drivers/input/touchscreen/qt602240_ts.c |   73 -------------------------------
 1 files changed, 0 insertions(+), 73 deletions(-)

diff --git a/drivers/input/touchscreen/qt602240_ts.c b/drivers/input/touchscreen/qt602240_ts.c
index 08fd136..bbbaefc 100644
--- a/drivers/input/touchscreen/qt602240_ts.c
+++ b/drivers/input/touchscreen/qt602240_ts.c
@@ -633,74 +633,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;
@@ -867,11 +799,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;
-- 
1.7.0.4

  reply	other threads:[~2011-02-11 13:32 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 16:52 [PATCH] input: Modify the qt602240 driver to be compatible with mXT1386 device Iiro Valkonen
2011-01-24 17:07 ` Dmitry Torokhov
2011-01-25 10:33   ` [PATCH 1/2] input: Modify the qt602240 driver to be compatible with mXT1386 device - renames Iiro Valkonen
2011-01-25 11:00     ` Trilok Soni
2011-01-27 11:32       ` Trilok Soni
2011-02-01  8:45         ` Valkonen, Iiro
2011-02-03  7:29           ` Dmitry Torokhov
2011-01-25 10:37   ` [PATCH 2/2] input: Modify the qt602240 driver to be compatible with mXT1386 device - functional changes Iiro Valkonen
2011-01-29  8:27     ` Dmitry Torokhov
2011-02-01  8:17       ` Valkonen, Iiro
2011-02-01  8:32         ` Dmitry Torokhov
2011-02-01  8:53     ` Valkonen, Iiro
2011-02-03  7:43       ` Dmitry Torokhov
2011-02-03 14:01         ` [PATCH 1/5] Remove fixed config data from driver file; add config to platform data Iiro Valkonen
2011-02-04  8:57           ` Dmitry Torokhov
2011-02-10  7:57             ` Iiro Valkonen
2011-02-18 14:21               ` Iiro Valkonen
2011-02-18 16:48                 ` Dmitry Torokhov
2011-02-03 14:02         ` [PATCH 2/5] Read whole message instead of just the first byte to make CHG low Iiro Valkonen
2011-02-04  8:54           ` Dmitry Torokhov
2011-02-03 14:04         ` [PATCH 3/5] Skip matrix size check Iiro Valkonen
2011-02-04  8:59           ` Dmitry Torokhov
2011-02-11 13:32             ` Iiro Valkonen [this message]
2011-02-11 17:38               ` Dmitry Torokhov
2011-02-03 14:10         ` [PATCH 4/5] Try IRQF_TRIGGER_NONE if IRQF_TRIGGER_FALLING returns error Iiro Valkonen
2011-02-04  8:53           ` Dmitry Torokhov
2011-02-10  8:03             ` Iiro Valkonen
2011-02-03 14:13         ` [PATCH 5/5] Add chip I2C addresses to header file Iiro Valkonen
2011-02-03 14:49           ` Mark Brown
2011-02-04  8:37             ` Iiro Valkonen
2011-02-04  8:43               ` Dmitry Torokhov
2011-02-04 14:25               ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D553A61.1090608@atmel.com \
    --to=iiro.valkonen@atmel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=tsoni@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.