diff options
author | Nick Dyer <nick.dyer@itdev.co.uk> | 2014-05-19 02:04:09 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-05-19 02:27:26 -0400 |
commit | 7bed6805615a215c3e23d5819ec3003b2fd8b98c (patch) | |
tree | 2cbe8264729c0876ba87bb5e95c126bbe9dc8b23 /drivers/input/touchscreen/atmel_mxt_ts.c | |
parent | a4a2ef462a5fb3a2d66cbf98dab124f34926f6bb (diff) |
Input: atmel_mxt_ts - improve error reporting and debug
- Add error messages for probe errors
- Report type in invalid object type
- Tweak some other debug output messages
Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
Acked-by: Yufeng Shen <miletus@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/atmel_mxt_ts.c')
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index d3aef870d255..278f364ec6e1 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -420,7 +420,8 @@ recheck: | |||
420 | } | 420 | } |
421 | 421 | ||
422 | if (val != state) { | 422 | if (val != state) { |
423 | dev_err(&client->dev, "Unvalid bootloader mode state\n"); | 423 | dev_err(&client->dev, "Invalid bootloader state %02X != %02X\n", |
424 | val, state); | ||
424 | return -EINVAL; | 425 | return -EINVAL; |
425 | } | 426 | } |
426 | 427 | ||
@@ -540,7 +541,7 @@ mxt_get_object(struct mxt_data *data, u8 type) | |||
540 | return object; | 541 | return object; |
541 | } | 542 | } |
542 | 543 | ||
543 | dev_err(&data->client->dev, "Invalid object type\n"); | 544 | dev_err(&data->client->dev, "Invalid object type T%u\n", type); |
544 | return NULL; | 545 | return NULL; |
545 | } | 546 | } |
546 | 547 | ||
@@ -861,7 +862,7 @@ static int mxt_get_object_table(struct mxt_data *data) | |||
861 | } | 862 | } |
862 | 863 | ||
863 | dev_dbg(&data->client->dev, | 864 | dev_dbg(&data->client->dev, |
864 | "Type %2d Start %3d Size %3zd Instances %2zd ReportIDs %3u : %3u\n", | 865 | "T%u Start:%u Size:%zu Instances:%zu Report IDs:%u-%u\n", |
865 | object->type, object->start_address, | 866 | object->type, object->start_address, |
866 | mxt_obj_size(object), mxt_obj_instances(object), | 867 | mxt_obj_size(object), mxt_obj_instances(object), |
867 | min_id, max_id); | 868 | min_id, max_id); |
@@ -915,13 +916,18 @@ static int mxt_initialize(struct mxt_data *data) | |||
915 | 916 | ||
916 | /* Get object table information */ | 917 | /* Get object table information */ |
917 | error = mxt_get_object_table(data); | 918 | error = mxt_get_object_table(data); |
918 | if (error) | 919 | if (error) { |
920 | dev_err(&client->dev, "Error %d reading object table\n", error); | ||
919 | goto err_free_object_table; | 921 | goto err_free_object_table; |
922 | } | ||
920 | 923 | ||
921 | /* Check register init values */ | 924 | /* Check register init values */ |
922 | error = mxt_check_reg_init(data); | 925 | error = mxt_check_reg_init(data); |
923 | if (error) | 926 | if (error) { |
927 | dev_err(&client->dev, "Error %d initializing configuration\n", | ||
928 | error); | ||
924 | goto err_free_object_table; | 929 | goto err_free_object_table; |
930 | } | ||
925 | 931 | ||
926 | error = mxt_t6_command(data, MXT_COMMAND_BACKUPNV, | 932 | error = mxt_t6_command(data, MXT_COMMAND_BACKUPNV, |
927 | MXT_BACKUP_VALUE, false); | 933 | MXT_BACKUP_VALUE, false); |
@@ -940,12 +946,12 @@ static int mxt_initialize(struct mxt_data *data) | |||
940 | info->matrix_ysize = val; | 946 | info->matrix_ysize = val; |
941 | 947 | ||
942 | dev_info(&client->dev, | 948 | dev_info(&client->dev, |
943 | "Family ID: %u Variant ID: %u Major.Minor.Build: %u.%u.%02X\n", | 949 | "Family: %u Variant: %u Firmware V%u.%u.%02X\n", |
944 | info->family_id, info->variant_id, info->version >> 4, | 950 | info->family_id, info->variant_id, info->version >> 4, |
945 | info->version & 0xf, info->build); | 951 | info->version & 0xf, info->build); |
946 | 952 | ||
947 | dev_info(&client->dev, | 953 | dev_info(&client->dev, |
948 | "Matrix X Size: %u Matrix Y Size: %u Object Num: %u\n", | 954 | "Matrix X Size: %u Matrix Y Size: %u Objects: %u\n", |
949 | info->matrix_xsize, info->matrix_ysize, | 955 | info->matrix_xsize, info->matrix_ysize, |
950 | info->object_num); | 956 | info->object_num); |
951 | 957 | ||
@@ -1154,7 +1160,8 @@ static ssize_t mxt_update_fw_store(struct device *dev, | |||
1154 | dev_err(dev, "The firmware update failed(%d)\n", error); | 1160 | dev_err(dev, "The firmware update failed(%d)\n", error); |
1155 | count = error; | 1161 | count = error; |
1156 | } else { | 1162 | } else { |
1157 | dev_dbg(dev, "The firmware update succeeded\n"); | 1163 | dev_info(dev, "The firmware update succeeded\n"); |
1164 | |||
1158 | mxt_free_object_table(data); | 1165 | mxt_free_object_table(data); |
1159 | 1166 | ||
1160 | mxt_initialize(data); | 1167 | mxt_initialize(data); |
@@ -1325,12 +1332,18 @@ static int mxt_probe(struct i2c_client *client, | |||
1325 | goto err_free_irq; | 1332 | goto err_free_irq; |
1326 | 1333 | ||
1327 | error = input_register_device(input_dev); | 1334 | error = input_register_device(input_dev); |
1328 | if (error) | 1335 | if (error) { |
1336 | dev_err(&client->dev, "Error %d registering input device\n", | ||
1337 | error); | ||
1329 | goto err_free_irq; | 1338 | goto err_free_irq; |
1339 | } | ||
1330 | 1340 | ||
1331 | error = sysfs_create_group(&client->dev.kobj, &mxt_attr_group); | 1341 | error = sysfs_create_group(&client->dev.kobj, &mxt_attr_group); |
1332 | if (error) | 1342 | if (error) { |
1343 | dev_err(&client->dev, "Failure %d creating sysfs group\n", | ||
1344 | error); | ||
1333 | goto err_unregister_device; | 1345 | goto err_unregister_device; |
1346 | } | ||
1334 | 1347 | ||
1335 | return 0; | 1348 | return 0; |
1336 | 1349 | ||