diff options
author | Daniel Kurtz <djkurtz@chromium.org> | 2012-06-28 09:08:14 -0400 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2012-06-29 09:58:04 -0400 |
commit | 23003a8496b3f8100ed215dfda438cece5745545 (patch) | |
tree | e68d4437c3bbb43bcc5411ff86de2ac66967c6dd /drivers/input | |
parent | cf94bc09c89c923d339c68cf89360c02578ceee3 (diff) |
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: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 99d5210c7ae8..fac379146546 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #define MXT_FW_NAME "maxtouch.fw" | 36 | #define MXT_FW_NAME "maxtouch.fw" |
37 | 37 | ||
38 | /* Registers */ | 38 | /* Registers */ |
39 | #define MXT_INFO 0x00 | ||
39 | #define MXT_FAMILY_ID 0x00 | 40 | #define MXT_FAMILY_ID 0x00 |
40 | #define MXT_VARIANT_ID 0x01 | 41 | #define MXT_VARIANT_ID 0x01 |
41 | #define MXT_VERSION 0x02 | 42 | #define MXT_VERSION 0x02 |
@@ -760,32 +761,11 @@ static int mxt_get_info(struct mxt_data *data) | |||
760 | struct i2c_client *client = data->client; | 761 | struct i2c_client *client = data->client; |
761 | struct mxt_info *info = &data->info; | 762 | struct mxt_info *info = &data->info; |
762 | int error; | 763 | int error; |
763 | u8 val; | ||
764 | |||
765 | error = mxt_read_reg(client, MXT_FAMILY_ID, &val); | ||
766 | if (error) | ||
767 | return error; | ||
768 | info->family_id = val; | ||
769 | |||
770 | error = mxt_read_reg(client, MXT_VARIANT_ID, &val); | ||
771 | if (error) | ||
772 | return error; | ||
773 | info->variant_id = val; | ||
774 | |||
775 | error = mxt_read_reg(client, MXT_VERSION, &val); | ||
776 | if (error) | ||
777 | return error; | ||
778 | info->version = val; | ||
779 | |||
780 | error = mxt_read_reg(client, MXT_BUILD, &val); | ||
781 | if (error) | ||
782 | return error; | ||
783 | info->build = val; | ||
784 | 764 | ||
785 | error = mxt_read_reg(client, MXT_OBJECT_NUM, &val); | 765 | /* Read 7-byte info block starting at address 0 */ |
766 | error = __mxt_read_reg(client, MXT_INFO, sizeof(*info), info); | ||
786 | if (error) | 767 | if (error) |
787 | return error; | 768 | return error; |
788 | info->object_num = val; | ||
789 | 769 | ||
790 | return 0; | 770 | return 0; |
791 | } | 771 | } |