Add support for sending Atmel TP/TS error message

This adds the support that when Pixel touchscreen/trackpad driver
atmel_mxt_ts is misbehaving, e.g. failed to update firmware, failed
to read messages from the chip, trigger crash reporter to send system
logging message for further debugging.

We also follow the policy that, for atmel/cypress logs, we only fetch
the last 30s of the logs.

BUG=chromium:226186
TEST=1. On Pixel, replace the touchscreen firmware file
        /opt/google/touch/firmware/162.0_1.1.170.bin
        with an empty file with the same name
     2. Force touchscreen firmware update
        /opt/google/touch/scripts/chromeos-touch-firmware-update.sh -d atmel_mxt_ts -f -n maxtouch-ts.fw
     3. After the firmware update fails, check crash report exists at
        /var/spool/crash/change__i2c_atmel_mxt_ts.XXX
     4. Check that the log contains only 30s of entries with "atmel" keyword.

Change-Id: If46a575491378405e60ad1ccbd39026ae6bf2033
Reviewed-on: https://gerrit.chromium.org/gerrit/48239
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
3 files changed
tree: 0ab34506de6be6696eb9508c3fff4f3e550f8a89
  1. crash_reporter/