summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorNick Dyer <nick.dyer@itdev.co.uk>2014-05-18 23:04:09 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-05-18 23:27:26 -0700
commit7bed6805615a215c3e23d5819ec3003b2fd8b98c (patch)
tree2cbe8264729c0876ba87bb5e95c126bbe9dc8b23 /drivers/input
parenta4a2ef462a5fb3a2d66cbf98dab124f34926f6bb (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')
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c33
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:
}
if (val != state) {
- dev_err(&client->dev, "Unvalid bootloader mode state\n");
+ dev_err(&client->dev, "Invalid bootloader state %02X != %02X\n",
+ val, state);
return -EINVAL;
}
@@ -540,7 +541,7 @@ mxt_get_object(struct mxt_data *data, u8 type)
return object;
}
- dev_err(&data->client->dev, "Invalid object type\n");
+ dev_err(&data->client->dev, "Invalid object type T%u\n", type);
return NULL;
}
@@ -861,7 +862,7 @@ static int mxt_get_object_table(struct mxt_data *data)
}
dev_dbg(&data->client->dev,
- "Type %2d Start %3d Size %3zd Instances %2zd ReportIDs %3u : %3u\n",
+ "T%u Start:%u Size:%zu Instances:%zu Report IDs:%u-%u\n",
object->type, object->start_address,
mxt_obj_size(object), mxt_obj_instances(object),
min_id, max_id);
@@ -915,13 +916,18 @@ static int mxt_initialize(struct mxt_data *data)
/* Get object table information */
error = mxt_get_object_table(data);
- if (error)
+ if (error) {
+ dev_err(&client->dev, "Error %d reading object table\n", error);
goto err_free_object_table;
+ }
/* Check register init values */
error = mxt_check_reg_init(data);
- if (error)
+ if (error) {
+ dev_err(&client->dev, "Error %d initializing configuration\n",
+ error);
goto err_free_object_table;
+ }
error = mxt_t6_command(data, MXT_COMMAND_BACKUPNV,
MXT_BACKUP_VALUE, false);
@@ -940,12 +946,12 @@ static int mxt_initialize(struct mxt_data *data)
info->matrix_ysize = val;
dev_info(&client->dev,
- "Family ID: %u Variant ID: %u Major.Minor.Build: %u.%u.%02X\n",
+ "Family: %u Variant: %u Firmware V%u.%u.%02X\n",
info->family_id, info->variant_id, info->version >> 4,
info->version & 0xf, info->build);
dev_info(&client->dev,
- "Matrix X Size: %u Matrix Y Size: %u Object Num: %u\n",
+ "Matrix X Size: %u Matrix Y Size: %u Objects: %u\n",
info->matrix_xsize, info->matrix_ysize,
info->object_num);
@@ -1154,7 +1160,8 @@ static ssize_t mxt_update_fw_store(struct device *dev,
dev_err(dev, "The firmware update failed(%d)\n", error);
count = error;
} else {
- dev_dbg(dev, "The firmware update succeeded\n");
+ dev_info(dev, "The firmware update succeeded\n");
+
mxt_free_object_table(data);
mxt_initialize(data);
@@ -1325,12 +1332,18 @@ static int mxt_probe(struct i2c_client *client,
goto err_free_irq;
error = input_register_device(input_dev);
- if (error)
+ if (error) {
+ dev_err(&client->dev, "Error %d registering input device\n",
+ error);
goto err_free_irq;
+ }
error = sysfs_create_group(&client->dev.kobj, &mxt_attr_group);
- if (error)
+ if (error) {
+ dev_err(&client->dev, "Failure %d creating sysfs group\n",
+ error);
goto err_unregister_device;
+ }
return 0;