summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/atmel_mxt_ts.c
diff options
context:
space:
mode:
authorNick Dyer <nick.dyer@itdev.co.uk>2012-09-03 15:46:11 +0100
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 12:37:47 -0700
commite5f4ec49203de5093d176067a07a973776740ebf (patch)
treee8e9fda6b39fe39c47006617a80e1b49062aadbd /drivers/input/touchscreen/atmel_mxt_ts.c
parentfadf8df2c6a299915824a936007cf17b3ae9f993 (diff)
Input: atmel_mxt_ts - Read info block CRC
Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Rebase-Id: Rec5a99be5607d5296a38df162f52c3a2bc9716a6
Diffstat (limited to 'drivers/input/touchscreen/atmel_mxt_ts.c')
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 18274f0b0e8d..7a07cfda50fe 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -286,6 +286,7 @@ struct mxt_data {
u8 is_stopped;
u8 max_reportid;
u32 config_crc;
+ u32 info_block_crc;
u8 num_touchids;
u8 *msg_buf;
u8 last_message_count;
@@ -1271,6 +1272,23 @@ static int mxt_check_reg_init(struct mxt_data *data)
return 0;
}
+static int mxt_read_info_block_crc(struct mxt_data *data)
+{
+ int ret;
+ u16 offset;
+ u8 buf[3];
+
+ offset = MXT_OBJECT_START + MXT_OBJECT_SIZE * data->info.object_num;
+
+ ret = mxt_read_reg(data->client, offset, sizeof(buf), buf);
+ if (ret)
+ return ret;
+
+ data->info_block_crc = (buf[2] << 16) | (buf[1] << 8) | buf[0];
+
+ return 0;
+}
+
static int mxt_get_object_table(struct mxt_data *data)
{
struct i2c_client *client = data->client;
@@ -1480,6 +1498,12 @@ static int mxt_initialize(struct mxt_data *data)
return error;
}
+ /* Read information block CRC */
+ error = mxt_read_info_block_crc(data);
+ if (error) {
+ dev_err(&client->dev, "Error %d reading info block CRC\n", error);
+ }
+
error = mxt_probe_power_cfg(data);
if (error) {
dev_err(&client->dev, "Failed to initialize power cfg\n");