[PATCH 35/40] Input: atmel_mxt_ts - Improve messages relating to info block read
From: Nick Dyer
Date: Fri Feb 22 2013 - 13:17:52 EST
The matrix size is only used to print out a debug message, and results in some
rather confusing code to re-read it if the device configuration is updated. So
don't print it out.
Signed-off-by: Nick Dyer <nick.dyer@xxxxxxxxxxx>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 83a0837..267b5d8 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1390,6 +1390,8 @@ static int mxt_parse_object_table(struct mxt_data *data)
u8 reportid;
u16 end_address;
+ dev_dbg(&client->dev, "Object num: %d\n", data->info->object_num);
+
/* Valid Report IDs start counting from 1 */
reportid = 1;
data->mem_size = 0;
@@ -1567,6 +1569,12 @@ static int mxt_read_info_block(struct mxt_data *data)
data->info = (struct mxt_info *)buf;
data->object_table = (struct mxt_object *)(buf + MXT_OBJECT_START);
+ dev_info(&client->dev,
+ "Family ID: %u Variant ID: %u Firmware: V%u.%u.%02X",
+ data->info->family_id, data->info->variant_id,
+ data->info->version >> 4, data->info->version & 0xf,
+ data->info->build);
+
/* Parse object table information */
error = mxt_parse_object_table(data);
if (error) {
@@ -1575,13 +1583,6 @@ static int mxt_read_info_block(struct mxt_data *data)
return error;
}
- dev_info(&client->dev,
- "Family ID: %u Variant ID: %u Firmware V%u.%u.%02X "
- " Object Num:%d\n",
- data->info->family_id, data->info->variant_id,
- data->info->version >> 4, data->info->version & 0xf,
- data->info->build, data->info->object_num);
-
return 0;
err_free_mem:
@@ -1601,11 +1602,6 @@ static int mxt_read_t9_resolution(struct mxt_data *data)
if (!object)
return -EINVAL;
- /* Update matrix size in info struct (may change after reset) */
- error = mxt_read_info_block(data);
- if (error)
- return error;
-
error = __mxt_read_reg(client,
object->start_address + MXT_T9_RANGE,
sizeof(range), &range);
@@ -1636,10 +1632,8 @@ static int mxt_read_t9_resolution(struct mxt_data *data)
data->max_y = range.y;
}
- dev_info(&client->dev,
- "Matrix Size X%uY%u Touchscreen size X%uY%u\n",
- data->info->matrix_xsize, data->info->matrix_ysize,
- data->max_x, data->max_y);
+ dev_info(&client->dev, "Touchscreen size X%uY%u\n",
+ data->max_x, data->max_y);
return 0;
}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/