* [PATCH 3/3] Input: atmel_mxt_ts - Handle objects with multiple instances correctly
@ 2011-07-04 9:06 Iiro Valkonen
2011-07-04 10:18 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Iiro Valkonen @ 2011-07-04 9:06 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Joonyoung Shim, linux-input
Handle the objects with multiple instances correctly when the configuration data
is loaded.
Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index da8c9ca..90f221f 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -655,7 +655,9 @@ static int mxt_check_reg_init(struct mxt_data *data)
if (!mxt_object_writable(object->type))
continue;
- for (j = 0; j < object->size + 1; j++) {
+ for (j = 0;
+ j < ((object->size + 1) * (object->instances + 1));
+ j++) {
config_offset = index + j;
if (config_offset > pdata->config_length) {
dev_err(dev, "Not enough config data!\n");
@@ -664,7 +666,7 @@ static int mxt_check_reg_init(struct mxt_data *data)
mxt_write_object(data, object->type, j,
pdata->config[config_offset]);
}
- index += object->size + 1;
+ index += (object->size + 1) * (object->instances + 1);
}
return 0;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/3] Input: atmel_mxt_ts - Handle objects with multiple instances correctly
2011-07-04 9:06 [PATCH 3/3] Input: atmel_mxt_ts - Handle objects with multiple instances correctly Iiro Valkonen
@ 2011-07-04 10:18 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2011-07-04 10:18 UTC (permalink / raw)
To: Iiro Valkonen; +Cc: Joonyoung Shim, linux-input
On Mon, Jul 04, 2011 at 12:06:31PM +0300, Iiro Valkonen wrote:
> Handle the objects with multiple instances correctly when the configuration data
> is loaded.
>
> Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Applied, thanks Iiro.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-04 10:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-04 9:06 [PATCH 3/3] Input: atmel_mxt_ts - Handle objects with multiple instances correctly Iiro Valkonen
2011-07-04 10:18 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).