Input: atmel_mxt_ts - Fix bug which might cause erroneous debug output due to use of krealloc

Must use data->info->XXX here, since info was pointing to buf which could have
changed after krealloc (spotted by Yufeng Shen).

Also, remove local pointer variable entirely, replace with num_objects, which
avoids having to NULL it after call to krealloc.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Improve debug in bootloader read function

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Improve handling of retries in bootloader probing

Split the retry counter in two separate booleans (for retrying the address and
sending a command to exit bootloader).

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Do not wait for completion when checking for bootloader already unlocked

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Enable irq before bootloading if necessary

If the probe detected a bootloader, the interrupt is never enabled, but it is
needed for bootloading process.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Remove duplicate T48 define

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Increase timeouts at end of bootloading process

Some newer chips take a long time to flash. Add a comment explaining that we
need to ignore completion timeout for some bootloaders.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Minor improvement to code layout in I2C retries

requested for upstreaming.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Place prototype in correct place ahead of function that uses it

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - If family/variant checks fail, do not need to parse CRCs from file

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Rearrange code slightly in config parsing

Only initialise reg variable where it is needed. This is partly to improve
diffs for upstream.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Fix bug in config parsing, must update data_pos even when not writing byte

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Improve message for config CRC mismatch, remove comment as now unnecessary

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Fail probe if info block CRC zero

It is possible with buggy comms that we might read all zeros, in which case
the driver should abort probe rather than trying to proceed.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Use scnprintf in sysfs routines

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Add T63 to active stylus defines

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Input: atmel_mxt_ts - Implement improved debug message interface

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>