Commit 23003a84 authored by Daniel Kurtz's avatar Daniel Kurtz Committed by Henrik Rydberg

Input: atmel_mxt_ts - read ID information block in one i2c transaction

Reading the whole info block in one i2c transaction speeds up driver
probe significantly, especially on slower i2c busses.
Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
Signed-off-by: default avatarHenrik Rydberg <rydberg@euromail.se>
parent cf94bc09
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define MXT_FW_NAME "maxtouch.fw" #define MXT_FW_NAME "maxtouch.fw"
/* Registers */ /* Registers */
#define MXT_INFO 0x00
#define MXT_FAMILY_ID 0x00 #define MXT_FAMILY_ID 0x00
#define MXT_VARIANT_ID 0x01 #define MXT_VARIANT_ID 0x01
#define MXT_VERSION 0x02 #define MXT_VERSION 0x02
...@@ -760,32 +761,11 @@ static int mxt_get_info(struct mxt_data *data) ...@@ -760,32 +761,11 @@ static int mxt_get_info(struct mxt_data *data)
struct i2c_client *client = data->client; struct i2c_client *client = data->client;
struct mxt_info *info = &data->info; struct mxt_info *info = &data->info;
int error; int error;
u8 val;
error = mxt_read_reg(client, MXT_FAMILY_ID, &val);
if (error)
return error;
info->family_id = val;
error = mxt_read_reg(client, MXT_VARIANT_ID, &val);
if (error)
return error;
info->variant_id = val;
error = mxt_read_reg(client, MXT_VERSION, &val);
if (error)
return error;
info->version = val;
error = mxt_read_reg(client, MXT_BUILD, &val);
if (error)
return error;
info->build = val;
error = mxt_read_reg(client, MXT_OBJECT_NUM, &val); /* Read 7-byte info block starting at address 0 */
error = __mxt_read_reg(client, MXT_INFO, sizeof(*info), info);
if (error) if (error)
return error; return error;
info->object_num = val;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment