summaryrefslogtreecommitdiff
path: root/include/device_state.h
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2017-01-18 17:39:44 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-23 13:38:22 -0800
commit8f118e01679402232ae70882345b4b919f980723 (patch)
tree785cefe6c9241a6aa8aa9e6857a97e79eb8c6c3c /include/device_state.h
parent38c5661f14f8a4be018e4b6e1641071c5f1fe866 (diff)
downloadchrome-ec-8f118e01679402232ae70882345b4b919f980723.tar.gz
device_state: signal if device_set_state changed the state
Each device keeps track of the last known state. If device_set_state updates the device state to a new known state, then return true. Cr50 uses this returned value to check if the state has changed instead of calculating it itself. BUG=none BRANCH=none TEST=device detection still works Change-Id: I8afac178c2c731def6f4f62ff7023fe169ec1479 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/430970 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'include/device_state.h')
-rw-r--r--include/device_state.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/device_state.h b/include/device_state.h
index 379cdb2f47..372b59cb75 100644
--- a/include/device_state.h
+++ b/include/device_state.h
@@ -37,8 +37,9 @@ int device_get_state(enum device_type device);
*
* @param device the device to update
* @param state the new device state
+ * @return true if the last_known_state was changed
*/
-void device_set_state(enum device_type device, enum device_state state);
+int device_set_state(enum device_type device, enum device_state state);
/* Update the device state based on the device gpios */
void board_update_device_state(enum device_type device);