storm: do not flood console with the gpio read values

In case a verified boot button is polled, the console is flooded with
repeating messages reporting the same button status.

Add the previously reported value to the gpio_desc structure to allow
reporting only change n state. To avoid initializing the stored value to
non-zero, store the '<read value> + 1', this way the valid values are 1 and 2,
so the uninitilized stored value (set to zero) will guarantee to trigger the
button status report.

BRANCH=storm
BUG=chrome-os-partner:36059
TEST=with the next patch applied verified that only the changes in the
     recovery button state are reported on the coreboot console.

Change-Id: I0d6682e2ff418160fc545643a4dfed401b7e4c0b
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/251710
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
1 file changed