google/chromeec: Ensure data is ready before reading it

Before reading the data provided by EC to the host, ensure that data
ready flag is set. Otherwise, it could result in reading stale/incorrect
data from the data buffer.

TEST=Verified that lidclose event is read correctly by host on reef.

Change-Id: I88e345d64256af8325b3dbf670467d09f09420f0
Signed-off-by: Furquan Shaikh <>
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <>
1 file changed