Commit 23003a8496b3f8100ed215dfda438cece5745545
Committed by
Henrik Rydberg
1 parent
cf94bc09c8
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 3 additions and 23 deletions Side-by-side Diff
drivers/input/touchscreen/atmel_mxt_ts.c
... | ... | @@ -36,6 +36,7 @@ |
36 | 36 | #define MXT_FW_NAME "maxtouch.fw" |
37 | 37 | |
38 | 38 | /* Registers */ |
39 | +#define MXT_INFO 0x00 | |
39 | 40 | #define MXT_FAMILY_ID 0x00 |
40 | 41 | #define MXT_VARIANT_ID 0x01 |
41 | 42 | #define MXT_VERSION 0x02 |
42 | 43 | |
43 | 44 | |
... | ... | @@ -760,32 +761,11 @@ |
760 | 761 | struct i2c_client *client = data->client; |
761 | 762 | struct mxt_info *info = &data->info; |
762 | 763 | int error; |
763 | - u8 val; | |
764 | 764 | |
765 | - error = mxt_read_reg(client, MXT_FAMILY_ID, &val); | |
765 | + /* Read 7-byte info block starting at address 0 */ | |
766 | + error = __mxt_read_reg(client, MXT_INFO, sizeof(*info), info); | |
766 | 767 | if (error) |
767 | 768 | 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 | - | |
785 | - error = mxt_read_reg(client, MXT_OBJECT_NUM, &val); | |
786 | - if (error) | |
787 | - return error; | |
788 | - info->object_num = val; | |
789 | 769 | |
790 | 770 | return 0; |
791 | 771 | } |